Get MCPShield up and running in under 5 minutes
MCPShield is now available on npm. Install globally to use the CLI:
# Install CLI globally
npm install -g @kellyclaude/mcpshield
# Verify installation
mcp-shield --version
Build from source for development or testing:
# Clone the repository
git clone https://github.com/kellyclaudeai/mcpshield.git
cd mcpshield
# Install dependencies
npm install
# Build the project
npm run build
# Link CLI globally
npm link packages/cli
# Verify installation
mcp-shield --version
Navigate to your project directory and initialize MCPShield:
cd ~/my-mcp-project
mcp-shield init
This creates two files:
mcp.lock.json - Lockfile tracking all verified serverspolicy.yaml - Security policy configurationAdd a server from the MCP Registry:
mcp-shield add io.github.modelcontextprotocol/filesystem
MCPShield will:
mcp.lock.json if approved-y or --yes to skip confirmation prompts:
mcp-shield add io.github.user/server-name --yes
Re-verify all servers in your lockfile:
mcp-shield verify
This command:
Scan all servers for security issues:
mcp-shield scan
The scanner checks for:
# Initialize in your project
cd ~/my-ai-app
mcp-shield init
# Add trusted servers
mcp-shield add io.github.modelcontextprotocol/filesystem
mcp-shield add io.github.modelcontextprotocol/brave-search
# Verify everything is secure
mcp-shield verify
mcp-shield scan
# Check lockfile
cat mcp.lock.json
The mcp.lock.json file tracks all verified servers:
{
"version": "1.0.0",
"generatedAt": "2026-02-05T15:30:00.000Z",
"servers": {
"io.github.modelcontextprotocol/filesystem": {
"namespace": "io.github.modelcontextprotocol/filesystem",
"version": "1.0.0",
"verified": true,
"verificationMethod": "github",
"verifiedOwner": "modelcontextprotocol",
"fetchedAt": "2026-02-05T15:30:00.000Z",
"artifacts": [
{
"type": "npm",
"url": "https://registry.npmjs.org/...",
"digest": "sha512-abc123...",
"size": 45678
}
]
}
}
}
When you run mcp-shield scan, you'll see:
đ Security Scan Results:
io.github.modelcontextprotocol/filesystem
Risk Score: 15/100 (clean)
Verdict: â
CLEAN
â No typosquats detected
â No suspicious code patterns
â Dependencies verified
âšī¸ 12 dependencies scanned
io.github.suspicious/package
Risk Score: 75/100 (suspicious)
Verdict: â ī¸ WARNING
â ī¸ eval() detected in src/core.js:45
â ī¸ Network call to unverified endpoint
â ī¸ Install script present
Summary:
Total servers: 2
Clean: 1
Warnings: 1
Dangerous: 0
The policy.yaml file lets you define security policies:
version: 1.0.0
policies:
# Block packages above this risk score
maxRiskScore: 50
# Require namespace verification
requireVerification: true
# Block known malicious patterns
blockPatterns:
- eval
- exec
- child_process
# Allowed registries
allowedRegistries:
- registry.npmjs.org
- pypi.org
# Auto-approve verified publishers
trustedPublishers:
- modelcontextprotocol
Make sure you've installed the package globally:
npm install -g @kellyclaude/mcpshield
If installing from source, link the CLI:
cd /path/to/mcpshield
npm link packages/cli
Ensure the server exists in the MCP Registry:
curl https://registry.modelcontextprotocol.io/servers/io.github.user/server-name
The server may not have a valid GitHub repository. Check the namespace format and repository ownership.
If you run into issues: