Feature: Client-side MCP tool name aliasing/truncation

Resolved 💬 2 comments Opened Feb 10, 2026 by DanielPBak Closed Mar 12, 2026

Problem

When using MCP servers that expose tools with auto-generated names (e.g., from gRPC reflection or OpenAPI schemas), tool names can become extremely long and repetitive. For example, a gRPC MCP server might advertise tools like:

mcp__myserver__com_example_services_accounting_AccountingService__GetDeposit
mcp__myserver__com_example_services_accounting_AccountingService__GetAsset
mcp__myserver__com_example_services_wallet_WalletService__GetPlan
mcp__myserver__com_example_services_wallet_WalletService__GetAccount
...

With 200+ tools like this, the shared prefix (com_example_services_) and common suffixes (Service) consume a significant number of tokens in every conversation turn. The server name can be shortened via .mcp.json, but the tool names themselves are entirely determined by the MCP server's tools/list response and cannot be modified client-side.

In many cases, the MCP server is a third-party tool or a shared team resource, so modifying the server itself to shorten names isn't always practical or possible.

Proposed Solution

Allow some form of client-side tool name transformation. A few options:

Option A: Prefix/suffix stripping per server

{
  "mcpServers": {
    "myserver": {
      "type": "sse",
      "url": "https://mcp.example.com/sse",
      "toolNameStripPrefix": "com_example_services_",
      "toolNameStripSuffix": "Service"
    }
  }
}

This would turn com_example_services_accounting_AccountingService__GetDeposit into accounting_Accounting__GetDeposit.

Option B: Regex-based rewrite

{
  "mcpServers": {
    "myserver": {
      "type": "sse",
      "url": "https://mcp.example.com/sse",
      "toolNameRewrite": {
        "match": "com_example_services_(\\w+)_(\\w+)Service__(\\w+)",
        "replace": "$1__$3"
      }
    }
  }
}

This would turn the same tool into accounting__GetDeposit.

Option C: Explicit alias map (most flexible but verbose)

Any of these approaches would work. The key requirement is that Claude Code maps the shortened names back to the real tool names when making MCP calls, so the MCP server doesn't need to change.

Why This Matters

  • Each tool name appears in the system prompt on every turn, so even small per-tool savings multiply across hundreds of tools and many conversation turns
  • Many MCP servers are auto-generated from schemas (gRPC, OpenAPI, GraphQL) and produce verbose, fully-qualified names that users can't control
  • The current workaround (shortening the server key in .mcp.json) only addresses the mcp__<name>__ prefix, which is a small fraction of the total length
  • This is especially relevant for teams that expose internal services via MCP, where tool names reflect package namespaces (e.g., Java/Kotlin package names, protobuf package paths)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗