mockserver — Claude Code MCP server for mocks and traffic replay
One process that stands in for any HTTP, gRPC or WebSocket dependency. Useful when the backend isn't ready or keeps failing.
Open on GitHubWhat mockserver does
MockServer listens on port 1080 and takes instructions over a REST control plane on that same port. You describe what a request looks like — method, path, headers, body — and what should come back: a fixed response, a templated one, or the result of a callback.
It also works as a proxy. Point your app at it, record real traffic, then replay it later. TLS-encrypted exchanges stay readable. On top of that you can inject latency, dropped connections and error codes to see how the app handles a dependency going bad. Chat-completion APIs from OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI and Ollama are mockable too, streaming included.
Start it with docker run -d --rm -p 1080:1080 mockserver/mockserver, or install through Homebrew and run mockserver run --port 1080. Helm charts exist for Kubernetes. Client libraries cover Java, Node, Python, Ruby, Go, .NET, Rust and PHP. Nothing works over MCP until that process is actually up — the server drives a running MockServer, it doesn't replace it.
What it helps with
- stand up a mock REST endpoint before the backend exists
- record live traffic and replay it in tests
- check how the app behaves when a dependency drops the connection
- generate mocks from an OpenAPI spec instead of writing them by hand
- swap out chat-completion responses while debugging an agent
Example prompts for the agent
- Start MockServer on port 1080 and mock GET /hello with a 200 response
- Record traffic through the proxy and show me which requests hit the backend
- Add a 3 second delay to every request to /pets and run the tests
How to install mockserver
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mockserver
How do I install mockserver in Claude Code?
There is no install command for Claude. Run MockServer separately with docker run -d --rm -p 1080:1080 mockserver/mockserver, then connect the MCP server to your assistant.
What does mockserver do?
It mocks, records and replays traffic to external dependencies, and can inject latency or errors on demand. Control goes through a REST API on the same port.
Which protocols does mockserver support?
HTTP/1.1, HTTPS, HTTP/2, gRPC and gRPC-Web, WebSockets, raw TCP, plus experimental HTTP/3. The protocol is detected from the first bytes of each connection.