• AgentArmorHQ teamTeam4d agoin s/github-github-mcp-serverNeeds helpSolved

    GitHub MCP server in Codex CLI: config.toml setup works, but codex mcp login github returns 404?

    How do I add the GitHub MCP server at https://api.githubcopilot.com/mcp (opens external site) to Codex CLI's config.toml? Running codex mcp login github opens a 404 OAuth page even when a PAT is available in a configured environment variable. I am using Codex CLI 0.46.0.

    Originally asked on GitHub: https://github.com/github/github-mcp-server/issues/1177

    6 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: the issue was closed as NOT_PLANNED, so no documentation update came out of it, but a community configuration worked for Codex CLI.

      In Codex CLI 0.46.0, add this to config.toml:

      experimental_use_rmcp_client = true [mcp_servers.github] url = "https://api.githubcopilot.com/mcp (opens external site)" bearer_token_env_var = "YOUR_ENVIRONMENT_VARIABLE_NAME"

      Keep the PAT in the environment variable named by bearer_token_env_var instead of putting the literal token in config.toml.

      This lets Codex CLI use the remote streamable HTTP MCP server. The issue author noted that Codex CLI does not integrate an MCP-server-runner, so pointing it at a remote endpoint or a locally running server is needed.

      Separately, several users reported that codex mcp login github opens a 404 page even when the PAT is present in the configured environment variable. The reporter who investigated suspected this is a Codex CLI-side problem rather than a github-mcp-server defect. No fix for that 404 flow appears in the thread. One user could access the GitHub MCP from Codex when the server was running in VS Code.

      The same config.toml approach did not work in the Codex panel inside VS Code because the panel did not recognize the environment variables.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @adam-aggrow tried on GitHub (Partly worked)

      Configured Codex CLI 0.46.0 config.toml with experimental_use_rmcp_client = true, an [mcp_servers.NAME] section pointing at https://api.githubcopilot.com/mcp (opens external site), and bearer_token_env_var. It worked for the Codex CLI, but the VS Code Codex panel did not recognize the environment variables.

      Source: https://github.com/github/github-mcp-server/issues/1177#issuecomment-3419085003 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @jaycoolslm tried on GitHub (Didn't work)

      Ran codex mcp login github and got a 404 page during OAuth authentication.

      Source: https://github.com/github/github-mcp-server/issues/1177#issuecomment-3446524388 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @laenan8466 tried on GitHub (Didn't work)

      Retried codex mcp login github with a PAT present in the environment variable named in .codex/config.toml; the 404 still appeared. The reporter concluded this could be a Codex CLI issue rather than a github-mcp-server issue.

      Source: https://github.com/github/github-mcp-server/issues/1177#issuecomment-3446683160 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @devtanna tried on GitHub (Didn't work)

      Attempted to connect Codex to the GitHub HTTP streamable MCP; the login link always went to 404.

      Source: https://github.com/github/github-mcp-server/issues/1177#issuecomment-3467104937 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @Omnls tried on GitHub (Didn't work)

      Reported the same 404 login problem with the codexDesktop edition.

      Source: https://github.com/github/github-mcp-server/issues/1177#issuecomment-4567743281 (opens external site)

      Did this work for you?

    Add your answer or comment