claude-code - 💡(How to fix) Fix MCP tool description deduplication for servers with identical schemas

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Workarounds today

Code Example

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

---

[prod-graylog, dev-graylog, local-graylog]: search_messages(query, ...)Search log messages
RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix MCP tool description deduplication for servers with identical schemas