mockd
Multi-protocol API mock server with 18 MCP tools — mock HTTP, GraphQL, gRPC, WebSocket, MQTT, SSE, and SOAP APIs with chaos engineering, stateful CRUD, and deterministic seeded responses.
mockd
One binary. Seven protocols. Zero dependencies.
Mock HTTP, gRPC, GraphQL, WebSocket, MQTT, SSE, and SOAP APIs from a single CLI tool. Import from OpenAPI, Postman, WireMock, HAR, or cURL. Share mocks instantly via built-in cloud tunneling.
Why mockd?
| mockd | WireMock | Mockoon | json-server | Prism | MockServer | |
|---|---|---|---|---|---|---|
| Single binary, no runtime | :white_check_mark: | :x: JVM | :x: Node | :x: Node | :x: Node | :x: JVM |
| HTTP mocking | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| gRPC mocking | :white_check_mark: | 🔌 Ext | :x: | :x: | :x: | :white_check_mark: |
| GraphQL mocking | :white_check_mark: | 🔌 Ext | :x: | :x: | :x: | :x: |
| WebSocket mocking | :white_check_mark: | 🔌 Ext | :x: | :x: | :x: | :x: |
| MQTT broker | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| SOAP mocking | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: |
| SSE streaming | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| OAuth/OIDC provider | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| Chaos engineering | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: |
| Stateful CRUD | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| Cloud tunnel sharing | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: |
| Proxy recording & replay | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: |
| Import OpenAPI/Postman/HAR | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: |
| Built-in web dashboard | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: |
| MCP server (AI-native) | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
🔌 Ext = available via separate extension JAR, not bundled with WireMock core. mockd includes all protocols natively in a single binary.
Install
# Quick install
curl -sSL https://get.mockd.io | sh
# Homebrew
brew install getmockd/tap/mockd
# Docker
docker run -p 4280:4280 -p 4290:4290 ghcr.io/getmockd/mockd:latest
# Go
go install github.com/getmockd/mockd/cmd/mockd@latest
Pre-built binaries for Linux, macOS, and Windows are available on the Releases page.
Quick Start
# Start the mock server
mockd start
# Mock an HTTP endpoint
mockd add http --path /api/users --body '[{"id": 1, "name": "Alice"}]'
# Test it
curl http://localhost:4280/api/users
# → [{"id": 1, "name": "Alice"}]
# Mock a GraphQL API
mockd add graphql --path /graphql --operation users \
--response '[{"id": 1, "name": "Alice"}]'
# Mock a gRPC service
mockd add grpc --proto ./service.proto \
--service myapp.UserService --rpc-method GetUser \
--response '{"id": 1, "name": "Alice"}'
# Mock a WebSocket endpoint
mockd add websocket --path /ws/chat --echo
# Import from OpenAPI, Postman, or cURL
mockd import openapi.yaml
mockd import collection.json
mockd import "curl -X GET https://api.example.com/users"
Features
Multi-Protocol Mocking
Mock seven protocols from a single tool with a unified CLI and Admin API:
| Protocol | Port | Example |
|---|---|---|
| HTTP/HTTPS | 4280 | mockd add http --path /api/hello --body '{"msg":"hi"}' |
| gRPC | 50051 | mockd add grpc --proto svc.proto --service Greeter --rpc-method Greet |
| GraphQL | 4280 | mockd add graphql --path /graphql --operation hello |
| WebSocket | 4280 | mockd add websocket --path /ws --echo |
| MQTT | 1883 | mockd add mqtt --topic sensors/temp --payload '{"temp":72}' |
| SSE | 4280 | mockd add http --path /events --sse --sse-event 'data: hello' |
| SOAP | 4280 | mockd add soap --path /soap --operation GetWeather --response '<OK/>' |
Import & Export
Bring your existing API definitions — no rewriting needed:
mockd import openapi.yaml # OpenAPI 3.x / Swagger 2.0
mockd import collection.json # Postman collections
mockd import recording.har # HAR files
mockd import wiremock-mapping.json # WireMock stubs
mockd import service.wsdl # WSDL → SOAP mocks
mockd import "curl -X GET https://api.example.com/users" # cURL commands
mockd export --format yaml > mocks.yaml
Cloud Tunnel
Share local mocks with your team instantly. All protocols routed through a single QUIC connection on port 443:
mockd tunnel enable
# → https://a1b2c3d4.tunnel.mockd.io → http://localhost:4280
Chaos Engineering
Test how your app handles failures:
# Apply a built-in chaos profile at startup
mockd serve --chaos-profile flaky --config mockd.yaml
# Or enable chaos at runtime
mockd chaos apply slow-api
Stateful Mocking
Simulate CRUD resources with automatic ID generation, pagination, and persistence. Import an API spec and bind its endpoints to stateful tables with the tables+extend pattern:
# mockd.yaml — tables + extend (recommended for config files)
version: "1.0"
imports:
- path: openapi.yaml
as: api
tables:
- name: users
seedData:
- { id: "1", name: "Alice", email: "[email protected]" }
extend:
- { mock: api.GetUsers, table: users, action: list }
- { mock: api.PostUsers, table: users, action: create }
- { mock: api.GetUsersId, table: users, action: get }
Tables are pure data stores (no routing, no basePath). Extend bindings wire imported mock endpoints to table CRUD actions (list, get, create, update, delete). Custom operations are also supported via action: custom + operation: OpName.
State is shared across protocols — REST and SOAP can operate on the same table:
# Cross-protocol stateful mocking
tables:
- name: users
seedData:
- { id: "1", name: "Alice", email: "[email protected]" }
mocks:
- type: soap
soap:
path: /soap/UserService
operations:
GetUser:
statefulResource: users # Same data as REST!
statefulAction: get
For quick CLI prototyping, mockd add http --path /api/users --stateful still works to auto-create CRUD endpoints.
Workspaces
Isolated environments for mocks, stateful resources, and request logs. Run multiple API environments from a single mockd instance with --workspace scoping:
mockd workspace create -n "Payment API" --use
mockd import stripe-openapi.yaml
mockd workspace create -n "Comms API" --use
mockd import twilio-openapi.yaml
Proxy Recording
Record real API traffic and replay it as mocks:
mockd proxy start --port 8888
# Configure your app to use http://localhost:8888 as proxy
# Traffic is recorded, then replay with:
mockd import recordings/session-name.json
Admin API
Full REST API for dynamic mock management at runtime:
# Create a mock
curl -X POST http://localhost:4290/mocks \
-H "Content-Type: application/json" \
-d '{"type":"http","http":{"matcher":{"method":"GET","path":"/health"},"response":{"statusCode":200,"body":"{\"status\":\"ok\"}"}}}'
# List mocks
curl http://localhost:4290/mocks
# Import OpenAPI spec
curl -X POST http://localhost:4290/import \
-H "Content-Type: application/x-yaml" \
--data-binary @openapi.yaml
Web Dashboard
Release builds include a built-in web UI served from the admin port:
mockd start
# Open http://localhost:4290 in your browser
Manage mocks for all 7 protocols visually with a VS Code-style tabbed editor, command palette (Ctrl+K), mock tree with search/sort/folders, request log viewer with near-miss debugging, and more. Docker images and all release packages include the dashboard automatically.
AI Mock Generation (MCP)
mockd includes a built-in Model Context Protocol server with 18 tools for full mock lifecycle management from AI-powered editors (Cursor, Windsurf, Claude Code):
mockd mcp # Start the MCP server (stdio transport)
Tools cover mock CRUD, import/export, chaos engineering (10 built-in profiles), mock verification, stateful resource management, custom operations, and multi-environment context switching.
Configuration
Configure via flags, environment variables, or config files:
# .mockdrc.yaml
port: 4280
adminPort: 4290
httpsPort: 5280
maxLogEntries: 1000
| Variable | Description | Default |
|---|---|---|
MOCKD_PORT | Mock server port | 4280 |
MOCKD_ADMIN_PORT | Admin API port | 4290 |
MOCKD_HTTPS_PORT | HTTPS port (0=disabled) | 0 |
MOCKD_CONFIG | Config file path |
Documentation
mockd.io — Full documentation, guides, and API reference.
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
Server Terkait
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Server for iOS Simulator
Programmatically control iOS simulators via stdio transport. Requires macOS with Xcode and installed iOS simulators.
godoc-mcp-server
MCP server to provide golang packages and their information from pkg.go.dev
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers, without authentication.
Grok MCP
A MCP server for xAI's Grok API, providing access to capabilities including image understanding, image generation, live web search, and reasoning models.
SwissArmyHammer
Manage AI prompts as local markdown files.
Agent Forge
A platform for creating and managing AI agents with specific personalities and simulating their responses. Requires a DeepSeek API key.
JavaScript Executor MCP Server
Execute JavaScript code in a modern runtime environment with support for various built-in modules.
PAMPA
An MCP server for intelligent semantic search and automatic learning within codebases, allowing AI agents to efficiently query and index project artifacts.
Tailkits UI
Tailwind Components with Native MCP Support
Geo Location Demo
Retrieves user geolocation information using EdgeOne Pages Functions and exposes it via the Model Context Protocol (MCP).