FuzzSpec
Supports scanning Express source code routes to auto-generate OpenAPI 3.1 specifications for testing.
Supports auto-discovery and scanning of FastAPI routes to generate OpenAPI specifications and fuzz endpoints.
Supports auto-discovery and scanning of Gin routes to generate OpenAPI specifications and fuzz endpoints.
Scaffolds FuzzSpec agent rules for GitHub Copilot to enable autonomous API testing and repair.
Allows using Google Gemini's API (via GEMINI_API_KEY) for AI semantic fuzzing and generating edge-case test vectors.
Supports auto-discovery of Laravel routes to generate OpenAPI specifications and fuzz endpoints.
Supports auto-discovery of NestJS routes to generate OpenAPI specifications and fuzz endpoints.
Allows using OpenAI's API (via OPENAI_API_KEY) for AI semantic fuzzing and generating edge-case test vectors.
Supports scanning Spring source code routes to auto-generate OpenAPI 3.1 specifications for testing.
Supports auto-discovery of Spring Boot routes to generate OpenAPI specifications and fuzz endpoints.
Integrates with OpenAPI/Swagger specifications (YAML/JSON) for validating, generating, fuzzing, and replaying API tests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FuzzSpecfuzz POST /api/v1/orders on localhost:8080 with adversarial vectors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
FuzzSpec (fuzzspec)
FuzzSpec is a language-agnostic, spec-to-contract AI testing harness, 500 crash preventer, and autonomous self-healing skill agent for OpenAPI (YAML/JSON) REST APIs across all programming languages (Go, Python, TypeScript/Node, Java, PHP, Rust, C#/.NET, Ruby).
flowchart LR
A[📐 OpenAPI Spec\nYAML / JSON] --> B[⚡ Hybrid Mutator\nBVA / EP / SQLi / AI]
B --> C[🚀 Concurrent Fuzzing\nRate-Limited Worker Pool]
C --> D[🎯 QA Oracles\n500 Crash & Stack Trace Scanner]
D -->|Defects Detected| E[📝 cURL Reproducer &\nSARIF / JUnit Reports]
E --> F[🤖 Agent Code Patch]
F --> G[🔄 Zero-Token Replay]
G -->|Resolved| H[✨ Quality Gate Passed]🚀 Installation & Quick Start
📦 Installation Options & Prerequisites
Installation / Execution Method | Software Requirements / Prerequisites | Zero-Dependency? |
1. Standalone Binary (GitHub Releases) | None (Runs natively on clean Windows, Linux, macOS) | ✅ 100% Zero-Dependency |
2. Zero-Install via NPX | Node.js (v18+) & npm/npx (No Go compiler required) | ✅ Downloads native binary |
3. Go Toolchain ( | Go 1.24+ and Git installed | ⚙️ Source compilation |
4. AI IDE via MCP (Method A) | MCP-compatible IDE (Cursor, Claude Desktop, Antigravity, Windsurf) | 🔌 JSON-RPC stdio protocol |
5. AI Semantic Mode ( |
| 💡 Optional (Auto-fallback to Heuristics) |
# Option 1: Pre-Built Multi-Arch Binaries (Zero Dependencies)
# Download from GitHub Releases: https://github.com/hanifalkauni/fuzzspec/releases/latest
# Option 2: Zero-Install via NPX (Requires Node.js 18+)
npx -y github:hanifalkauni/fuzzspec --help
# Option 3: Go Toolchain Install (Requires Go 1.24+)
go install github.com/fuzzspec/fuzzspec/cmd/fuzzspec@latest💬 Method A: AI Agent Chat via MCP (Recommended — Any AI IDE)
FuzzSpec exposes native Model Context Protocol (MCP) JSON-RPC 2.0 tools, enabling your AI coding assistant (Cursor, Claude Desktop, Antigravity, Windsurf, Kiro, Continue.dev) to autonomously test endpoints and patch bugs.
🔧 IDE Configuration Snippet
Add FuzzSpec to your IDE's MCP configuration file (e.g. .cursor/mcp.json, claude_desktop_config.json, or Antigravity settings):
{
"mcpServers": {
"fuzzspec": {
"command": "npx",
"args": [
"-y",
"github:hanifalkauni/fuzzspec",
"--mcp"
]
}
}
}🛠️ Available MCP Tools & Practical Prompts
MCP Tool | Purpose & Description | Example AI Chat Prompt |
| Parses OpenAPI spec tree, schemas, types, and parameter constraints without sending HTTP calls. | "@fuzzspec inspect |
| Executes concurrent boundary, adversarial, and AI fuzzing against a live server endpoint. Returns exact cURL reproducers. | "@fuzzspec fuzz POST |
| Deterministically re-tests failing anomaly vectors against the server to verify bug fixes (0 AI token cost). | "I've patched the integer overflow in |
| Scans source code routes (Express, FastAPI, Gin, Spring) and scaffolds a clean OpenAPI 3.1 YAML/JSON file. | "@fuzzspec scan our backend controllers in |
📄 Method B: Universal Skill Agent & Rule Adapter (30+ AI Agents)
If you prefer pure prompt/rule guidance in your workspace without a background MCP daemon:
🌐 Option 1: Automatic via skills.sh (30+ AI Agents)
Install directly into Cursor, Claude Code, Windsurf, Copilot, Antigravity, or Gemini CLI:
npx skills add hanifalkauni/fuzzspec⚡ Option 2: Automatic Adapter Injection via CLI
# Inject into specific IDEs:
npx -y github:hanifalkauni/fuzzspec init --ide cursor,claude,copilot,windsurf,antigravity,cline,kiro
# Or inject all adapters into current repo:
npx -y github:hanifalkauni/fuzzspec initThis generates:
🟢 Cursor:
.cursor/rules/fuzzspec.mdc🟣 Claude Code:
CLAUDE.md🔵 GitHub Copilot:
.github/copilot-instructions.md🌊 Windsurf:
.windsurfrules🤖 Antigravity:
.agents/skills/fuzzspec/SKILL.md🛠️ Cline:
.clinerules⚡ Kiro:
.kiro/rules.md
🤖 Example Prompt for Skill Agents:
"Using the FuzzSpec skill, run an autonomous test-and-repair cycle against our local server at
http://localhost:8080. Identify any 500 runtime crashes, inspect the offending handler code, apply a fix, and replay the payload to ensure quality gate passes."
🖥️ Method C: Native High-Performance CLI (Local & CI/CD)
FuzzSpec provides an intuitive, robust CLI for developer terminals and automated CI/CD pipelines.
1. fuzzspec run — Execute Comprehensive API Fuzzing
# Recipe 1: Auto-discovery mode (Probes FastAPI, Spring Boot, NestJS, Laravel, Gin)
fuzzspec run --target http://localhost:8000 --auto-discover
# Recipe 2: Explicit OpenAPI specification with custom concurrency and rate limits
fuzzspec run \
--spec ./api/openapi.yaml \
--target http://localhost:8080 \
--concurrency 15 \
--rps 50 \
--timeout 5s
# Recipe 3: State-changing endpoints (POST/PUT/DELETE) with custom auth token
fuzzspec run \
--spec ./openapi.yaml \
--target http://localhost:8080 \
--safe-mode=false \
--header "Authorization: Bearer my-secret-token"
# Recipe 4: CI/CD Quality Gate with full multi-format reports
fuzzspec run \
--spec ./openapi.yaml \
--target http://localhost:8080 \
--output-sarif ./results.sarif \
--output-md ./results.md \
--output-junit ./results.xml \
--output-json ./results.json2. fuzzspec replay — Deterministic Replay (Zero AI Cost)
# Replay all failed anomalies recorded in a previous run report
fuzzspec replay --target http://localhost:8080 --file ./results.json
# Replay a specific anomaly vector by ID
fuzzspec replay --target http://localhost:8080 --file ./results.json --vector VEC-0013. fuzzspec validate — Validate OpenAPI Specification Readiness
# Validate local YAML or JSON spec
fuzzspec validate --spec ./api/openapi.yaml
# Validate live remote spec URL
fuzzspec validate --spec https://api.example.com/openapi.json4. fuzzspec generate — Generate Test Vectors Offline (Dry Run)
# Generate heuristic boundary & adversarial vectors without sending HTTP calls
fuzzspec generate --spec ./openapi.yaml --no-ai
# Generate vectors enriched with AI semantic edge cases
fuzzspec generate --spec ./openapi.yaml --ai-provider gemini5. fuzzspec init — Scaffold AI Agent Rules & Adapters
# Scaffold rules for all supported AI coding agents
fuzzspec init
# Scaffold only for selected IDEs
fuzzspec init --ide cursor,claude,antigravity6. fuzzspec --mcp — Launch MCP Stdio Server
# Start JSON-RPC 2.0 stdio server for AI assistant connections
fuzzspec --mcp7. Shell Autocompletion & Version Check
# Print version and build commit
fuzzspec version
# Setup shell completion (Bash, Zsh, Fish, PowerShell)
fuzzspec completion powershell | Out-String | Invoke-Expression # Windows PowerShell
source <(fuzzspec completion bash) # Linux Bash
source <(fuzzspec completion zsh) # macOS Zsh📋 Complete CLI Command & Flags Reference Table
Command | Description | Key Flags / Options |
| Parses and validates OpenAPI 3.0/3.1 (YAML/JSON) specification readiness. |
|
| Generates boundary, heuristic & adversarial test vectors without making HTTP calls (dry-run). |
|
| Executes concurrent HTTP fuzzing with QA oracles, rate limiting, and multi-format reports. |
|
| Deterministically re-executes failing anomaly payloads to verify bug fixes (0 AI token cost). |
|
| Automatically scaffolds AI agent rules and skill adapters into the repository. |
|
| Starts the Model Context Protocol (MCP) JSON-RPC 2.0 stdio server for AI IDEs. |
|
| Prints FuzzSpec version and build info. |
|
| Generates shell completion script for Bash, Zsh, Fish, or PowerShell. |
|
Related MCP server: Janus MCP
🌐 Supported Polyglot Frameworks
FuzzSpec operates at the HTTP Contract layer, requiring zero SDK installations:
Ecosystem | Popular Frameworks | Auto-Discovery Endpoints |
🐍 Python | FastAPI, Django Ninja, Flask |
|
☕ Java / Kotlin | Spring Boot, Quarkus, Micronaut |
|
🟨 Node.js / TS | NestJS, Express, Fastify |
|
🐘 PHP | Laravel (Scramble/L5), Symfony |
|
🔷 C# / .NET | ASP.NET Core (Swashbuckle) |
|
🐹 Go | Gin, Echo, Fiber, Chi (Swag) |
|
🦀 Rust | Actix-Web, Axum (Utoipa) |
|
💎 Ruby | Ruby on Rails (Rswag) |
|
🏛️ The 12 QA Pillars of Spec-to-Contract Fuzzing
FuzzSpec is built upon 12 engineering pillars designed to eliminate unhandled backend panics, prevent data leakage, and guarantee zero-defect API contracts:
# | QA Pillar | Architectural Mechanism & Purpose |
1 | Spec-to-Contract Ingestion | Ingests OpenAPI 3.0/3.1 (YAML/JSON) with full |
2 | Deterministic Heuristic Mutator | Applies Boundary Value Analysis (BVA), Equivalence Partitioning (EP), INT64 overflows, and buffer stress mutations. |
3 | Adversarial & Injection Probing | Injects SQLi strings, Null bytes ( |
4 | AI Semantic Edge-Case Engine | Uses LLMs (Gemini, OpenAI, Claude) for contextual domain-specific edge cases with local vector caching. |
5 | Bounded Concurrency Engine | Concurrent goroutine worker pool with token-bucket rate limiting ( |
6 | Safe Mode & Circuit Breaker |
|
7 | Multi-Layer 500 Crash Oracles | Automatically differentiates between clean handled 4xx validations and fatal unhandled 5xx server crashes. |
8 | Polyglot Stack Trace Leak Scanner | Real-time signature detection for leaked runtime stack traces across 8 languages (Go, Python, Node, Java, PHP, Rust, C#, Ruby). |
9 | Contract Drift Verification | Validates response payloads against OpenAPI component schemas to catch missing fields and type mismatches. |
10 | Zero-Token Deterministic Replay | Re-executes failing anomaly payloads locally to verify bug fixes with 0 AI token cost. |
11 | Enterprise Diagnostics & Exporters | Generates SARIF v2.1.0 (GitHub Code Scanning), JUnit XML (CI/CD), Markdown PR comments, and JSON diagnostics. |
12 | Autonomous Self-Healing Skill | Native MCP tools and universal agent adapters for Cursor, Claude, Antigravity, Copilot, Windsurf, Cline, and Kiro. |
🛠️ MCP Tools Overview
Tool Name | Description | Key Arguments |
| Parses OpenAPI spec tree, schemas, types, and documented response codes. |
|
| Runs concurrent boundary, adversarial, and AI fuzzing against a live server. Returns exact cURL reproducers. |
|
| Deterministically re-tests failing payloads to verify bug fixes (0 AI token cost). |
|
| Scans codebase routes and scaffolds an OpenAPI 3.1 specification. |
|
🤖 GitHub Actions CI/CD Integration
name: API Contract Fuzzing
on: [push, pull_request]
jobs:
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Target API
run: npm start & sleep 3
- name: Run FuzzSpec Quality Gate
uses: hanifalkauni/fuzzspec@main
with:
target: 'http://localhost:3000'
auto-discover: 'true'
output-sarif: 'fuzzspec-results.sarif'
output-md: 'fuzzspec-pr-summary.md'
output-junit: 'fuzzspec-junit.xml'
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: fuzzspec-results.sarif🔒 Security & Credential Protection (Defense-in-Depth)
FuzzSpec is engineered with Zero-Trust AI Security to prevent credential leakage into AI chat logs, prompt context windows, CI/CD comments, or public repositories.
┌─────────────────────────────────────────────────────────────────────────────────┐
│ 5-LAYER CREDENTIAL PROTECTION PIPELINE │
├─────────────────────────────────────────────────────────────────────────────────┤
│ 1. Agent Boundary : .cursorignore & .claudeignore isolate .env / secrets │
│ 2. Scanner Blacklist: Parser ignores .git, .aws, .ssh, *.pem, credentials.json │
│ 3. RAM-Only Auth : token_env dynamically resolves keys into OS RAM only │
│ 4. Stream Redactor : Auto-sanitizes Bearer tokens, API keys, DB URIs to REDACTED │
│ 5. Prompt Scrubbing : LLM only receives schema types, NEVER raw auth or tokens │
└─────────────────────────────────────────────────────────────────────────────────┘Layer | Mechanism | Protection Scope |
1. Agent Context Blocker | Blocks IDEs (Cursor, Claude Code, Copilot, Antigravity) from indexing local | |
2. Engine Scanner Blacklist |
| Route and OpenAPI discovery engines reject scanning sensitive directories and secret files. |
3. RAM-Only Secret Injection |
| Prohibits saving raw tokens in |
4. Multi-Pattern Stream Redactor |
| All reports, terminal logs, SARIF files, PR comments, and cURL reproducers mask Bearer tokens, cloud API keys (OpenAI, Anthropic, AWS, GitHub), DB connection strings, and passwords as |
5. AI Prompt Isolation |
| Mutation prompts sent to LLMs (Gemini, OpenAI, Claude) contain only OpenAPI schema shapes (types, field names, constraints)—never authorization headers or live database records. |
Operational Trade-off on cURL Reproducers:
Bug reports intentionally generate cURL commands with Authorization: Bearer [REDACTED]. When manually verifying a reproduction in your local terminal, simply replace [REDACTED] with your active test token.
🔑 Environment Variables Reference
FuzzSpec reads environment variables dynamically at execution time with zero hardcoding:
Variable | Purpose & Description | Required / Optional |
| Google Gemini API key for AI-assisted semantic edge-case fuzzing. | Optional (Default: Heuristic) |
| OpenAI API key for GPT-4o / GPT-4o-mini fuzzing vectors. | Optional |
| Anthropic Claude API key for Claude 3.5 Sonnet mutations. | Optional |
| Target API authentication token referenced dynamically via | As configured |
⚙️ Declarative Configuration (fuzzspec.yaml)
You can customize all aspects of execution, rate limiting, and reporting via a declarative fuzzspec.yaml file:
version: "1"
target: "http://localhost:8000"
spec: "./api/openapi.yaml" # Omit if using auto_discover
auto_discover: true # Automatically probes FastAPI, Spring, NestJS, Laravel
execution:
concurrency: 15 # Parallel worker threads
rps: 50 # Token-bucket rate limiter
timeout: "5s" # Per-request timeout
retries: 2
safe_mode: true # true: only GET/HEAD/OPTIONS; false: allow POST/PUT/DELETE
authentication:
type: "bearer"
token_env: "API_TEST_TOKEN" # Dynamically read from RAM / OS env
headers:
X-Tenant-ID: "qa-sandbox-01"
filtering:
include_paths: ["/v1/**"]
exclude_paths: ["/v1/admin/purge"]
methods: ["GET", "POST", "PUT", "PATCH", "DELETE"]
ai:
enabled: true
provider: "gemini" # gemini | openai | anthropic | local
model: "gemini-1.5-flash"
cache_vectors: true
oracles:
fail_on_5xx: true
fail_on_schema_drift: true
scan_info_leak: true
latency_threshold_ms: 3000
reporting:
terminal: true
sarif: "./fuzz-results.sarif"
junit: "./fuzz-junit.xml"
markdown: "./fuzz-summary.md"
json: "./fuzz-results.json"
sanitize_pii: true❓ FAQ & Troubleshooting
You don't need to write one manually! You have two automatic options:
Option A: Use the MCP tool
scan_and_generate_specin your AI IDE chat to scan your route source code and scaffold a valid OpenAPI 3.1 file.Option B: Run
fuzzspec run --target http://localhost:8080 --auto-discover. FuzzSpec will automatically probe standard documentation endpoints (/openapi.json,/v3/api-docs,/api-json,/swagger/doc.json,/docs/api.json).
This is an intentional feature of Layer 4 (Zero-Trust Output Sanitizer). It guarantees that if you copy-paste bug reports into public GitHub Issues, Slack channels, or PR reviews, your active tokens are never exposed. Simply replace [REDACTED] with your live test token when manually replaying in your terminal.
By default, FuzzSpec runs in --safe-mode=true to protect developer environments. To test state-changing endpoints, pass --safe-mode=false in the CLI or set safe_mode: false in fuzzspec.yaml. Always ensure you are targeting a disposable test or staging database.
When fuzz_endpoint or fuzzspec run discovers an anomaly, it records the exact HTTP request vector into results.json. Running fuzzspec replay --file results.json re-executes the exact offending payload directly against the server, verifying your bug fix without invoking external LLMs.
📑 Additional Documentation
🛡️ Security Policy & Threat Model (SECURITY.md) — Zero-Trust architecture, threat modeling & pre-flight checklist.
🤝 Contributing Guide (CONTRIBUTING.md) — Developer setup, running tests & pull request guidelines.
🛠️ Custom Language Guide (docs/EXTENDING_LANGUAGES.md) — Register custom frameworks via YAML.
⚙️ Example Configuration (fuzzspec.example.yaml) — Declarative YAML configuration template.
🧠 Agent Skill Playbook (SKILL.md) — Autonomous self-healing prompt playbook.
📜 License
SPDX-License-Identifier: Apache-2.0This project is licensed under the Apache License 2.0. See the LICENSE file for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-callable tools for API mocking, testing, monitoring, security, and automation.
Scores how well AI agents will use your API, 0-100, from its OpenAPI spec. Free and read-only.
Free AI test helpers: injection inputs, OWASP mapping, release plans, response and tool-call packs.
- mcpOAuthcom.vibgrate
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceBrings OpenAPI/Swagger documentation into AI assistants, enabling endpoint discovery, deep inspection, cURL generation, and TypeScript type generation.-
- AlicenseAqualityDmaintenanceEnables AI assistants to understand and interact with OpenAPI specifications, providing deep insight into API structures for faster and more accurate API integration.911 npm1MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with accurate OpenAPI contract details to prevent hallucinated API calls, supporting multi-version pinning, endpoint discovery, and request validation.45 npmApache 2.0
- FlicenseAqualityBmaintenanceEnables LLMs to dereference and query OpenAPI/Swagger specifications, search endpoints and schemas, validate payloads, extract security schemes, and generate production-ready integration code in multiple languages.8-