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.
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.
How the attack unfolds
What it looks like in practice
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.
How Guard catches this
How to stop it
Audit MCP server configurations regularly. Use Guard to maintain an inventory of connected servers and alert when a previously-approved server changes its description, tools, or endpoint. Remove servers that are no longer needed.
Common questions
More threats to know about
MCP tool description poisoning
Malicious MCP tool descriptions embed hidden instructions that redirect AI agents into calling the wrong tool, exfiltrating secrets, or executing unintended commands — even when the tool itself appears harmless.
Read advisorynpm postinstall script abuse in AI coding environments
Malicious npm packages use postinstall scripts to execute arbitrary code during installation. In AI coding environments, these scripts can modify agent configuration, install backdoor MCP servers, or exfiltrate project secrets — all before the developer reviews the package.
Read advisoryStop this threat before it reaches your agent
Install HOL Guard to get real-time protection against this and every other advisory in our catalog.