[BUG] MCP documentation generates incorrect setup commands for all servers
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?
The MCP documentation page at https://code.claude.com/docs/en/mcp displays incorrect setup commands for every MCP server in the "Popular MCP servers" section.
The generateClaudeCodeCommand function in the page's JavaScript generates commands with the wrong argument order:
claude mcp add circleback --transport http https://app.circleback.ai/api/mcp
^^^^^^^^^^^ ^^^^^^^^^^^^^^^
server name options (WRONG ORDER)
Options (--transport) are placed AFTER the server name, but the CLI requires options BEFORE the server name.
What Should Happen?
The generated commands should follow the documented CLI syntax:
claude mcp add --transport http circleback https://app.circleback.ai/api/mcp
^^^^^^^^^^^^^^^ ^^^^^^^^^^^
options server name (CORRECT ORDER)
Error Messages/Logs
Users copying the displayed commands will encounter argument parsing errors or unexpected behavior because the options are in the wrong position relative to the server name.
Steps to Reproduce
- Go to https://code.claude.com/docs/en/mcp
- Scroll to "Popular MCP servers" section
- Look at any displayed command (e.g., Circleback, Atlassian, etc.)
- Observe the command shows:
claude mcp add <name> --transport <type> <url> - Compare to the documented syntax in "Option 1" section:
claude mcp add --transport <type> <name> <url> - Note the contradiction
Alternatively, view the raw source at https://code.claude.com/docs/en/mcp.md and examine the generateClaudeCodeCommand function (lines 94-111).
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.17
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Related Issue
This is the root cause of Issue #19652, which reported that the Atlassian MCP command specifically was incorrect. This bug report identifies that ALL dynamically generated MCP commands are affected, not just Atlassian.
Root Cause
The bug is in the generateClaudeCodeCommand function within the MDX source:
// Current (buggy) code
if (server.urls.http) {
return `claude mcp add ${serverSlug} --transport http ${server.urls.http}`;
}
if (server.urls.sse) {
return `claude mcp add ${serverSlug} --transport sse ${server.urls.sse}`;
}
Suggested Fix
// Corrected code
if (server.urls.http) {
return `claude mcp add --transport http ${serverSlug} ${server.urls.http}`;
}
if (server.urls.sse) {
return `claude mcp add --transport sse ${serverSlug} ${server.urls.sse}`;
}
Evidence
The same page explicitly documents the correct syntax:
Important: Option ordering All options (--transport,--env,--scope,--header) must come before the server name.
The generated commands contradict this documented requirement.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗