Mockserver logo

Mockserver

Mock, record, replay, verify, and chaos-test HTTP, REST, gRPC, and LLM dependencies through MCP.

Install Mockserver

Run the project’s own setup commands, in order.

Setup steps from the project

mockserver installs with its own commands rather than a config we can generate, so these are copied as-is. Run them in order in a terminal. Source: github.com

  1. 1. Start the server
    docker run -d --rm -p 1080:1080 mockserver/mockserver
    
  2. 2. Install
    helm upgrade --install --namespace mockserver mockserver oci://ghcr.io/mock-server/charts/mockserver
    

Overview

The mockserver MCP server exposes MockServer to AI agents through the `/mockserver/mcp` endpoint. It supports creating dependency mocks, recording and replaying traffic, verifying requests, and injecting latency, connection drops, or errors for resilience testing. MockServer also handles HTTP(S), HTTP/2, gRPC, gRPC-Web, WebSockets, raw TCP, and several AI API formats from one service. Reach for it when an agent needs to configure or inspect test dependencies without hand-writing every mock.

Use cases

  • Mock external HTTP and REST services during integration tests
  • Record and replay real dependency traffic
  • Verify requests sent by an application
  • Inject latency and connection failures into test environments
  • Generate mocks from OpenAPI specifications

Key features

  • MCP endpoint for AI-driven MockServer control
  • HTTP, HTTPS, HTTP/2, gRPC, WebSockets, and raw TCP support
  • Record, replay, proxy, and request-verification workflows
  • OpenAPI and Swagger mock generation
  • Chaos testing with latency, dropped connections, and errors
  • LLM API mocking with streaming support

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

47/48 checks healthy over the last 91d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.

How Mockserver works

What mockserver does

MockServer provides a single test and development service for replacing, observing, and modifying application dependencies. Through its built-in MCP endpoint at /mockserver/mcp, AI agents can drive MockServer while working on integration tests, local development, or failure scenarios.

The underlying service can return fixed, templated, or callback-generated responses; proxy requests to real services; record traffic for later replay; and verify that expected requests were received. It can also inject latency, dropped connections, and errors to exercise application behavior when dependencies fail.

MockServer accepts connections for HTTP/1.1, HTTPS, HTTP/2, gRPC, gRPC-Web, WebSockets, and raw TCP. It also supports JSON-RPC scenarios for MCP and A2A mocking, AsyncAPI-driven testing with Kafka and MQTT brokers, and chat-completion APIs from OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI, and Ollama, including streaming responses.

How it works

MockServer listens on a port and identifies the protocol from the initial connection data. Expectations define how incoming requests are matched and which responses should be returned. Matching can use the HTTP method, path, query parameters, headers, cookies, and request body. Body matching supports JSON, XML, JSONPath, XPath, and regular expressions.

The service can operate as a mock, a proxy, or both. Proxy modes include port forwarding, HTTP proxying, HTTPS tunneling, and SOCKS. A live dashboard and REST control plane are available on the same service, allowing clients and test code to configure expectations and inspect activity.

OpenAPI or Swagger definitions can be used to generate mocks instead of defining each expectation manually. Optional clustered state supports multi-instance deployments.

Setup and configuration

A Docker deployment can be started with:

Terminal
docker run -d --rm -p 1080:1080 mockserver/mockserver

The service then listens on port 1080. A Homebrew installation is available on macOS and Linux, and the mockserver command can run the service directly. Other distribution options include a GitHub Container Registry image, Helm, Maven artifacts, a WAR, an npm package for starting and stopping the service, and Testcontainers modules.

The MCP endpoint is available at /mockserver/mcp. The REST control plane uses the same port, and the dashboard is available at /mockserver/dashboard. Client libraries are provided for Java, JavaScript/Node, Python, Ruby, Go, PHP, .NET, and Rust.

Java 17 or newer is required when running the server with a local JVM. The official Docker image includes its own JVM, so container users do not need to install Java separately.

Tools and capabilities

  • Create expectations for HTTP and related dependency calls.
  • Return fixed, templated, or callback-based responses.
  • Record, inspect, modify, and replay proxied traffic.
  • Verify that requests matching specified criteria were received.
  • Generate mocks from OpenAPI or Swagger specifications.
  • Inject latency, connection drops, and errors for chaos testing.
  • Mock supported LLM chat-completion APIs, including streaming.

Limitations and notes

MockServer is intended for development and testing only, not production use. Local JVM deployments require Java 17 or newer; the Docker image avoids that separate runtime requirement. HTTP/3 support is experimental. Protocol coverage and behavior depend on the MockServer service configuration and the expectations supplied through its control interfaces.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mockserver

mockserver is an MCP server that connects AI agents to MockServer through the /mockserver/mcp endpoint. It provides tools for creating and using HTTP dependency mocks, recording or replaying traffic, verifying requests, and injecting latency, dropped connections, or errors for chaos testing.

Install MockServer with Docker, Homebrew, Helm, Maven, or another supported distribution, then expose its `/mockserver/mcp` endpoint to the MCP client. Docker users can run `docker run -d --rm -p 1080:1080 mockserver/mockserver`; the image includes its own JVM.

Connect the agent to MockServer's `/mockserver/mcp` endpoint. MockServer exposes its MCP service alongside the REST control plane on the configured port, which defaults to port 1080 in the Docker and command-line examples.

Yes, run the official Docker image because it bundles its own JVM. Local JVM deployments require Java 17 or newer, while Docker users do not need a separate Java installation.

No, MockServer is intended for development and testing only. Use it to mock, proxy, inspect, verify, or disrupt dependencies in test environments rather than as a production service.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMockserver AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mockserver?style=directory)](https://allmcps.com/mcp/mockserver)
HTML Embed
<a href="https://allmcps.com/mcp/mockserver"><img src="https://allmcps.com/api/badge/mockserver?style=directory" alt="Mockserver on AllMCPs" /></a>