MockServer mocks, records, and proxies HTTP and HTTPS dependencies so tests stay isolated. It auto-detects HTTP/1.1, HTTP/2, gRPC, WebSockets, and TCP on one port.
Overview
MockServer is a single deployable tool for development and testing that stands in for external HTTP services. You configure expectations to return canned, templated, or callback-driven responses, or run it as a proxy to record, inspect, and modify live traffic, including TLS exchanges.
Matching can use method, path, query, headers, cookies, and body rules across JSON, XML, JSONPath, XPath, and regex. OpenAPI and Swagger specs can generate mocks. Chaos features add latency, dropped connections, and errors to exercise resilience. The same instance can mock some routes while proxying others.
It ships client libraries for several languages, a web dashboard, verification of received requests, record and replay, breakpoints, optional LLM API mocking, and a built-in MCP server so AI assistants can drive expectations. Deployment options include Docker, Helm on Kubernetes, JAR, Homebrew on macOS and Linux, and Testcontainers.
MockServer is explicitly scoped as a testing tool, not production middleware. Runtime requires Java 17+ when not using the bundled JVM in the official container image.
Key features
- HTTP mock expectations and verification
- Recording and replay proxy mode
- OpenAPI-driven mock generation
- Chaos latency and error injection
- gRPC and WebSocket on one port
- Built-in web dashboard
- MCP server for AI assistants
- Docker and Helm deployment
Use cases
- Isolated REST service unit tests
- Parallel development before APIs exist
- Recording production traffic for replay
- Resilience testing with injected faults
- LLM API stubbing in AI app tests