MCPSecBench
MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols
What is MCPSecBench?
MCPSecBench is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcpsecbench: a systematic security benchmark and playground for testing model context protocols
MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols
This server falls under the Security and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCPSecBench: A Systematic Security Benchmark and Playground
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcpsecbenchConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCPSecBench
MCPSecBench is a systematic security benchmark and research playground for testing the robustness of Model Context Protocol implementations against a comprehensive suite of attacks including tool poisoning, tool shadowing, data exfiltration, prompt injection, server name squatting, Man-in-the-Middle, DNS rebinding, rug-pull, and CVE exploits. It ships with both normal and malicious MCP server implementations, an MCP client that supports OpenAI and Anthropic models, and an automated test runner for Claude CLI, Cursor, and OpenAI endpoints. Security researchers and MCP developers use it to measure and compare the security posture of MCP hosts and servers under realistic adversarial conditions.
Prerequisites
- Python 3.10 or higher
- uv package manager (for running with `uv run`)
- ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable set
- For Cursor tests: Cursor IDE open and visible after one Alt+Tab
- pyautogui OS dependencies (may require `apt install` of python3-tk and scrot on Linux)
Clone the repository
MCPSecBench is a research tool distributed as source code. Clone it and enter the project directory.
git clone https://github.com/AIS2Lab/MCPSecBench.git
cd MCPSecBenchInstall dependencies with uv
Install all required packages. On Linux you may also need system packages for pyautogui (used for the GUI automation in Cursor tests).
uv add starlette pydantic pydantic_settings "mcp[cli]" anthropic aiohttp openai pyautogui pyperclipSet your API key
Export the API key for the model provider you want to test with. MCPSecBench currently supports OpenAI and Anthropic (Claude).
# For Anthropic / Claude
export ANTHROPIC_API_KEY=your_api_key_here
# For OpenAI
export OPENAI_API_KEY=your_api_key_hereStart the remote MCP servers
Launch the bundled server scripts before running tests. For example, start the download server which acts as a normal MCP server for checking signatures.
uv run download.py
# In another terminal, optionally start the malicious server:
uv run maliciousadd.pyRun the interactive client to test manually
The client connects to the configured MCP host and lets you issue prompts interactively. Pass 0 for Claude or 1 for OpenAI mode.
# Mode 0 = Claude, Mode 1 = OpenAI
uv run client.py 0Run the automated test script
main.py runs automated attack scenarios. The first argument selects the host (0=Claude CLI, 1=OpenAI, 2=Cursor) and the second selects the protection level (0=none, 1=MCIP, 2=AIM-MCP). Delete any leftover state file before each run.
rm -f /tmp/state.json
# Test OpenAI with no protection
uv run main.py 1 0
# Test OpenAI with AIM-MCP protection
uv run main.py 1 2Configure Claude Desktop for manual scenario testing
Copy the bundled claude_desktop_config.json into your Claude Desktop config directory and update the directory paths to your local clone.
cp claude_desktop_config.json \
"~/Library/Application Support/Claude/claude_desktop_config.json"MCPSecBench Examples
Client configuration for Claude Desktop attack scenario testing
The bundled config registers both normal and malicious servers so Claude Desktop loads them simultaneously for squatting and shadowing tests.
{
"mcpServers": {
"addserver": {
"command": "uv",
"args": ["run", "/path/to/MCPSecBench/addserver.py"]
},
"maliciousadd": {
"command": "uv",
"args": ["run", "/path/to/MCPSecBench/maliciousadd.py"]
}
}
}Prompts to try
Example inputs to use with the interactive client to exercise different attack vectors.
- "Add 5 and 3" (tests normal tool call vs. tool poisoning)
- "Check the signature of this file: /tmp/test.bin" (tests the download server)
- "What tools do you have available?" (reveals squatted tool names)
- (Use the prompts/ directory in the repo for curated attack-specific prompt examples)Troubleshooting MCPSecBench
pyautogui fails to import or screenshot functions error on Linux
Install the required system packages: `sudo apt install python3-tk python3-dev scrot`. On headless servers, pyautogui requires a display — set DISPLAY=:0 or use a virtual framebuffer (Xvfb).
main.py hangs waiting for Cursor window
Ensure Cursor is open, a new conversation is started, and the window is visible after a single Alt+Tab. The script uses screenshot matching against img/cursor_init.png; if your UI differs, update the reference screenshot path in main.py.
State from a previous run causes unexpected test behaviour
Always run `rm -f /tmp/state.json` before starting a new test session to clear persisted state.
Frequently Asked Questions about MCPSecBench
What is MCPSecBench?
MCPSecBench is a Model Context Protocol (MCP) server that mcpsecbench: a systematic security benchmark and playground for testing model context protocols It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCPSecBench?
Follow the installation instructions on the MCPSecBench GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCPSecBench?
MCPSecBench works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCPSecBench free to use?
Yes, MCPSecBench is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCPSecBench Alternatives — Similar Security Servers
Looking for alternatives to MCPSecBench? Here are other popular security servers you can use with Claude, Cursor, and VS Code.
Casdoor
★ 13.6kAn open-source Agent-first Identity and Access Management (IAM) /LLM MCP & agent gateway and auth server with web UI supporting OpenClaw, MCP, OAuth, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, Google Workspace, Azure AD
ghidraMCP
★ 9.0kAn Model Context Protocol server that enables LLMs to autonomously reverse engineer applications by exposing Ghidra's decompilation and analysis tools. It allows AI agents to list code structures, rename methods, and analyze binaries directly through
HexStrike AI
★ 8.9kHexStrike AI MCP Agents is an advanced MCP server that lets AI agents (Claude, GPT, Copilot, etc.) autonomously run 150+ cybersecurity tools for automated pentesting, vulnerability discovery, bug bounty automation, and security research. Seamlessly b
IDA Pro MCP
★ 8.7kEnables AI-assisted reverse engineering in IDA Pro by providing tools to analyze binaries, decompile functions, manage comments, search patterns, and interact with the IDA database through natural language.
Anthropic Cybersecurity Skills
★ 6.6k754 structured cybersecurity skills for AI agents · Mapped to 5 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND & NIST AI RMF · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platform
Hooker
★ 5.1k🔥🔥 hooker is a Frida-based reverse engineering toolkit for Android. It offers a user-friendly CLI, universal scripts, auto hook generation, memory roaming to detect activities/services, one-click SOCKS5 proxy setup, Frida JustTrustMe, and BoringSSL u
Browse More Security MCP Servers
Explore all security servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCPSecBench in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCPSecBench?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.