claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] API Error: tools..custom.name exceeds 64-character limit when adding GitHub MCP server

Open PierrunoYT opened this issue 6 months ago • 1 comments

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

  1. Install Claude Code CLI
  2. Run the following command (replace your_token_here with 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
  1. 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!

PierrunoYT avatar Jun 24 '25 14:06 PierrunoYT

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!

ts-shu avatar Jun 27 '25 19:06 ts-shu

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?

zylinc-dei avatar Oct 09 '25 08:10 zylinc-dei

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.

github-actions[bot] avatar Dec 07 '25 10:12 github-actions[bot]