mock-server/mockserver-monorepo
MockServer is an HTTP(S) mock server and proxy for testing that lets you mock APIs, inspect and modify live traffic, and inject failures. It supports HTTP/1.1, HTTP/2, gRPC, WebSockets, TCP and more on a single port, with additional support for HTTP/3, message brokers, and AI/LLM APIs.
What it solves
MockServer provides a way to test applications that depend on external APIs without needing those actual systems to be available, complete, or stable. It prevents development bottlenecks caused by unavailable dependencies and allows developers to simulate rare failure scenarios (chaos engineering) that are difficult to reproduce in real environments.
How it works
It acts as an HTTP(S) server and proxy that can be configured via a REST control plane. It supports a wide array of protocols including HTTP/1.1, HTTP/2, gRPC, WebSockets, and raw TCP. Users can define "expectations" (matching requests based on path, headers, or body) and specify the corresponding responses. It can also proxy real traffic to record and modify requests in flight or generate mocks directly from OpenAPI specifications.
Who it’s for
Software developers and QA engineers who need to isolate their application from external dependencies during testing, perform resilience testing through chaos engineering, or mock AI/LLM chat-completion APIs.
Highlights
- Multi-protocol support: Handles HTTP/1.1, HTTPS, HTTP/2, gRPC, WebSockets, and raw TCP on a single port.
- AI/LLM Mocking: Built-in support for mocking chat-completion APIs from OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI, and Ollama.
- Chaos Engineering: Ability to inject latency, dropped connections, and errors to test system resilience.
- MCP Integration: Includes a built-in Model Context Protocol (MCP) server for AI coding assistants.
- Dynamic Responses: Supports response templating using Velocity, Mustache, and JavaScript.