Metadata-Version: 2.4
Name: mcp-fuzzer
Version: 0.3.3
Summary: MCP server fuzzer client and utilities
Author-email: Prince Roshan <princekrroshan01@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Prince Roshan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/agent-hellboy/mcp-server-fuzzer
Project-URL: Repository, https://github.com/agent-hellboy/mcp-server-fuzzer
Project-URL: Issues, https://github.com/agent-hellboy/mcp-server-fuzzer/issues
Project-URL: Documentation, https://agent-hellboy.github.io/mcp-server-fuzzer
Keywords: mcp,fuzzing,testing,json-rpc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx
Requires-Dist: hypothesis
Requires-Dist: jsonschema>=4.25.1
Requires-Dist: rich
Requires-Dist: pyyaml>=6.0
Requires-Dist: psutil>=5.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: tox>=4.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mkdocs-minify-plugin>=0.7.0; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Dynamic: license-file

# MCP Server Fuzzer

<div align="center">

<img src="icon.png" alt="MCP Server Fuzzer Icon" width="100" height="100">

**CLI fuzzing for MCP servers**

*Tool fuzzing • Protocol fuzzing • HTTP/SSE/stdio/StreamableHTTP • Safety controls • Rich reporting*

[![CI](https://github.com/Agent-Hellboy/mcp-server-fuzzer/actions/workflows/lint.yml/badge.svg)](https://github.com/Agent-Hellboy/mcp-server-fuzzer/actions/workflows/lint.yml)
[![codecov](https://codecov.io/gh/Agent-Hellboy/mcp-server-fuzzer/graph/badge.svg?token=HZKC5V28LS)](https://codecov.io/gh/Agent-Hellboy/mcp-server-fuzzer)
[![PyPI - Version](https://img.shields.io/pypi/v/mcp-fuzzer.svg)](https://pypi.org/project/mcp-fuzzer/)
[![Docker Pulls](https://img.shields.io/docker/pulls/princekrroshan01/mcp-fuzzer)](https://hub.docker.com/r/princekrroshan01/mcp-fuzzer)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

[Docs Site](https://agent-hellboy.github.io/mcp-server-fuzzer/) • [Getting Started](https://agent-hellboy.github.io/mcp-server-fuzzer/getting-started/getting-started/) • [CLI Reference](https://agent-hellboy.github.io/mcp-server-fuzzer/development/reference/)

</div>

## What It Does

MCP Server Fuzzer tests MCP servers by fuzzing:

- tool arguments
- protocol request types
- resource and prompt request flows
- multiple transports: `http`, `sse`, `stdio`, and `streamablehttp`

It includes optional safety controls such as filesystem sandboxing, PATH-based
command blocking, and network restrictions for safer local testing.

## Install

Requires Python 3.10+.

```bash
# PyPI
pip install mcp-fuzzer

# From source
git clone --recursive https://github.com/Agent-Hellboy/mcp-server-fuzzer.git
cd mcp-server-fuzzer
pip install -e .
```

Docker is also supported:

```bash
docker build -t mcp-fuzzer:latest .
docker run --rm mcp-fuzzer:latest --help
```

## Quick Start

### 1. Run the bundled HTTP example server

```bash
python3 examples/test_server.py
```

That server listens on `http://localhost:8000` and exposes:

- `test_tool`
- `echo_tool`
- `secure_tool` requiring `Authorization: Bearer secret123`

### 2. Fuzz tools

```bash
mcp-fuzzer --mode tools --protocol http --endpoint http://localhost:8000 --runs 10
```

### 3. Fuzz protocol requests

```bash
mcp-fuzzer --mode protocol --protocol-type InitializeRequest \
  --protocol http --endpoint http://localhost:8000 --runs-per-type 5
```

### 4. Run tools and protocol together

```bash
mcp-fuzzer --mode all --phase both --protocol http --endpoint http://localhost:8000
```

## Common Commands

```bash
# Enable command blocking + safety reporting
mcp-fuzzer --mode tools --protocol http --endpoint http://localhost:8000 \
  --enable-safety-system --safety-report

# Export results
mcp-fuzzer --mode tools --protocol http --endpoint http://localhost:8000 \
  --export-csv results.csv --export-html results.html

# Use auth config for the bundled secure_tool example
mcp-fuzzer --mode tools --protocol http --endpoint http://localhost:8000 \
  --auth-config examples/auth_config.json

# Load settings from YAML
mcp-fuzzer --config config.yaml
```

## Example Servers

This repository bundles:

- an HTTP example server: [`examples/test_server.py`](examples/test_server.py)
- a StreamableHTTP example: [`examples/streamable_http_server.py`](examples/streamable_http_server.py)

It does **not** currently bundle a stdio example server. For stdio usage, point
the fuzzer at your own server:

```bash
mcp-fuzzer --mode tools --protocol stdio --endpoint "python my_server.py" \
  --enable-safety-system --fs-root /tmp/mcp-safe
```

More runnable example flows are documented in
[`examples/README.md`](examples/README.md).

## Documentation

Keep the README for the basics. Use the docs for everything else:

- [Getting Started](https://agent-hellboy.github.io/mcp-server-fuzzer/getting-started/getting-started/)
- [Examples](https://agent-hellboy.github.io/mcp-server-fuzzer/getting-started/examples/)
- [Configuration](https://agent-hellboy.github.io/mcp-server-fuzzer/configuration/configuration/)
- [CLI Reference](https://agent-hellboy.github.io/mcp-server-fuzzer/development/reference/)
- [Safety Guide](https://agent-hellboy.github.io/mcp-server-fuzzer/components/safety/)
- [Architecture](https://agent-hellboy.github.io/mcp-server-fuzzer/architecture/architecture/)
- [Contributing](https://agent-hellboy.github.io/mcp-server-fuzzer/development/contributing/)

## License

MIT. See [`LICENSE`](LICENSE).
