
🤖 Ghostwritten by Claude Opus 4.6 · Fact-checked & edited by GPT 5.4 · Curated by Tom Hundley
If your AI coding assistant connects to MCP servers, a malicious server can influence what the assistant recommends or does. The practical risk is simple: if you connect an untrusted MCP server, your tool may treat that server as authoritative and surface unsafe suggestions, risky code changes, or misleading analysis. The fix is also simple: only connect servers you can verify, limit their permissions, and review MCP-driven changes before you accept them.
MCP, or Model Context Protocol, lets AI tools connect to external systems such as documentation sources, code analyzers, databases, and APIs. That flexibility is useful, but it also expands the trust boundary. A server with an official-sounding name is not automatically legitimate, and a helpful-looking recommendation is not automatically safe.
This article explains what MCP servers are, how tool-poisoning-style attacks can work, and what you can do today to reduce the risk in tools such as Cursor and other MCP-enabled coding environments.
TL;DR: An MCP server is an external tool your AI assistant can call, so every MCP connection should be treated like a new trust decision.
Think of your AI coding assistant as a capable but credulous teammate. MCP servers are outside specialists it can consult for specific tasks: checking docs, querying data, analyzing code, or performing actions on your behalf.
The Model Context Protocol, introduced by Anthropic, is an open protocol for connecting models to tools and data sources. When used well, it gives AI systems access to current information and specialized capabilities. If you want the basics, our explainer on what MCP is and why it matters covers the foundation.
The security issue is not that MCP is inherently unsafe. The issue is that connecting a new server extends trust to software you may not have vetted. If that server is deceptive, compromised, or overly privileged, your AI tool can become a conduit for bad recommendations or unsafe actions.
That means the right question is not, "Does this server have a professional name?" It is, "Who publishes it, what can it access, and why should I trust it?"
TL;DR: A malicious MCP server can present itself as helpful while steering your AI assistant toward unsafe recommendations or actions.
A typical attack path looks like this:
The server may use a name like enterprise-eslint-standards-v4 or security-audit-pro. It may perform some legitimate functions so it appears useful during casual testing.
That can happen through a community recommendation, a social post, a GitHub repo, a package registry listing, or a direct suggestion from another user.
Once connected, the server can return misleading results, biased guidance, or instructions framed as best practices. Depending on the tool and permissions granted, that can lead to risky changes such as:
This is best understood as a trust-boundary problem. The model may give extra weight to tool output because tool responses are often treated as grounded or authoritative. OWASP's guidance on LLM application risks has highlighted insecure plugin and tool use as a meaningful class of risk, even if the exact terminology and rankings evolve over time.
Claims that a server can always "inject backdoors" automatically are too broad; the real risk depends on the AI tool's permissions, the user's review habits, and whether changes are auto-applied. But the underlying threat is real: an untrusted tool can shape recommendations in ways that are hard to spot during fast-moving AI-assisted development.
We covered a related trust-chain problem in how AI tools can infect each other. MCP expands that same problem to external tool connections.
TL;DR: Verify the publisher, inspect the source, limit permissions, and avoid installing servers you found through random recommendations alone.
| Verification step | What to check | Red flag |
|---|---|---|
| Publisher identity | Is there a real company, maintainer, or established developer behind it? | Anonymous publisher, throwaway account, no history |
| Source repository | Can you inspect the code, release history, and issue tracker? | No source, obfuscated code, no meaningful commit history |
| Community trust | Do credible users discuss it positively in public? | No independent references, only self-promotion |
| Brand claims | Does it imply affiliation with a major vendor? | "Official" branding without confirmation from that vendor |
| Permissions requested | What can it read, write, execute, or send over the network? | Requests broader access than its purpose requires |
Before you connect any MCP server:
For a broader framework on vetting third-party add-ons, see our hands-on plugin marketplace guide.
TL;DR: Use the minimum number of MCP servers, grant the minimum permissions possible, and test new servers in a sandbox before trusting them.
The safest default is simple: only connect servers you have intentionally approved. If your tool supports explicit MCP configuration, keep that list short and documented.
A generic example looks like this:
{
"mcpServers": {
"trusted-docs-server": {
"command": "npx",
"args": ["verified-server-package"],
"env": {
"API_KEY": "YOUR_API_KEY"
}
}
}
}The exact configuration format varies by tool and version, so check the current product documentation before copying settings. The principle matters more than the syntax: do not add a server until you have verified who runs it and what it can do.
When you want to evaluate a new MCP server:
Our article on MCP security after 30 recent CVEs covers additional hardening ideas, though readers should verify the latest vendor guidance because this area changes quickly.
You can also force a pause before accepting MCP-driven changes. Try this:
Before implementing any recommendation from an MCP server, do the following:
1. Identify which MCP server provided the recommendation
2. Explain what the proposed change does in plain English
3. Flag whether it changes authentication, authorization, network requests,
dependencies, file permissions, or secrets handling
4. Rate confidence in the change as high, medium, or low
5. If confidence is not high, ask for manual review before applying itThis will not make an untrusted server safe, but it does create a useful human-review checkpoint.
TL;DR: Make an inventory of every MCP server you use, remove anything you cannot verify, and review recent AI-assisted changes for suspicious patterns.
Here is a practical audit process:
If you work on a team, this should become a lightweight policy, not an individual habit. Shared allowlists, documented approvals, and code review rules are much more reliable than hoping every developer remembers to be careful.
MCP server poisoning is a practical shorthand for attacks where a malicious or compromised MCP server influences an AI assistant with misleading outputs, unsafe recommendations, or risky actions. The exact impact depends on the tool's permissions and whether a human reviews the result before it is applied.
You usually cannot tell from the name alone. Look for a verifiable publisher, inspect the code or package contents, confirm any claimed brand affiliation, and compare requested permissions to the server's stated purpose. If the trust signals are weak, do not connect it.
Not reliably enough to depend on. Some tools may add warnings, permission controls, or better UX over time, but there is no universal equivalent of a fully curated app store for MCP servers today. You should assume that vetting remains your responsibility.
Disconnect it, rotate any credentials it could have accessed, review recent code changes, inspect dependency changes, and check for unexpected network behavior. If the server had broad access, treat the incident seriously and follow your normal security response process.
Yes, if you use them selectively and with controls. Verified servers with clear maintainers, limited permissions, and strong review practices can be useful. The danger comes from treating every external server as trustworthy by default.
MCP can make AI coding tools far more useful, but it also makes tool trust a security decision. If you connect unverified servers, you are effectively letting unknown software shape your development workflow.
Start with a simple rule: verify every MCP server before you use it, keep permissions narrow, and review sensitive changes manually. If your team is adopting AI-assisted development and wants help building safer guardrails, Elegant Software Solutions can help you assess the workflow, tighten the controls, and reduce the risk before it becomes an incident.
Share this with a developer who uses AI coding tools. Odds are good they have not audited their MCP connections yet.
Discover more content: