$git clone https://github.com/mock-server/mockserver-monorepoMockServer is an HTTP(S) mock server and proxy for testing. It does three things:
| 1 | MockServer [](https://buildkite.com/mockserver/mockserver) |
| 2 | [](https://github.com/mock-server/mockserver-monorepo/blob/master/LICENSE.md) |
| 3 | [](https://github.com/mock-server/mockserver-monorepo/stargazers) |
| 4 | [](https://artifacthub.io/packages/search?repo=mockserver) |
| 5 | ===== |
| 6 | |
| 7 | MockServer is an HTTP(S) **mock server** and **proxy** for testing. It does three things: |
| 8 | |
| 9 | - **Mock** the APIs your application depends on, so you can develop and test against systems that are unavailable, incomplete, or hard to reproduce. |
| 10 | - **Proxy** real traffic to record, inspect, and modify requests and responses in flight — and pause them at interactive **proxy breakpoints** to step through, edit, or abort each exchange like a debugger for network traffic. |
| 11 | - **Chaos engineering** — make dependencies misbehave on demand, injecting latency, dropped connections, and errors to test how your application copes when the systems it relies on degrade or fail. |
| 12 | |
| 13 | **Speaks every protocol your stack uses.** HTTP/1.1 & HTTPS, HTTP/2, gRPC & gRPC-Web, WebSockets and raw TCP are auto-detected from the first bytes of each connection, so one MockServer port handles them all with no per-protocol configuration. Beyond that core: HTTP/3 (QUIC — experimental, on its own UDP port), JSON-RPC for MCP/A2A mocking, AsyncAPI-driven message-broker testing against external Kafka and MQTT brokers, and mocked AI/LLM chat-completion APIs (OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI, Ollama). |
| 14 | |
| 15 | ### Main Features |
| 16 | |
| 17 | - **Mock any API** — HTTP/1.1, HTTPS, HTTP/2, HTTP/3, gRPC, gRPC-Web, JSON-RPC, WebSockets, raw TCP, and message brokers (Kafka, MQTT). Match requests on method, path, query, headers, cookies and body (JSON, XML, JSONPath, XPath, regex, OpenAPI) and return configured responses. |
| 18 | - **Proxy & record** — port forwarding, web (HTTP) proxy, HTTPS tunneling (CONNECT) and SOCKS, with full visibility of even TLS-encrypted traffic. |
| 19 | - **Dynamic responses** — response templating (Velocity, Mustache, JavaScript), class/closure callbacks and webhooks. |
| 20 | - **OpenAPI** — generate expectations directly from an OpenAPI/Swagger specification. |
| 21 | - **Verification** — assert which requests were received, in what order, and how many times. |
| 22 | - **Chaos & resilience testing** — inject latency, dropped/slow connections and failures to test how your system copes with a misbehaving dependency. |
| 23 | - **LLM / AI mocking** — mock chat-completion APIs for OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI and Ollama (including streaming), plus a built-in MCP server for AI coding assistants. |
| 24 | - **Live dashboard** — watch requests, expectations and logs in real time at `/mockserver/dashboard`. |
| 25 | - **Clients & integrations** — Java, JavaScript/Node, Python and Ruby clients, plus JUnit and Spring support. |
| 26 | - **Run anywhere** — Docker, Helm/Kubernetes, JAR or WAR, with optional clustered state for multi-instance deployments. |
| 27 | |
| 28 | See the [changelog](changelog.md) for what has shipped in each version. |
| 29 | |
| 30 | ### Getting started in 60 seconds |
| 31 | |
| 32 | Run MockServer with Docker, then mock an endpoint and call it: |
| 33 | |
| 34 | ```bash |
| 35 | # 1. Start MockServer |
| 36 | docker run -d --rm -p 1080:1080 mockserver/mockserver |
| 37 | |
| 38 | # 2. Mock an endpoint: GET /hello -> 200 "Hello World" |
| 39 | # (MockServer exposes a REST control plane on the same port) |
| 40 | curl -X PUT http://localhost:1080/mockserver/expectation \ |
| 41 | -H 'Content-Type: application/json' \ |
| 42 | -d '{ |
| 43 | "httpRequest": { "method": "GET", "path": "/hello" }, |
| 44 | "httpResponse": { "statusCode": 200, "body": "Hello World" } |
| 45 | }' |
| 46 | |
| 47 | # 3. Call your mo |