MockForge
MockForge is an open source mock API generator in Rust. It helps teams simulate realistic backend behavior so frontend, backend, and QA work can move in parallel without waiting on live services.
Start with local open-source workflows, then add richer scenarios, protocol coverage, and team-facing tooling as your test surface grows.
What MockForge Is Good At
- Turning OpenAPI specs into usable mock services quickly
- Unblocking frontend and integration work with realistic responses
- Testing retries, fallbacks, and edge cases with scenario-aware behavior
- Simulating more than plain REST when your stack includes gRPC, GraphQL, WebSockets, Kafka, MQTT, AMQP, SMTP, FTP, TCP, or SOAP/XML over HTTP
- Giving teams an admin surface and repeatable workflows instead of ad hoc fixture sprawl
Start Here
- New to MockForge: Your First Mock API in 5 Minutes
- Building a real workflow: The Golden Path: Blueprint -> Dev-Setup -> Integration
- Evaluating fit for frontend and QA teams: Reality-First Onboarding
- Evaluating fit for platform and API teams: Contracts-First Onboarding
- Planning hosted or multi-team rollout: Cloud-First Onboarding
Quick Start
Installation
cargo install mockforge-cli
Basic Usage
# Start a mock server with an OpenAPI spec
cargo run -p mockforge-cli -- serve --spec examples/openapi-demo.json --http-port 3000
# Add WebSocket support with replay file
MOCKFORGE_WS_REPLAY_FILE=examples/ws-demo.jsonl cargo run -p mockforge-cli -- serve --ws-port 3001
# Full configuration with Admin UI
MOCKFORGE_WS_REPLAY_FILE=examples/ws-demo.jsonl \
MOCKFORGE_RESPONSE_TEMPLATE_EXPAND=true \
cargo run -p mockforge-cli -- serve --spec examples/openapi-demo.json --admin --admin-port 9080
# Use configuration file
cargo run -p mockforge-cli -- serve --config demo-config.yaml
Next Steps
- Mock a REST API from OpenAPI
- React + MockForge Workflow
- Vue + MockForge Workflow
- Admin UI Walkthrough
Core Capabilities
- OpenAPI-first HTTP mocking with custom responses and dynamic data
- Scenario-aware simulation for stateful behavior, latency, and failure paths
- Multi-protocol coverage across 10 protocols — REST, gRPC, GraphQL, WebSockets, Kafka, MQTT, AMQP, SMTP, FTP, and TCP — plus SOAP/XML over HTTP
- Admin UI and CLI workflows for local development and team usage
- Extensibility through plugins, templates, and deeper configuration
Documentation Map
- Getting Started - Install MockForge and choose the right path
- Tutorials - Follow end-to-end implementation workflows
- Core Workflows - Learn the main mocking and simulation surfaces
- Team and Cloud - Shared workspaces, sync, and collaboration flows
- Advanced and Labs - Explore deeper platform capabilities
- Configuration - Configure MockForge for local and team use
- API Reference - CLI, Admin API, and Rust API details
- Reference - Troubleshooting, schema, formats, and FAQ
Examples
Check out the examples/ directory for sample configurations and use cases.
Product Model
MockForge is organized around five product pillars: Reality, Contracts, DevX, Cloud, and AI. If you want the full internal model behind the docs structure, see The Five Pillars.
Community
- GitHub Issues - Report bugs and request features
- GitHub Discussions - Ask questions and share ideas
- Discord - Join our community chat
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.