Skip to main content

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.

CI PyPI - Version PyPI Downloads

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:

mcp_fuzzer_arch

Installation

pip install mcp-fuzzer

Usage

You can run the fuzzer in several ways:

As a CLI tool (recommended)

mcp-fuzzer --protocol http --endpoint http://localhost:8000/mcp/ --runs 10

As a Python module

python -m mcp_fuzzer --protocol http --endpoint http://localhost:8000/mcp/ --runs 10

As a Python script

python -m mcp_fuzzer.client --protocol http --endpoint http://localhost:8000/mcp/ --runs 10

Supported Protocols

HTTP Transport

mcp-fuzzer --protocol http --endpoint http://localhost:8080/rpc --runs 20

SSE Transport

mcp-fuzzer --protocol sse --endpoint http://localhost:8080/sse --runs 15

Stdio Transport

# Binary executables
mcp-fuzzer --protocol stdio --endpoint "./bin/mcp-shell" --runs 10

# Python scripts
mcp-fuzzer --protocol stdio --endpoint "python3 ./my-mcp-server.py" --runs 10

# Python scripts with spaces in path
mcp-fuzzer --protocol stdio --endpoint '"./My Server/mcp-server.py"' --runs 10

WebSocket Transport

mcp-fuzzer --protocol websocket --endpoint ws://localhost:8080/ws --runs 25

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

fuzzer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_fuzzer-0.1.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_fuzzer-0.1.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_fuzzer-0.1.3.tar.gz.

File metadata

  • Download URL: mcp_fuzzer-0.1.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mcp_fuzzer-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c1eb17cc823c0c5f68b51e9511db1584f66fdeec913ab1c5ccc49749a155b766
MD5 dd57ca67df2b67571178d26ad4cee688
BLAKE2b-256 e48202999751a232cfc26c840199033a2ceba07fc20a832027a5d284e5d8ab0d

See more details on using hashes here.

File details

Details for the file mcp_fuzzer-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mcp_fuzzer-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mcp_fuzzer-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 510b62ab2a9b23cfa929add3a6f82169c5f15cf2776002ada647aeced247b004
MD5 acfc64e887188d759b0ede65b173d1fa
BLAKE2b-256 1478001fbfa16bebe190816576aaa5f5705e3a63de0e0527723076704d7fe2f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page