[BUG] /MCP connector name not picked up for OAuth-protected servers — UUID used instead of `serverInfo.name` in Claude.ai — inconsistent behavior
Preflight Checklist
- [x] 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?
When an OAuth-protected MCP server (Streamable HTTP transport) is added as a connector in Claude Code,
tools are prefixed with the connector's internal UUID instead of the serverInfo.name returned by
the server in the MCP initialize response.
Example with the Nao MCP server (open source: https://github.com/getnao/nao), which returns serverInfo: { name: "nao" } in its initialize response:
| Client | Auth | Actual tool prefix |
|----------------|-------|-------------------------------------------------|
| Claude Code | OAuth | mcp__59b0526c-6727-40a3-ab19-56ee5b9691e8__* ❌ |
| Claude.ai chat | OAuth | mcp__nao__* ✓ |
| Claude Code | API key (Twenty MCP) | mcp__twenty__* ✓ |
The server name is invisible to the model. Asking Claude to "use the nao connector" or "use ask_nao"
fails because the tool prefix doesn't match anything recognizable.
Related (but distinct) issues about the downstream 64-char budget impact: #22276, #22599.
What Should Happen?
Claude Code should use serverInfo.name from the MCP initialize response as the tool prefix,
consistent with how Claude.ai chat handles the same server.
Tools should appear as mcp__nao__ask_nao, not mcp__<uuid>__ask_nao.
Steps to Reproduce
- Add a remote MCP connector in Claude Code settings pointing to an OAuth-protected Streamable HTTP
MCP server
- Complete the OAuth flow when prompted
- Start a new Claude Code session
- Notice tools are listed as
mcp__<uuid>__<tool_name>instead ofmcp__nao__<tool_name> - Connect the same server as a connector in Claude.ai chat — tools appear as
mcp__nao__*
The discrepancy only occurs with OAuth-protected servers. Non-OAuth connectors (e.g. Twenty MCP,
which uses a static API key) correctly show the server name in Claude Code.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.133 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Hypothesis: Claude Code records the connector identifier at the moment of the first connection
attempt, which returns 401 (no OAuth token yet). The UUID is stored as a fallback at that point.
After OAuth completes and initialize succeeds with serverInfo: { name: "nao" }, the stored
prefix is never updated.
Non-OAuth connectors don't hit this race because the first connection succeeds immediately
(token is in the config), so serverInfo.name is captured before any fallback is needed.
Reproducible server: https://github.com/getnao/nao (self-hostable, open source that you can run locally with docker compose up)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗