Documented MCP import from Claude Desktop fails due to tool name length validation

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 4 comments · opened Jun 22, 2025 · closed Jun 25, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.
meta: This GitHub issue was created using Claude Desktop with the same MCP_DOCKER server that fails in Claude Code, demonstrating that the MCP server works correctly in Claude Desktop.

Documented MCP import from Claude Desktop fails due to tool name length validation

Environment

  • Platform: Anthropic API
  • Claude CLI version: 1.0.31
  • Operating System: Mac 15.3.2
  • Terminal: iTerm2

Bug Description

The documented process for importing MCP servers from Claude Desktop to Claude Code fails when using the GitHub Official MCP Server. Claude Code rejects the import due to a tool name exceeding 64 characters, while Claude Desktop accepts and works with the same MCP server configuration without issues.

Documentation reference: https://docs.anthropic.com/en/docs/claude-code/mcp#import-mcp-servers-from-claude-desktop

Steps to Reproduce

  1. Install Docker Desktop: brew install --cask docker
  2. In Docker Desktop, add GitHub Official MCP Server to MCP Toolkit (requires GitHub personal access token)
  3. In Docker Desktop, connect Claude Desktop to MCP Toolkit
  4. Verify the MCP server works correctly in Claude Desktop
  5. Follow documented process: claude mcp add-from-claude-desktop
  6. Select and import the MCP_DOCKER server
  7. Start Claude Code: claude
  8. Attempt any interaction

Expected Behavior

As per the documentation, MCP servers that work in Claude Desktop should be importable and functional in Claude Code. The documented workflow should work without errors.

Actual Behavior

The documented import process succeeds, but Claude Code fails to function:

➜  mcp-servers claude mcp add-from-claude-desktop
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                     │
│ Import MCP Servers from Claude Desktop                                                              │
│                                                                                                     │
│ Found 1 MCP server in Claude Desktop.                                                               │
│                                                                                                     │
│ Please select the servers you want to import:                                                       │
│                                                                                                     │
│ ❯ MCP_DOCKER ✔                                                                                      │
│                                                                                                     │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯

Successfully imported 1 MCP server to local config.

➜  mcp-servers claude
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/steven/mcp-servers                  │
╰───────────────────────────────────────────────────╯

> hello
  ⎿ API Error: 400
    {"type":"error","error":{"type":"invalid_request_error","message":"tools.17.custom.name:
    String should have at most 64 characters"}}

Root Issue

This represents a lack of parity between Claude Desktop and Claude Code:

  • Claude Desktop: Accepts and works with the GitHub Official MCP Server
  • Claude Code: Rejects the same MCP server due to API validation constraints

The documented workflow promises seamless migration between the two tools, but this fails in practice.

Current Workaround

claude mcp remove MCP_DOCKER

This defeats the purpose of the documented import feature and breaks the expected unified experience across Anthropic's tools.

Additional Context

  • Same MCP server configuration works perfectly in Claude Desktop
  • Error indicates tool #17 has a name longer than 64 characters
  • This affects the GitHub Official MCP Server specifically (51 tools total)
  • The 64-character limitation appears to be an API constraint in Claude Code that doesn't exist in Claude Desktop

View original on GitHub ↗

4 Comments

CXwudi · 1 year ago

I found a workaround, change the MCP server name to something shorter so that the tool name stays within 64 characters, for example, use gh instead of github:

"gh": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": ""
      },
      "type": "stdio"
    }

Then the longest tool would stay within 64 characters:

add_pull_request_review_comment_to_pending_review (gh)                                                               │
│                                                                                                                      │
│ Full name: mcp__gh__add_pull_request_review_comment_to_pending_review
can you test if the github mcp is working?

● I'll test the GitHub MCP by checking what GitHub functionality is available and then trying a simple operation.
  ⎿  {
       "login": "CXwudi",
ashwin-ant collaborator · 1 year ago

This should be fixed! Tool names can now be up to 128 characters.

startakovsky · 1 year ago

Thanks for making this specific change so quickly it helped me out. I also agree that the bug itself still exists in the presence of a tool name long enough that it will freeze up claude code from working. Does it matter and is it realistic to fix? Probably not. 🖖

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.