MockForge

Crates.io Documentation CI License

MockForge 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, or SMTP
  • Giving teams an admin surface and repeatable workflows instead of ad hoc fixture sprawl

Start Here

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

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 REST, gRPC, GraphQL, WebSockets, and additional protocols
  • Admin UI and CLI workflows for local development and team usage
  • Extensibility through plugins, templates, and deeper configuration

Documentation Map

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

License

Licensed under either of:

at your option.