Scan MCP servers for potential threats & security findings.
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
# Add to your Claude Code skills
git clone https://github.com/cisco-ai-defense/mcp-scannerGuides for using ai agents skills like mcp-scanner.
A Python tool for scanning MCP (Model Context Protocol) servers and tools for potential security findings. The MCP Scanner combines Cisco AI Defense inspect API, YARA rules and LLM-based analysis to detect malicious MCP tools.
The MCP Scanner provides a comprehensive solution for scanning MCP servers and tools for security findings. It leverages three powerful scanning engines (Yara, LLM-based analysis, Cisco AI Defense) that can be used together or independently.
The SDK is designed to be easy to use while providing powerful scanning capabilities, flexible authentication options, and customization.

2026-07-28 via server/discover) with automatic fallback to legacy initialize() for older servers — remote HTTP/SSE and stdio.mcp>=2.0.0, bundled with this package). Live scans negotiate 2026-07-28 when the server supports it and fall back to legacy handshake versions automatically.uv tool install --python 3.13 cisco-ai-mcp-scanner
Alternatively, you can install from source:
uv tool install --python 3.13 --from git+https://github.com/cisco-ai-defense/mcp-scanner cisco-ai-mcp-scanner
git clone https://github.com/cisco-ai-defense/mcp-scanner
cd mcp-scanner
uv sync --python 3.13
Live scans (remote HTTP/SSE and stdio) negotiate the MCP protocol version automatically:
server/discover first. Servers built with the current Python SDK (MCPServer) typically respond with protocol version 2026-07-28.discover is unavailable or the server only supports handshake-era versions, the scanner falls back to initialize() (for example 2024-11-05, 2025-06-18, 2025-11-25).The Python MCP 1.x stdio server reports an unknown server/discover request as
a generic -32602 invalid-parameters error. The scanner retries initialize()
for that specific stdio error shape and logs a warning. Other -32602 errors
surface to the caller so malformed modern discovery is not silently downgraded.
Example servers under examples/ and eval fixtures use MCPServer from mcp.server.mcpserver (mcp 2.0). The static/behavioral analyzers still recognize legacy FastMCP patterns in third-party source code for capability extraction.
Integration tests: uv run pytest tests/test_stdio_modern_integration.py tests/test_scanner.py -k negotiate
For an unauthenticated HTTP endpoint, run read-only wire-protocol probes with
mcp-scanner protocol --server-url https://your-server.example/mcp. This checks
modern request envelope headers on servers advertising 2026-07-28 and runs
safe legacy checks for older endpoints. It does not call tools or prove
that unauthenticated callers can invoke them. A protected endpoint may require
separate authorized testing to assess its behavior after authentication.
The opt-in schema analyzer classifies nested $ref values in advertised
tool input and output schemas. Use --analyzers schema to run this check,
including with the static --tools mode. See
MCP 2.0 threat coverage
for the scan-time and runtime boundary.
Add MCP Scanner as a dependency using uv. From your project root (initialize with uv if needed):
uv init --python 3.13 #if not already done
uv add cisco-ai-mcp-scanner
# then activate the virtual environment:
## macOS and Linux: source .venv/bin/activate
## Windows CMD: .venv\Scripts\activate
## Windows PWSH: .venv\Scripts\Activate.ps1
uv sync
The module name is mcpscanner. Import this module with:
# import everything (not recommended)
import mcpscanner
# selective imports (recommended). For example:
from mcpscanner import Config, Scanner
from mcpscanner.core.models import AnalyzerEnum
Cisco AI Defense API (only required for API analyzer)
export MCP_SCANNER_API_KEY="your_cisco_api_key"
export MCP_SCANNER_ENDPOINT="https://us.api.inspect.aidefense.security.cisco.com/api/v1"
# For other endpoints please visit https://developer.cisco.com/docs/ai-defense/getting-started/#base-url
Tested LLMs: OpenAI GPT-4o and GPT-4.1 | AWS Bedrock Claude 4.5 Sonnet
# AWS Bedrock Claude with AWS credentials (profile)
export AWS_PROFILE="your-profile"
export AWS_REGION="us-east-1"
export MCP_SCANNER_LLM_MODEL="bedrock/anthropic.claude-sonnet-4-5-20250929-v2:0" # Any AWS Bedrock supported model
# AWS Bedrock Claude with API key (Bearer token)
export MCP_SCANNER_LLM_API_KEY="bedrock-api-key-..." # Generated via Amazon Bedrock -> API Keys
export AWS_REGION="us-east-1"
export MCP_SCANNER_LLM_MODEL="bedrock/us.anthropic.claude-sonnet-4-5-20250929-v2:0" # Any AWS Bedrock supported model
# LLM Provider API Key (required for LLM analyzer)
export MCP_SCANNER_LLM_API_KEY="your_llm_api_key" # OpenAI
# LLM Model Configuration (optional - defaults provided)
export MCP_SCANNER_LLM_MODEL="gpt-5.2" # Any LiteLLM-supported model
export MCP_SCANNER_LLM_BASE_URL="https://api.openai.com/v1" # Custom LLM endpoint
export MCP_SCANNER_LLM_API_VERSION="2025-04-01-preview" # API version (if required)
# For Azure OpenAI (example)
export MCP_SCANNER_LLM_BASE_URL="https://your-resource.openai.azure.com/"
export MCP_SCANNER_LLM_API_VERSION="2025-04-01-preview"
export MCP_SCANNER_LLM_MODEL="azure/gpt-5.2"
# For Extended Thinking Models (longer timeout)
export MCP_SCANNER_LLM_TIMEOUT=300
Note: If you are using models from Azure Foundry, set the MCP_SCANNER_LLM_BASE_URL and MCP_SCANNER_LLM_MODEL environment variables, as Microsoft has deprecated the need for MCP_SCANNER_LLM_API_VERSION.
The VirusTotal analyzer scans files and directories against VirusTotal's malware database using SHA256 hash lookups. It runs as a standalone analyzer via the virustotal subcommand or as part of --analyzers virustotal.
# VirusTotal API key (get one free at https://www.virustotal.com/)
export VIRUSTOTAL_API_KEY="your_virustotal_api_key"
# Optional: explicitly disable VirusTotal scanning even when API key is present.
# When not set, scanning is auto-enabled if VIRUSTOTAL_API_KEY is configured.
# Set to "false" to skip VT scanning without removing the API key (e.g. in CI).
export MCP_SCANNER_VIRUSTOTAL_ENABLED=false
# Optional: Upload unknown files to VirusTotal for scanning (default: false, privacy-friendly)
export MCP_SCANNER_VIRUSTOTAL_UPLOAD_FILES=false
# Optional: Max files to scan per directory (default: 10, set to 0 for unl
mcp-scanner is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by cisco-ai-defense. Scan MCP servers for potential threats & security findings. It has 1,131 GitHub stars.
mcp-scanner's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/cisco-ai-defense/mcp-scanner" and add it to your Claude Code skills directory (see the Installation section above).
mcp-scanner is primarily written in Python. It is open-source under cisco-ai-defense on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcp-scanner against similar tools.
No comments yet. Be the first to share your thoughts!