Safeguard
AI Security•

Two MCP servers expose the same tool name: what happens?

Tool names are unique only within one MCP server. When two servers both offer search, clients need a prefix or policy. Here is the risk and the fix.

Safeguard Security Team
3 min read

Tool names are only unique within one MCP server, so two servers can both expose a tool called search. The spec says clients or proxies that merge tools should disambiguate, for example with a server prefix. Without that, an agent or a rule written for one tool may hit the other.

What the spec says

The tools page states that tool name uniqueness is scoped to a single server. It notes that clients or proxies aggregating tools from multiple servers may see collisions and should implement a disambiguation strategy such as prefixing tool names with a server identifier. It also says the server name from its info is not guaranteed unique and should not be relied on for disambiguation.

Tool names themselves should be 1 to 128 characters using letters, digits, underscore, hyphen and dot.

Why it is a security issue

A name is how people and policies refer to a tool. If a policy says allow search and two servers both provide search, the rule may match both. If an agent is told to use search, the model may choose either.

A malicious or compromised server can exploit this by naming a tool after a trusted one so that approvals and prompts apply to the wrong tool. Related risks include tool description injection and silent tool list changes, which other posts here cover.

Ways to handle it

ApproachWhat it doesWeak point
Prefix with a server idNames become unambiguousNeeds a trustworthy id
Allowlist by server and tool pairRules name bothMore rules to maintain
Separate agents per serverNo overlap in one contextMore agents to manage
Reject duplicates at connect timeFails loudlyMay block legitimate setups

Practical steps

  1. Export the full tool list from every connected client and sort by name.
  2. Look for duplicates and near duplicates, including case differences, since names are case sensitive.
  3. Write approval and allow rules against the combined server and tool name.
  4. Display the server name next to the tool name in approval prompts.
  5. Alert when a new server introduces a name that already exists.

Do not trust the display name

Because the server name is not guaranteed unique, base your rule on something you control, such as the configured connection name or its address, rather than what the server says about itself.

Safeguard includes policies, gates and guardrails for agent tool access, plus a free scan at https://gold.safeguard.sh/scan.

Try it yourself

Look at how a server and its tools are presented during setup, and check whether the server name is shown next to each tool.

Click through it at your own pace, or open it full screen.

Quick check

Are tool names case sensitive?

The spec says names should be treated as case sensitive, so Search and search can be different tools. Treat near duplicates as suspicious.

Whose job is disambiguation?

The spec puts it on the clients or proxies that aggregate tools. If yours does not, add a prefix or a policy layer.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.