[BUG] plugin:github:github MCP fails with HTTP 400 — malformed JSON-RPC payload missing version tag
Preflight Checklist
- [ ] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Description
The GitHub MCP plugin (plugin:github:github) fails to connect with HTTP 400 from https://api.githubcopilot.com/mcp/.
Environment
- Claude Code version: 2.1.150
- OS: macOS
- Auth:
ghCLI withcopilot,gist,read:org,repo,workflowscopes
Error
Failed to reconnect to plugin:github:github: HTTP 400 at https://api.githubcopilot.com/mcp/
Root Cause (diagnosed)
Manually curling the endpoint with an empty payload returns:
malformed payload: invalid message version tag ""; expected "2.0"
The plugin appears to be sending a request without the required "jsonrpc": "2.0" field.
A correct JSON-RPC 2.0 initialize request to the same endpoint returns HTTP 200 successfully,
confirming the endpoint and account are fine — the bug is in the plugin's request construction.
Steps to Reproduce
- Enable GitHub MCP plugin in Claude Code settings
- Authenticate with
gh auth login --scopes copilot,gist,read:org,repo,workflow - Run
/mcp— plugin fails with HTTP 400
What Should Happen?
The plugin appears to be sending a request without the required "jsonrpc": "2.0" field.
A correct JSON-RPC 2.0 initialize request to the same endpoint returns HTTP 200 successfully,
confirming the endpoint and account are fine — the bug is in the plugin's request construction.
Error Messages/Logs
Failed to reconnect to plugin:github:github: HTTP 400 at https://api.githubcopilot.com/mcp/
Steps to Reproduce
- Enable GitHub MCP plugin in Claude Code settings
- Authenticate with
gh auth login --scopes copilot,gist,read:org,repo,workflow - Run
/mcp— plugin fails with HTTP 400
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.150
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
20 Comments
up pls
up
up
did you solved it?
Up
up
up
up
up
also happens on linux
up
up
@claude fix this, open a PR referencing this issue, review it, merge it, and tag a new release. Top priority, no mistakes
I was able to fix my GitHub MCP by adding
GITHUB_PERSONAL_ACCESS_TOKENon my Claude global configedit
~/.claude/settings.jsonIt can also be fixed by adding
EXPORT GITHUB_PERSONAL_ACCESS_TOKEN=tokenin your shell profile, like~/.zshrcI can confirm it works.
For some reason this doesn't
i was try this, but still not work
this works for me, thanks
Make sure to follow these instructions:
🔗 https://github.com/github/github-mcp-server/blob/main/docs/installation-guides/install-claude.md
From your terminal
Troubleshooting
You may need to remove your local Github MCP configuration if was improperly configured before:
This issue has also occurred for me whilst, being on windows. So the macos label is false.
Adding a reproduction for what looks like a second, distinct cause of this same 400. The original report diagnoses a malformed JSON-RPC payload missing the
"jsonrpc": "2.0"tag. On my machine the payload is fine and the auth header is the problem, so anyone landing here should check which error their debug log actually names before trying a fix.Claude Code 2.1.235, macOS 26.5.2,
plugin:github:githubfrom the official marketplace.The error
From
~/.claude/debug/<session>.txt:Note this is not
malformed payload: invalid message version tag, which is what the OP saw.Cause
The plugin's
.mcp.jsonsets:Claude Code expands that from its own process environment. Exporting the variable in
.zshenvor.zshrcdoes not reach it, so the header goes out empty (or as the literal${...}) and GitHub rejects it.Isolating which side is broken
Four requests to the same endpoint, same account:
| Request | Result |
|---|---|
| Valid token + valid
initialize| 200 || Valid token + empty body | 400
POST requires a non-empty body|| Empty token + valid
initialize| 400bad request: Authorization header is badly formatted|| Literal
${GITHUB_PERSONAL_ACCESS_TOKEN}+ validinitialize| 400bad request: Authorization header is badly formatted|Rows 3 and 4 reproduce the logged error exactly. Row 2 is the OP's failure mode. Row 1 confirms the endpoint, token and account are fine.
Reproduction
You cannot reproduce this from a shell that already exports the token, because the child
claudeprocess inherits it. That cost me a wrong conclusion, so unset it explicitly:Add the token to
envin~/.claude/settings.json:This is the workaround @ph7jack posted, and the A/B above may explain why the shell-export half of it works for some people and not others: only the
settings.jsonentry is guaranteed to land in the process that expands the header. Whether the export works depends on how that particular Claude Code process was launched.Two things that cost time
claude mcp listreported✔ Connectedfor this server the whole time it was failing, and a directinitializeandtools/listagainst the endpoint both returned 200. The only accurate signal was~/.claude/debug/*.txt.It may also be worth failing loudly when a referenced variable is unset at expansion time, rather than sending
Bearerand surfacing a generic remote 400 that points at the wrong layer.