[BUG] API Error: tools..custom.name exceeds 64-character limit when adding GitHub MCP server
API Error: tools..custom.name exceeds 64-character limit when adding GitHub MCP server
Summary
When adding the official GitHub MCP server (github.com/github/github-mcp-server) to Claude Code using the recommended Docker command and a valid GitHub Personal Access Token, I receive the following error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.17.custom.name: String should have at most 64 characters"}}
This appears related to a tool name exceeding the 64-character limit enforced by Claude Code.
Steps to reproduce
- Install Claude Code CLI
- Run the following command (replace
your_token_herewith a valid GitHub PAT):
claude mcp add github.com/github/github-mcp-server \
-e GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here \
-- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
- Observe the API error regarding tool name length
Expected behavior
The GitHub MCP server should be added successfully without errors.
Environment
- Claude Code CLI version: [your version]
- Operating System: [your OS and version]
- Docker version: [your Docker version]
Additional notes
- I have confirmed that the GitHub PAT is valid and properly scoped
- Removing other MCP servers or resetting MCP project choices did not resolve the issue
- This issue seems related to the number or length of tool names handled by the MCP server or Claude Code
Request
Please consider increasing the allowed length for tool names or trimming tool name length to avoid this error.
Thank you!
Hi, confirming still seeing the same as well as of v1.0.35
Is the fix here: https://github.com/anthropics/claude-code/issues/2412#issuecomment-3002255433 unreleased or a regression?
Thanks!
It seems this limit has been increased to 128 API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message": tools.187.custom.name: String should have at most 128 characters"},"request_id":"req_011CTwHBZqXCXtanGmzRURbE"}
Asking Claude Code about this will explain its an token efficiency limit, is it possible to set this limit ourselves if spending tokens is not a concern?
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.