Model Context Protocol (MCP) tools have transformed how developers interact with AI coding agents. They connect your Claude, Cursor, or Windsurf session to databases, APIs, file systems, and cloud services โ giving AI assistants unprecedented power to act on your behalf. But that power comes with a security cost most developers haven't considered.
Over the past three months, our security research team at ClaudeArmor analyzed 2,147 MCP tools published on npm, GitHub, and community registries. What we found was concerning enough to publish this report immediately.
What Are MCP Tools and Why Should You Care?
MCP (Model Context Protocol) is an open standard that lets AI coding agents interact with external systems. When you install an MCP tool, you're essentially giving your AI agent a new capability โ reading from a database, deploying to a server, or accessing a third-party API.
The problem? These tools run with your credentials, on your machine, with access to your environment variables. Unlike traditional npm packages that your code calls explicitly, MCP tools are invoked autonomously by the AI agent, often without you reviewing each individual call.
Our Key Findings
1. Excessive Permission Requests
Of the 2,147 tools analyzed, 301 (14%) requested network permissions that weren't necessary for their stated functionality. A "file formatter" tool that needs outbound HTTP access is a red flag. Common patterns we observed:
- DNS lookups to third-party analytics domains during initialization
- WebSocket connections to external servers unrelated to the tool's purpose
- Fetch calls to telemetry endpoints that transmit workspace metadata
2. Obfuscated Code Sections
129 tools (6%) contained portions of code that were deliberately obfuscated โ encoded strings, eval-based execution, or multi-layer base64 wrapping. While obfuscation isn't inherently malicious (some vendors protect proprietary logic), it makes security review effectively impossible.
// Actual example from a flagged MCP tool (anonymized)
const _0x4f2a = ['\x65\x6e\x76', '\x41\x50\x49\x5f\x4b\x45\x59'];
const _data = process[_0x4f2a[0]][_0x4f2a[1]];
// This reads process.env.API_KEY through obfuscation
3. Environment Variable Exfiltration
The most alarming finding: 43 tools (2%) actively attempted to read and transmit environment variables. These tools would enumerate process.env, filter for keys containing patterns like KEY, SECRET, TOKEN, or PASSWORD, and send them to external endpoints.
"The MCP ecosystem today resembles the early npm ecosystem circa 2018 โ before event-stream taught us all about supply chain attacks. The difference is that MCP tools have far more ambient authority."
Common Attack Vectors
Based on our analysis, we identified four primary attack patterns targeting AI agent users:
- Credential Harvesting โ Tools that silently collect API keys, tokens, and passwords from environment variables during installation or first use
- Code Injection โ Tools that modify files on disk beyond their stated scope, inserting backdoors or persistence mechanisms into your projects
- Prompt Injection via Tool Output โ Tools that return crafted responses designed to manipulate the AI agent into performing unauthorized actions
- Dependency Confusion โ Typosquatted package names that mimic popular MCP tools (e.g.,
mcp-databse-toolvsmcp-database-tool)
How to Protect Yourself
Here are practical steps every developer using AI coding agents should take today:
Audit Before You Install
- Review the tool's source code on GitHub before installing
- Check the
package.jsonfor unexpected dependencies - Look for recent maintenance activity and community trust signals
- Run
claudearmor scan --mcp-auditto analyze tools before adding them
Use Runtime Protection
ClaudeArmor's real-time scanning engine monitors MCP tool behavior at runtime, alerting you when a tool attempts to access sensitive resources or make unexpected network connections.
# Scan your MCP configuration for risks
claudearmor scan --mcp-config ~/.claude/mcp.json
# Enable real-time MCP monitoring
claudearmor watch --mcp-guard
Restrict Environment Access
- Use dedicated API keys with minimal permissions for each AI agent session
- Never store production credentials in the same shell where you run AI agents
- Consider using
.env.aifiles with only the subset of variables your AI workflow requires
What's Next
We're publishing the full dataset (with tool names anonymized) in our GitHub repository so the community can contribute to ongoing analysis. We're also working with MCP protocol maintainers to propose a permission manifest standard โ similar to Android's permission model โ that would make tool capabilities transparent before installation.
The AI agent era is moving fast. Security practices need to keep pace. If you're building or using MCP tools, start thinking about supply chain security today โ not after the first major breach.