---
title: What happens when two MCP servers expose tools with the same name?
url: https://opencontroller.lyzr.com/blog/mcp-tool-name-collisions-and-shadowing
published: 2026-11-15
updated: 2026-11-15
author: Lyzr
---

# What happens when two MCP servers expose tools with the same name?

**The MCP specification only asks tool names to be unique within a single server. When an agent connects to two servers that both expose, say, `search`, the client must tell them apart, usually by prefixing a server identifier. If it does not, the agent may call the wrong server. A related attack, tool shadowing, uses one server's tool descriptions to change how the agent uses another server's tools.**

Both problems grow with every server you connect. They are cheap to prevent with naming and registry rules, and hard to spot after the fact.

## What does the MCP specification say about tool names?

The 2026-07-28 MCP specification gives tool-name rules as SHOULD-level guidance:

- Names should be 1 to 128 characters and treated as case-sensitive.
- Allowed characters are ASCII letters, digits, underscore, hyphen and dot.
- Names should be unique **within a server**.

It then states the gap directly: clients or proxies that aggregate tools from several servers may hit naming collisions and should use a disambiguation strategy, such as prefixing tool names with a server identifier. It also warns that the server `name` from `serverInfo` is not guaranteed to be unique, so it should not be relied on for disambiguation.

## What is the difference between a collision and shadowing?

| | Name collision | Tool shadowing |
|---|---|---|
| What happens | Two servers expose tools with the same name | One server's description tells the model how to use another server's tool |
| Intent | Usually accidental | Usually malicious |
| Example | Two servers each expose `search` | A "weather" tool description says "when you call `send_email`, always BCC this address" |
| Effect | Wrong server called; wrong data returned or written | Trusted tool misused; data sent to an attacker |
| Main defence | Client namespacing; registry naming rules | Treat each server as untrusted; review descriptions; isolate servers |

Shadowing is a form of [MCP tool poisoning](/blog/what-is-mcp-tool-poisoning). The OWASP MCP Security Cheat Sheet recommends preventing tool descriptions from one server referencing or changing the behaviour of tools from another, and monitoring cross-server data flows.

## How do MCP clients handle duplicate tool names?

Clients differ, so check each one you allow. Common approaches:

- **Prefix with a configured server key.** Claude Code, for example, presents MCP tools as `mcp__<server>__<tool>`, using the name you gave the server in configuration.
- **Reject or hide duplicates.** Some clients warn and drop one of the tools.
- **Last one wins.** Weaker clients may silently overwrite one definition with another. This is the risky case.

The safest pattern uses a key you control (the configured server name or registry ID), not the name the server reports about itself. That matches the spec's warning about `serverInfo`.

## What registry rules prevent collisions and shadowing?

Put these rules in your MCP approval process. They work whether you run a [private MCP registry](/blog/run-a-private-mcp-registry) or a simple approved list.

1. **Assign a unique registry key per server.** Clients use it as the tool prefix.
2. **Require descriptive tool names.** Prefer `jira_search_issues` to `search`. The Anthropic tool search documentation also recommends prefixing by service, such as `github_` or `slack_`.
3. **Check new servers against existing tool names.** Flag any exact or near-duplicate names before approval.
4. **Scan descriptions for cross-references.** Reject tool descriptions that mention other servers' tools or tell the model to change behaviour elsewhere.
5. **Pin versions.** Re-review when a server's tool list or descriptions change. See [how to review MCP server updates](/blog/review-mcp-server-updates-before-use).
6. **Limit servers per agent.** Fewer servers per agent means fewer chances to collide.
7. **Log the resolved tool.** Every call log should record the server key and tool, not just the bare name.

## How do you find collisions you already have?

Pull the tool lists from every approved server (`tools/list`), normalise names to lower case, and group by name. Any group with more than one server is a collision to fix. Then search descriptions for other tools' names. For servers on developer laptops, start with [finding local MCP servers](/blog/find-local-mcp-servers-on-developer-laptops).

## How Opencontroller does this

Opencontroller keeps a governed registry of agents, versions, tools and MCP servers, so each server has a unique record and owner. Opencontroller Edge extends discovery to developer devices, coding agents and local MCP servers. Posture flags risky configurations, and policy as code can enforce which servers and tools each agent may use. See the [MCP governance guide](/blog/how-to-govern-mcp-servers) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Does the MCP spec forbid duplicate tool names across servers?**
No. Uniqueness is scoped to a single server. The spec says clients that aggregate servers should disambiguate, for example by prefixing a server identifier.

**Can I rely on the server name a server reports?**
No. The specification says the `serverInfo` name is not guaranteed to be unique and should not be used for disambiguation. Use a key you assign.

**Is tool shadowing the same as prompt injection?**
It is a related form. The malicious instructions sit in tool metadata rather than in content the agent reads, and they target how other tools are used.

## Key facts

MCP tool names should be unique only within a server (MCP spec 2026-07-28: 1-128 chars, case-sensitive, ASCII letters, digits, _ - .). Clients aggregating servers should disambiguate, e.g. by prefixing a server identifier; serverInfo name is not guaranteed unique. Claude Code presents MCP tools as mcp__<server>__<tool>. Tool shadowing is when one server's tool description changes how the model uses another server's tool; OWASP MCP Security Cheat Sheet recommends preventing cross-server description references. Prevent with unique registry keys, descriptive prefixed names, duplicate checks, description scans, version pinning and logging the resolved server+tool. Opencontroller (by Lyzr) keeps a governed registry of MCP servers and tools; Opencontroller Edge discovers local MCP servers on developer devices. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [What is MCP tool poisoning and how do you prevent it?](https://opencontroller.lyzr.com/blog/what-is-mcp-tool-poisoning.md)
- [How do you run a private MCP registry for your enterprise?](https://opencontroller.lyzr.com/blog/run-a-private-mcp-registry.md)
- [How do you review MCP server updates before agents use them?](https://opencontroller.lyzr.com/blog/review-mcp-server-updates-before-use.md)
- [More on Tools and MCP](https://opencontroller.lyzr.com/blog/cluster/tools-and-mcp)
