[Feature] MCP tool description deduplication for servers with identical schemas

Resolved 💬 1 comment Opened May 18, 2026 by joaomena Closed Jun 19, 2026

Problem

When multiple MCP servers expose identical tool schemas (same tool names, descriptions, and parameters — only differing in target URL), Claude Code loads each server's descriptions into context independently. This wastes context window space with redundant content.

Example: Three Graylog instances (prod, dev, local) all hit /api/mcp on the same Graylog version. Each exposes ~10 identical tools. All three tool description sets are loaded, filling context with 3× the necessary tokens.

Proposed solution

When two or more registered MCP servers expose tool schemas that are structurally identical (same tool names + descriptions + parameter schemas), load the descriptions once and annotate them with the list of servers they apply to.

This could work at the system prompt level — instead of:

prod-graylog: search_messages(query, ...) — Search log messages
dev-graylog:  search_messages(query, ...) — Search log messages
local-graylog: search_messages(query, ...) — Search log messages

Collapse to:

[prod-graylog, dev-graylog, local-graylog]: search_messages(query, ...) — Search log messages

Workarounds today

  • Register only one instance globally; add others via project-level .mcp.json to limit when they're loaded
  • Build a proxy MCP that multiplexes envs under a single tool set with an env parameter

Impact

Any team running multi-environment setups (prod/dev/staging/local) with the same MCP server will hit this. Graylog, Postgres, Redis, custom internal APIs — any tool with environment-specific deployments.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗