mcp-security-analyzer
Comprehensive security testing framework for Model Context Protocol (MCP) servers. Automated vulnerability detection with Docker isolation, network traffic analysis, and AI-powered threat assessment.
claude mcp add --transport stdio yair4data-mcp-security-analyzer python -m mcp_security_analyzer \ --env CLAUDE_API_KEY="optional; set to enable Claude AI threat assessment"
How to use
The MCP Security Analyzer is a Python-based security testing framework designed to validate MCP servers by automatically running security test scenarios in isolated environments and analyzing the resulting network traffic and findings. It provides pre-configured use cases that simulate common security challenges such as file access, data exfiltration, command injection, and privilege escalation, and it can optionally leverage Claude AI for threat assessment. You can run a security inspection against any MCP server by supplying the server launch command (e.g., a Python module invocation or another startup command) and selecting a predefined use case to execute. The tool then orchestrates the test, captures network data, and compiles a comprehensive report with sections for executive findings, traffic analysis, and remediation suggestions.
How to install
Prerequisites:
- Python 3.9+ installed on your system
- Docker Engine running with appropriate permissions
- Network capture tools (libpcap, tcpdump) if you plan to analyze traffic locally
Installation steps:
- Clone the repository containing the MCP Security Analyzer (or install the package from source):
git clone https://github.com/yair4data/mcp-security-analyzer.git
cd mcp-security-analyzer
- Create and activate a Python virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the analyzer in editable mode:
pip install -e .
- Verify installation:
docker version # ensure Docker is running
mcp-security-analyzer --version
To run a test against your MCP server, ensure your server can be started with a Python module entry point (as shown in the configuration) and then use the analyzer with a config file and a chosen use case as demonstrated in the usage examples.
Additional notes
Tips and notes:
- The analyzer supports optional Claude AI threat assessment; set CLAUDE_API_KEY in your environment if you want AI-powered insights.
- Ensure Docker is properly configured on your system to allow containerized MCP server execution with network isolation.
- When troubleshooting, check that your MCP server startup command (for example, python -m mcp_security_analyzer or a custom script) is correctly accessible from the environment where you run the analyzer.
- The generated reports (HTML, JSON, CSV) and PCAP can be used for in-depth offline analysis and sharing findings with stakeholders.
- If your MCP server requires specific dependencies, consider creating a dedicated virtual environment or container image to ensure reproducible test runs.
Related MCP Servers
mcp-playground
A Streamlit-based chat app for LLMs with plug-and-play tool support via Model Context Protocol (MCP), powered by LangChain, LangGraph, and Docker.
code
Code-MCP: Connect Claude AI to your development environment through the Model Context Protocol (MCP), enabling terminal commands and file operations through the AI interface.
mcp-simple-timeserver
Simple MCP to give Claude ability to check current time as well as know when holidays are, what is the time distance between dates etc.
apifox
Apifox MCP 服务器 - 让 Claude 等 AI 助手通过自然语言管理你的 Apifox 项目,轻松创建、更新和审计 API 接口
mcp-wireshark
An MCP server that integrates Wireshark/tshark with AI tools and IDEs. Capture live traffic, parse .pcap files, apply display filters, follow streams, and export JSON - all via Claude Desktop, VS Code, or CLI. Cross‑platform, typed, tested, and pip‑installable.
nmap
MCP server for AI-powered network scanning with Nmap. Port scanning, service detection, OS fingerprinting, and vulnerability scanning for AI agents. By Vorota AI.