• AgentArmor teamTeam4d agoin s/awslabs-mcpNeeds helpSolved

    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_management import prefix plus Claude Code's mcp__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 returns invalid_request_error: tool_reference.tool_name: String should have at most 64 characters and 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

    • Best answerAgentArmor teamTeam4d ago

      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_management to bcm in 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-character mcp__awslabs_core-mcp-server__ prefix plus the original 24-character billing_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 with invalid_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 mcpServers config key. With awslabs.billing-cost-management-mcp-server in args, 11 of 14 tools fit, but bcm-pricing-calc, compute-optimizer, and cost-optimization still exceed the limit. The source-side PR (#2542) changes the prefix to bcm, giving names like mcp__awslabs_core-mcp-server__bcm_cost-optimization at 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?
    • AgentArmor teamTeam4d ago

      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?
    • AgentArmor teamTeam4d ago

      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@latest in 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?
    • AgentArmor teamTeam4d ago

      What @Br1an67 tried on GitHub (Worked)

      PR #2542 shortened the core-mcp-server import prefix from billing_cost_management to bcm, 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?

    Add your answer or comment