MCP server fuzzer client and utilities
Project description
MCP Fuzzer
A CLI tool for fuzzing MCP server tools using multiple transport protocols, with pretty output using rich.
Features
- Multi-Protocol Support: HTTP, SSE, Stdio, and WebSocket transports
- Tool Discovery: Automatically discovers available tools from MCP servers
- Intelligent Fuzzing: Uses Hypothesis to generate random/edge-case arguments
- Rich Reporting: Beautiful terminal tables with detailed statistics
- Protocol Flexibility: Easy to add new transport protocols
Architecture
The MCP Fuzzer uses a transport abstraction layer to support multiple protocols. Here's how it works:
Installation
pip install mcp-fuzzer
Supported Protocols
HTTP Transport
python mcp_fuzzer_client.py --protocol http --endpoint http://localhost:8080/rpc --runs 20
SSE Transport
python mcp_fuzzer_client.py --protocol sse --endpoint http://localhost:8080/sse --runs 15
Stdio Transport
# Binary executables
python mcp_fuzzer_client.py --protocol stdio --endpoint "./bin/mcp-shell" --runs 10
# Python scripts
python mcp_fuzzer_client.py --protocol stdio --endpoint "python3 ./my-mcp-server.py" --runs 10
# Python scripts with spaces in path
python mcp_fuzzer_client.py --protocol stdio --endpoint '"./My Server/mcp-server.py"' --runs 10
WebSocket Transport
python mcp_fuzzer_client.py --protocol websocket --endpoint ws://localhost:8080/ws --runs 25
Usage
You can run the fuzzer as a CLI tool after install:
mcp-fuzzer-client --protocol http --endpoint http://localhost:8000/mcp/ --runs 10
Or directly with Python:
python mcp_fuzzer_client.py --protocol http --endpoint http://localhost:8000/mcp/ --runs 10
Arguments
--protocol: Transport protocol to use (http, sse, stdio, websocket)--endpoint: Server endpoint (URL for http/sse/websocket, command for stdio)--runs: Number of fuzzing runs per tool (default: 10)--timeout: Request timeout in seconds (default: 30.0)--verbose: Enable verbose logging
Output
Results are shown in a colorized table with detailed statistics:
- Success Rate: Percentage of successful tool calls
- Exception Count: Number of exceptions during fuzzing
- Example Exceptions: Sample error messages for debugging
- Overall Statistics: Summary across all tools and protocols
Project dependencies are managed via pyproject.toml.
Test result of fuzz testing of https://github.com/modelcontextprotocol/python-sdk/tree/main/examples/servers/simple-streamablehttp-stateless
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_fuzzer-0.1.1.tar.gz.
File metadata
- Download URL: mcp_fuzzer-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aab098d519a8026d218849cdc23d4d5bc1ae29cd064e62e8cdc59887403b93ac
|
|
| MD5 |
ac5ac337cd7a16938f4bead5eef4cbbe
|
|
| BLAKE2b-256 |
d17198f4c9959eed6167a4b0109d4614fcdb27c96e3f4139e0e5519716a2d8d5
|
File details
Details for the file mcp_fuzzer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mcp_fuzzer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ed08d5c28658f42ad4abd9d2ad9e26f46d4ab88a21170e4b249613e4a2661a
|
|
| MD5 |
690d774c39264c04e0bb518a8016e316
|
|
| BLAKE2b-256 |
b0a5a847f9ef8ca62ea1065920a25c428b0db772a95032e8c084f86136725825
|