MCP tool names can exceed 64-character API limit causing session-breaking errors
Resolved 💬 3 comments Opened Jan 24, 2026 by bassic-nerd Closed Jan 29, 2026
Description
When remote MCP servers are connected via Claude.ai, the tool naming convention (mcp__<server_namespace>__<tool_name>) can produce names exceeding the 64-character API limit, causing session-breaking errors.
Example
Tool names from Cloudflare Developer Platform MCP:
mcp__claude_ai_Cloudflare_Developer_Platform_2__hyperdrive_config_edit= 70 charsmcp__claude_ai_Cloudflare_Developer_Platform_2__search_cloudflare_documentation= 79 charsmcp__claude_ai_Cloudflare_Developer_Platform_2__migrate_pages_to_workers_guide= 78 chars
Error
When ToolSearch returns these tools, the API throws a 400 error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.14.content.0.tool_result.content.3.tool_reference.tool_name: String should have at most 64 characters"},"request_id":"..."}
Impact
- Breaks the current session
- Prevents tool discovery from working
- User must disconnect the problematic MCP servers to recover
Reproduction
- Connect Cloudflare Developer Platform MCP via Claude.ai integrations
- Start a Claude Code session
- Use ToolSearch to discover tools
- Session breaks with the above error
Suggested Fixes
- Truncate or hash long server names in the
mcp__prefix - Validate tool name length before registering MCP tools and warn/reject if over limit
- Use shorter default names for built-in remote MCP connections (e.g.,
cloudflareinstead ofclaude_ai_Cloudflare_Developer_Platform) - Gracefully handle the error in ToolSearch rather than breaking the session
Workaround
Disconnect the duplicate Cloudflare MCP server from Claude.ai settings to remove the _2 suffix tools.
Environment
- Claude Code CLI
- macOS
- Multiple MCP servers connected (local + remote via Claude.ai)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗