MCP tool names exceed Anthropic's 64-char API limit in Claude Code with awslabs core-mcp-server
Using awslabs core-mcp-server with the finops role enabled in Claude Code (Anthropic CLI), the
billing_cost_managementimport prefix plus Claude Code'smcp__awslabs_core-mcp-server__prefix leaves only 10 characters for tool names, so 13 of 14 billing tools exceed the Anthropic API's 64-character limit. The API returnsinvalid_request_error: tool_reference.tool_name: String should have at most 64 charactersand the session becomes unusable until restarted. Is there a fix or a workaround?Originally asked on GitHub: https://github.com/awslabs/mcp/issues/2214
4 answers
The issue is closed as NOT_PLANNED: the maintainers closed it because core-mcp-server was deprecated and recommended configuring individual MCP servers directly (see docs/migration-core.md in the repo). A pull request (#2542) shortened the import prefix from
billing_cost_managementtobcmin the source, but the thread does not confirm a released version, so there is no verified fix to upgrade to.Root cause: Claude Code builds tool names as
mcp__<server>__<tool_name>. For core-mcp-server with the finops role, the 30-charactermcp__awslabs_core-mcp-server__prefix plus the original 24-characterbilling_cost_management_import prefix left only 10 characters for the tool name. 13 of the 14 imported billing tools exceeded the Anthropic API's 64-character limit, and the API rejected the session withinvalid_request_error: tool_reference.tool_name: String should have at most 64 characters. One oversized tool breaks the whole session, not just that tool.The standalone workaround suggested in the issue only works partially: Claude Code derives the name prefix from the package name in the command args, not from the
mcpServersconfig key. Withawslabs.billing-cost-management-mcp-serverin args, 11 of 14 tools fit, butbcm-pricing-calc,compute-optimizer, andcost-optimizationstill exceed the limit. The source-side PR (#2542) changes the prefix tobcm, giving names likemcp__awslabs_core-mcp-server__bcm_cost-optimizationat 51 characters.General advice: before wiring an MCP server into Claude Code, measure the full tool name (
mcp__<server-or-package>__<tool>) against the 64-character API cap, since the server prefix alone can consume 30–50 characters. For current setups, follow the migration guide and add the individual AWS MCP servers directly instead of core-mcp-server.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Enabled the finops role on core-mcp-server in Claude Code and asked about AWS cost optimization. The session then failed with the 64-character API error; 13 of 14 billing tools exceeded the limit.
Source: https://github.com/awslabs/mcp/issues/2214 (opens external site)
Did this work for you?What @svaeyens tried on GitHub (Partly worked)
Configured billing-cost-management-mcp-server standalone with the config key "bcm" and
uvx awslabs.billing-cost-management-mcp-server@latestin args. 11 of 14 tools fit, but bcm-pricing-calc, compute-optimizer, and cost-optimization still exceeded the limit because Claude Code uses the package name from args, not the config key.Source: https://github.com/awslabs/mcp/issues/2214#issuecomment-3770116056 (opens external site)
Did this work for you?What @Br1an67 tried on GitHub (Worked)
PR #2542 shortened the core-mcp-server import prefix from
billing_cost_managementtobcm, which the author states brings all 14 tool names under the 64-character limit. The thread does not confirm whether this was released, and the issue was closed as NOT_PLANNED due to deprecation.Source: https://github.com/awslabs/mcp/issues/2214#issuecomment-3980552972 (opens external site)
Did this work for you?
Related questions
- AWS Diagram MCP server: generate_diagram fails with No module named 'sarif_om'
- DynamoDB MCP server fails: FastMCP.__init__() got an unexpected keyword argument 'version'
- AWS MCP server not using AWS_CONTAINER_AUTHORIZATION_TOKEN when run via Docker MCP Toolkit?
- EKS MCP server: how to switch AWS profiles or Kubernetes contexts dynamically?
- postgres-mcp-server: run_query fails with "No database connection available"