[DOCS] MCP configuration docs omit the warning for hidden leading or trailing whitespace
Documentation Type
Missing documentation (feature not documented)
Documentation Location
https://code.claude.com/docs/en/mcp
Section/Topic
MCP server configuration and troubleshooting, especially values entered through .mcp.json, claude mcp add, and related server-management commands.
Current Documentation
The configuration section currently says:
The resulting .mcp.json file follows a standardized format:
and shows server fields such as command, args, env, and url. The server-management section documents commands including claude mcp list, claude mcp get <name>, and /mcp, but it does not describe validation or warnings for hidden whitespace in MCP configuration values.
What's Wrong or Missing?
Claude Code 2.1.218 warns when an MCP configuration value contains hidden leading or trailing whitespace. The current guide gives users no way to recognize that a value was entered with an invisible character, why the server may fail to connect, or where to look for the warning.
This is particularly important for copied URLs, headers, server names, and environment values, where the visible text can look correct while the serialized value contains an extra space.
Suggested Improvement
Add an MCP configuration-validation note explaining that Claude Code warns about leading or trailing whitespace in values and that the warning is intended to catch copied or hand-edited values that fail to match exactly.
Document which command surfaces show the warning (claude mcp list and /mcp) and provide a small before/after example with a visibly marked trailing space. Explain how to remove the whitespace from .mcp.json or re-add the server with a clean value.
Keep this separate from connection-failure status diagnostics and from the OAuth “needs authentication” state, since hidden whitespace is a configuration validation problem rather than an authentication state.
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/mcp | Configuration format, server management, and troubleshooting |
| https://code.claude.com/docs/en/mcp-quickstart | Initial server setup where copied values are commonly entered |
| https://code.claude.com/docs/en/cli-reference | Command-line reference for MCP management commands |
Total scope: 3 pages should make the whitespace warning discoverable.
The behavior was added in Claude Code v2.1.218.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗