MCPShield Agent
AI Agent Security Scanner - Discovers MCP servers on your system and reports them to MCPShield for security analysis.
Installation
# Install from PyPI
pip install mcpshield-agent
# Or install from source
pip install -e .
Quick Start
# Scan your machine and see a local risk score. No account needed.
pip install mcpshield-agent
mcpshield scan
mcpshield scan discovers your MCP servers and prints a 0-100 risk score for
each, computed locally. Sign up (free) and configure --api-key to add CISA KEV
enrichment, org-wide tracking, history, and alerts:
mcpshield configure --api-key mcp_sk_your_key_here
mcpshield scan # now also reports to the dashboard
mcpshield status
Embed the scorer
The risk scorer is a pure function you can drop into any runtime to score an MCP server config in three lines:
from mcpshield_agent import score_config, risk_level
result = score_config({
"server_type": "@modelcontextprotocol/server-filesystem",
"command": "npx -y @modelcontextprotocol/server-filesystem /",
"scope": "/",
"env_vars": ["AWS_SECRET_ACCESS_KEY"],
})
# {"score": 100.0, "level": "critical", "factors": [...], "details": {...}}
It is the same weighted model as the hosted engine (minus CISA KEV enrichment, which stays server-side) and has no network dependency.
Risk-oracle MCP server
Expose the same scorer as an MCP server, so any MCP-capable agent (a SOC agent, Claude Desktop, Cursor) can consult MCPShield as a risk authority before it trusts or invokes an MCP server:
pip install 'mcpshield-agent[mcp]' # needs Python 3.10+
mcpshield-mcp # runs as a stdio MCP server
Register it with any MCP client, e.g. an mcp_servers.json entry:
{ "name": "mcpshield", "command": "mcpshield-mcp" }
Tools it exposes:
| Tool | Purpose |
|---|---|
score_mcp_server |
Score one server from its launch spec (command, args, env) — the risk-authority call |
scan_mcp_config |
Score every server in a config file's contents (standard / Zed / Continue.dev shapes) |
scan_local_machine |
Discover and score every MCP server configured on this host |
Each returns a 0-100 risk_score, a risk_level, and the risk_factors behind
it. Scoring is local and deterministic, and credential values are never
returned — only the credential type appears in the factors, and an inline
credential in a URL-style scope is masked.
Commands
| Command | Description |
|---|---|
mcpshield configure --api-key KEY |
Configure agent with API key |
mcpshield scan |
Scan and score locally; also report if configured |
mcpshield scan --deep |
Also connect to active servers and scan tool descriptions |
mcpshield scan --dry-run |
Scan and score locally, never report |
mcpshield daemon |
Run continuous scheduled scanning |
mcpshield status |
Show agent status |
mcpshield list |
List found servers (no report) |
mcpshield --version |
Show version |
What It Scans
The agent looks for MCP server configurations in:
Windows:
%APPDATA%\Claude\claude_desktop_config.json%APPDATA%\Cursor\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json%APPDATA%\Windsurf\mcp_settings.json%APPDATA%\Zed\settings.json
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json~/.cursor/mcp.json~/.config/zed/settings.json~/.continue/config.json
Linux:
~/.config/Claude/claude_desktop_config.json~/.config/cursor/mcp.json~/.config/zed/settings.json~/.continue/config.json
Zed servers are read from context_servers; Continue.dev from
experimental.modelContextProtocolServers.
What It Reports
For each discovered MCP server:
- Server name - e.g., "filesystem", "postgres"
- Server type - e.g., "@modelcontextprotocol/server-filesystem"
- Command - Full command string, with any credential in it masked (for a remote server, its URL and headers)
- Scope - Access scope (file paths, URLs)
- Environment variables - Names only, NOT values
- Status - Active or dormant
Configuration
Config is stored in:
- Windows:
%LOCALAPPDATA%\MCPShield\config.json - macOS:
~/Library/Application Support/MCPShield/config.json - Linux:
~/.config/mcpshield/config.json
{
"api_url": "https://api.mcpshield.app",
"api_key": "mcp_sk_..."
}
Daemon Mode (Continuous Scanning)
Run the agent in daemon mode for automatic scheduled scanning:
# Default: scan every hour (3600 seconds)
mcpshield daemon
# Custom interval: scan every 5 minutes
mcpshield daemon --interval 300
The daemon will:
- Scan for MCP servers at the configured interval
- Report discovered servers to the backend
- Send heartbeat updates
- Log each scan cycle
- Shut down gracefully on Ctrl+C
Security
- Never sends credential values - Only environment variable names; a credential in a command, a scope, or a remote server's URL or headers is masked before upload
- Local config is secure - API key stored locally
- HTTPS by default - All API communication encrypted
Development
# Install in development mode
pip install -e .
# Run tests
pytest
# Run locally against dev API
mcpshield configure --api-key YOUR_KEY --api-url http://localhost:8000
License
MIT License - see LICENSE file.
Metadata
Release files for mcpshield-agent 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcpshield_agent-0.7.0.tar.gz | 32.9 kB | Without provenance | Details for mcpshield_agent-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcpshield_agent-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for mcpshield_agent-0.7.0-py3-none-any.whl |
Total release size: 60.5 kB
Release files / mcpshield_agent-0.7.0.tar.gz
| Download URL | mcpshield_agent-0.7.0.tar.gz |
|---|---|
| Size | 32.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
015686916432be406c82cdee03ca6465af1f44554414fb91850cbec6a87a4737
|
|
BLAKE2b-256 checksum How to use checksums |
e7fa4903b94b16a262e8a55ce2113558a5dd01fbec0ee45ef3495349ec02ad1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / mcpshield_agent-0.7.0-py3-none-any.whl
| Download URL | mcpshield_agent-0.7.0-py3-none-any.whl |
|---|---|
| Size | 27.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f63675d80a084f15398c734d5a94fac34b1735726cb96775da66d61a5253252
|
|
BLAKE2b-256 checksum How to use checksums |
738d250a08d66e63c880c51ac0d3ad8763bd896a4699e2cbfba8f6729e3b679e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for mcpshield-agent 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.