MockServer is an HTTP(S) mock server and proxy for testing that enables you to mock APIs, inspect and modify live traffic, and inject failures for chaos engineering scenarios.
MockServer addresses the need to test applications against unavailable, incomplete, or hard-to-reproduce dependencies. It operates in three modes: mocking APIs so development and testing can proceed without external systems, proxying real traffic to record and inspect requests and responses with interactive breakpoints that let you step through exchanges like a network debugger, and injecting chaos by making dependencies misbehave on demand with latency, dropped connections, and errors. The tool auto-detects protocols from the first bytes of each connection, allowing a single MockServer port to handle HTTP/1.1, HTTPS, HTTP/2, gRPC, gRPC-Web, WebSockets, and raw TCP without per-protocol configuration. It also supports HTTP/3 on a separate UDP port, JSON-RPC for MCP and A2A mocking, AsyncAPI-driven message-broker testing against external Kafka and MQTT brokers, and mocked AI and LLM chat-completion APIs compatible with OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI, and Ollama.
MockServer suits teams building applications that depend on multiple external services and need to test failure scenarios, inspect network behavior, or develop against systems not yet available. It is particularly valuable for chaos engineering workflows and for testing integrations with AI APIs. The tool provides client libraries for Java, JavaScript, Node.js, Python, and Ruby, and can be deployed via Homebrew, Grunt plugins, or container orchestration.
The project maintains active continuous integration with passing builds. Development spans multiple client implementations across different languages and includes support for emerging protocols and API standards. The tool integrates with modern testing infrastructure through plugins and package managers, and extends into specialized domains like AI API mocking and message-broker testing.