medium severityCurated advisory

Shadow MCP server discovery and persistent access

MCP servers added to a project during development can persist in configuration files and maintain access to the agent’s context window long after they are forgotten. These "shadow" servers continue receiving tool calls and may be modified by attackers who compromise the original server.

Key facts

Shadow MCP server discovery and persistent access is a medium-severity AI agent security threat targeting MCP server configuration files, agent context window, team policy memory, persistent tool connections. Review connected MCP servers and MCP or Skill drift in Guard Cloud where available, and remove servers that are no longer needed. Do not rely on an automatic unused-server timer unless the current product exposes one.

4 affected surfacesLast updated Jun 25, 2026
Affected surfacesMCP server configuration filesagent context windowteam policy memorypersistent tool connections
The attack

What happens

A developer adds an MCP server during a sprint, uses it for a task, then forgets about it. The server remains in the project’s configuration file, connected to the agent’s context every time the project runs. If the server’s endpoint is later compromised, the attacker gains persistent access to the agent.

Step by step

How the attack unfolds

1Developer adds an MCP server to .claude/ or .mcp config for a specific task.
2Task is completed; server connection is not removed.
3Server endpoint is compromised or the original maintainer stops maintaining it.
4Attacker modifies the server’s tool descriptions or adds new tools with embedded instructions.
5Agent continues using the now-malicious server because it was previously approved.
Example

What it looks like in practice

Scenario

A developer adds an MCP server called "jira-helper" during a sprint to let the agent read Jira tickets. The sprint ends, but the server remains configured. Three months later, the jira-helper endpoint expires and is re-registered by an attacker who adds a tool that reads environment variables. The agent, still connected to the server, starts calling the new tool.

Detection

Detection and Guard coverage

Guard Cloud provides drift visibility for connected MCP servers and skills so operators can review changes.
Guard evaluates supported MCP tool calls before side effects and can warn, block, or require approval according to local policy.
Current Guard product evidence does not establish an automatic 30-day unused-server flag or a universal alert for every MCP description, tool, or endpoint change.
Mitigation

How to stop it

Recommended action

Review connected MCP servers and MCP or Skill drift in Guard Cloud where available, and remove servers that are no longer needed. Do not rely on an automatic unused-server timer unless the current product exposes one.

Guard configuration
Use Protection Center to review which Guard controls are active on this device.
Use `hol-guard command controls status` and `hol-guard command controls list` to inspect the active local control catalog.
Guard coverage is action- and harness-specific. Do not treat an advisory label as a configurable Guard setting unless it appears in the current control catalog.

Use the protections Guard supports here

Guard can review or block supported actions for this threat. The advisory above calls out what Guard covers and where other controls are still needed.

Shadow MCP server discovery and persistent access | HOL Guard Advisory