Imported from mcp-runtime/mcp-server-fuzzer (
AGENTS.md). Install upstream withnpx skills add mcp-runtime/mcp-server-fuzzer. Copyright stays with the author.
AI Agent Instructions
Branch Creation
Always create a feature branch before making any code changes:
git checkout main
git pull origin main
git checkout -b <descriptive-branch-name>
Name the branch after the feature or fix, for example:
oauth-client-credentials-authgit-branch-isolationfix-batch-auth-bypass
Never commit directly to main.
Commit Message Style
Follow the project's short imperative style — no trailing period:
Add <feature>
Fix <bug>
Refactor <component>
Update <thing>
Remove <thing>
Examples from this repo:
Add OAuth client credentials authAdd git branch isolation for AI agentsFix batch JSON-RPC auth bypass in test serverRefine reporting boundaries and result contracts
Lint and Tests
Run before every commit:
tox -e ruff # lint
tox -e tests -- <test paths> # unit tests
tox venv setup
tox creates a managed venv at .tox/tests/. Use its Python for anything that
needs project dependencies (running the server, the CLI, ad-hoc scripts):
# First run: tox creates the venv automatically
tox -e tests -- tests/unit/
# Use the tox Python directly for scripts / servers / CLI
.tox/tests/bin/python examples/test_server.py
.tox/tests/bin/python -m mcp_fuzzer --help
# Install extra deps into the tox venv (e.g. server deps)
.tox/tests/bin/pip install uvicorn mcp anyio starlette
Never use the system python3 or pip3 for project code — the repo uses a
managed environment and the system Python may lack required packages or be
protected by PEP 668.
Codebase Exploration — Use Graphify First
A knowledge graph of this repo lives in graphify-out/. Before exploring the code manually, query the graph:
# Ask anything about structure, coverage, relationships
graphify query "how does X work"
graphify query "what calls Y"
graphify path "AuthModule" "Database"
graphify explain "OAuthClientCredentialsAuth"
Graphify is faster than grepping and surfaces cross-file relationships the raw code doesn't make obvious. Only fall back to grep/Read when the graph answer is insufficient.
To rebuild the graph after large changes:
/graphify mcp_fuzzer tests --update
MCP Protocol Version Awareness
Protocol behavior is version-sensitive. As of 2026-08-08, the released latest
MCP revision is 2026-07-28; 2025-11-25 is the immediately prior revision.
Treat 2026-07-28 as a released version, not an RC or draft.
When changing protocol, transport, spec-guard, authentication, or security-audit behavior:
- Check the official MCP revision/changelog before assuming the latest behavior.
- Keep the selected
spec_schema_version/MCP_SPEC_SCHEMA_VERSIONflowing into every version-sensitive request and probe; do not hardcode an older revision. - Preserve legacy behavior for
2025-11-25and earlier supported revisions while covering the latest stateless request shape, routing headers, per-request metadata, cache metadata, and authentication rules where applicable. - Add or update tests for both
2025-11-25and2026-07-28whenever a change crosses a protocol boundary. - Remove stale release-candidate terminology when a dated revision is released, and keep schema discovery/path fallback logic compatible with both concrete dated directories and a temporary draft directory.
Pull Requests
Open PRs against main on https://github.com/Agent-Hellboy/mcp-server-fuzzer.
Testing Check
Run this before opening a PR and before merging:
tox -e ruff # lint must be clean
tox -e tests -- tests/unit/ # full unit suite (random order)
tox -e tests -- tests/unit/ -p no:randomly # again in deterministic order
- Both orderings must pass. Running both catches test-isolation bugs
(global state /
sys.modulesleakage) that only surface under a particular order —pytest-randomlyshuffles order in CI. - Tests that need optional server deps (
starlette/mcp/uvicorn) mustpytest.importorskip(...)so they skip cleanly where those deps are absent (thetestsenv does not install them); otherwise CI fails at collection. - Coverage: CI runs Codecov with
patchandprojectgates. Add tests for new code socodecov/patchclears its target; the gates are advisory (a PR can still merge) but should be green for feature work. - For changes touching live behavior, also confirm the
e2e-testworkflow passes — it fuzzes the upstream "everything" MCP server end to end.
Release Readiness Check
Before cutting a release vX.Y.Z:
-
All intended PRs are merged to
main;git checkout main && git pull. -
CHANGELOG.mdhas a dated## [X.Y.Z]section listing the changes. -
Bump
mcp_fuzzer/version.py(VERSION = "X.Y.Z") on arelease-vX.Y.Zbranch and open a "Bump version to X.Y.Z" PR. -
CI on that PR is green (tests, lint, e2e, codecov) — run the Testing Check.
-
Sanity-check the build:
.tox/tests/bin/python -m mcp_fuzzer --versionprintsmcp-fuzzer vX.Y.Z. -
Merge the bump PR, then tag and push:
git checkout main && git pull origin main git tag -a vX.Y.Z -m "Release vX.Y.Z" git push origin vX.Y.ZThe
v*tag triggerspublish.yml(build + upload to PyPI) anddocker-release.yml(build + push the image). -
Verify after publish: PyPI serves
mcp-fuzzer X.Y.Z(https://pypi.org/pypi/mcp-fuzzer/json) and the GitHub ReleasevX.Y.Zexists and is marked latest.