GitHub MCP failing to start

I can’t seem to get the GH MCP working. I’m signed in to GH and features like git sync work fine, but the MCP fails to start up:

2026-03-04 12:48:26.673 [info] Creating streamableHttp transport
2026-03-04 12:48:26.953 [info] Connecting to streamableHttp server
2026-03-04 12:48:27.236 [error] Client error for command Streamable HTTP error: Error POSTing to endpoint: bad request: Authorization header is badly formatted

2026-03-04 12:48:27.237 [warning] [V1] initializing -> error: Streamable HTTP error: Error POSTing to endpoint: bad request: Authorization header is badly formatted

2026-03-04 12:48:27.237 [info] Client closed for command
2026-03-04 12:48:27.237 [warning] Error connecting to streamableHttp server, falling back to SSE: Streamable HTTP error: Error POSTing to endpoint: bad request: Authorization header is badly formatted

2026-03-04 12:48:27.237 [info] Connecting to SSE server
2026-03-04 12:48:27.540 [error] Client error for command SSE error: Non-200 status code (400)
2026-03-04 12:48:27.541 [error] Error connecting to SSE server after fallback: SSE error: Non-200 status code (400) SSE error: Non-200 status code (400)
2026-03-04 12:48:27.541 [info] Client closed for command

I tried running security delete-generic-password -s “cursor-mcp” and restarting Cursor, to no avail.

1 Like

Same issue here.

Hey there.

Have you followed GitHub’s instructions for using the MCP Server with Cursor?

What does your mcp.json file look like?

Hey Colin, it works if pasted to the file. It stopped working when it is passed from env variable as advised here: Secure secret handing for MCPs - #4 by mohitjain

    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${env:CURSOR_GITHUB_TOKEN}"
      }
    }

Did you change anything to the interpolation of the file?

Thanks for the details. The ${env:CURSOR_GITHUB_TOKEN} syntax should resolve in headers for remote MCP servers. If it’s working with a hardcoded token but not with the env var reference, the most likely cause is that the environment variable isn’t available to Cursor’s process at startup.

Could you try these steps to narrow it down:

  1. Open a terminal and confirm the variable is set: echo $CURSOR_GITHUB_TOKEN

  2. Launch Cursor directly from that terminal: cursor

  3. Test the MCP connection again

If it works when launched from the terminal, the fix is to ensure the variable is set system-wide rather than only in your shell profile. On macOS, you can use launchctl setenv CURSOR_GITHUB_TOKEN your_token_value so it’s available to GUI apps. On Linux, set it in /etc/environment.