Remoun
(Remoun Metyas)
March 4, 2026, 8:53pm
1
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
Colin
(Colin)
March 10, 2026, 1:49pm
4
Hey there.
Have you followed GitHub’s instructions for using the MCP Server with Cursor?
# Install GitHub MCP Server in Cursor
## Prerequisites
1. Cursor IDE installed (latest version)
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes
3. For local installation: [Docker](https://www.docker.com/) installed and running
## Remote Server Setup (Recommended)
[](https://cursor.com/en/install-mcp?name=github&config=eyJ1cmwiOiJodHRwczovL2FwaS5naXRodWJjb3BpbG90LmNvbS9tY3AvIiwiaGVhZGVycyI6eyJBdXRob3JpemF0aW9uIjoiQmVhcmVyIFlPVVJfR0lUSFVCX1BBVCJ9fQ%3D%3D)
Uses GitHub's hosted server at https://api.githubcopilot.com/mcp/. Requires Cursor v0.48.0+ for Streamable HTTP support. While Cursor supports OAuth for some MCP servers, the GitHub server currently requires a Personal Access Token.
### Install steps
1. Click the install button above and follow the flow, or go directly to your global MCP configuration file at `~/.cursor/mcp.json` and enter the code block below
2. In Tools & Integrations > MCP tools, click the pencil icon next to "github"
3. Replace `YOUR_GITHUB_PAT` with your actual [GitHub Personal Access Token](https://github.com/settings/tokens)
4. Save the file
This file has been truncated. show original
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:
Open a terminal and confirm the variable is set: echo $CURSOR_GITHUB_TOKEN
Launch Cursor directly from that terminal: cursor
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.