Mockserver

com.mock-serverPublished by mock-server.comv9.4.0Updated Nov 20, 2026

Mock, record/replay, verify and chaos-test any HTTP, REST, gRPC or LLM dependency over MCP.

VerifiedSTDIODesktop onlyDeveloper ToolsSecurity & Monitoring

Overview

AI-generated overview

MockServer's built-in MCP server lets an assistant create mocks, record and replay traffic, verify requests and inject chaos for HTTP, gRPC and LLM…

What you can do
  • Create and manage expectations that return canned, templated or callback responses for HTTP, gRPC and other protocols
  • Run as a proxy to record, inspect and modify real traffic, including TLS-encrypted exchanges
  • Verify that expected requests were received and inspect recorded request history
  • Inject latency, dropped connections and errors to chaos-test how an application copes
  • Mock LLM chat-completion APIs for OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI and Ollama, including streaming
  • Generate expectations from an OpenAPI/Swagger spec and drive everything through the REST control plane
When to use it
Useful when building or testing code that calls external HTTP, gRPC or LLM services and you want deterministic, controllable responses instead of real dependencies, or want to record real traffic and replay it later.
Requirements
A running MockServer instance reachable over streamable HTTP, typically the Docker image on port 1080; the MCP endpoint is served at /mockserver/mcp. Self-hosted non-container installs need Java 17+ (the Docker image bundles its own JVM). No authentication or environment variables are declared.
Before you install
MockServer is documented as a development and testing tool only, not for production use. It can proxy and inspect traffic, including TLS-encrypted exchanges, and modify requests in flight, so point it only at test systems and data. Expectations and proxy settings change server state, and the declared setup has no authentication, so do not expose the port publicly.

Installation

In SourceWeft

  1. Open Mockserver in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

MockServer            [Build status] [OpenSSF Best Practices] [GitHub license] [GitHub stars] [Artifact Hub] [MCP Toplist]

MockServer mocks, records, and chaos-tests any HTTP(S) dependency your application talks to — one binary, no per-protocol setup.

Why MockServer

  • One port, every protocol — HTTP/1.1, HTTPS, HTTP/2, gRPC & gRPC-Web, WebSockets and raw TCP are auto-detected from the first bytes of each connection. Beyond that: HTTP/3 (QUIC, experimental), JSON-RPC for MCP/A2A mocking, and AsyncAPI-driven testing against Kafka/MQTT brokers.
  • Mock, proxy, or both — return canned/templated/callback responses, or sit as a proxy (port forwarding, HTTP proxy, HTTPS tunneling, SOCKS) and record, inspect, and modify real traffic in flight, with full visibility into TLS-encrypted exchanges.
  • Chaos engineering built in — inject latency, dropped connections, and errors on demand to see how your application copes when a dependency misbehaves.
  • Mock AI too — chat-completion APIs for OpenAI, Anthropic, Gemini, Bedrock, Azure OpenAI and Ollama (including streaming), plus a built-in MCP server so AI coding assistants can drive MockServer directly.
  • Generate mocks, don't hand-write them — from an OpenAPI/Swagger spec, with request matching on method, path, query, headers, cookies, and body (JSON, XML, JSONPath, XPath, regex).
  • Fits your stack — Java, JavaScript/Node, Python, Ruby, Go, .NET, Rust, and PHP clients, plus JUnit and Spring support; runs as Docker, Helm/Kubernetes, a JAR, or a WAR, with a live dashboard and optional clustered state for multi-instance deployments.

See the changelog for what shipped in each version.

Getting started in 60 seconds

Run MockServer with Docker, then mock an endpoint and call it:

# 1. Start MockServer
docker run -d --rm -p 1080:1080 mockserver/mockserver

# 2. Mock an endpoint: GET /hello -> 200 "Hello World"
#    (MockServer exposes a REST control plane on the same port)
curl -X PUT http://localhost:1080/mockserver/expectation \
  -H 'Content-Type: application/json' \
  -d '{
        "httpRequest":  { "method": "GET", "path": "/hello" },
        "httpResponse": { "statusCode": 200, "body": "Hello World" }
      }'

# 3. Call your mock
curl http://localhost:1080/hello
# -> Hello World

…or, on macOS / Linux, install with Homebrew and run the mockserver command directly:

brew install mockserver
mockserver run --port 1080

For every way to run MockServer — Docker, docker-compose recipes, the mockserver CLI, a JVM-less binary bundle, Helm/Kubernetes, the JAR, and Testcontainers — see the Self-Hosting MockServer guide. The same setup can be driven from any client library or the dashboard at http://localhost:1080/mockserver/dashboard.

One-command recipes

The examples/docker-compose recipes are a single docker compose up each — mock from an OpenAPI spec, a record/replay proxy, a contract-validating proxy, or a chaos proxy:

cd examples/docker-compose/mock-from-openapi
docker compose up
curl http://localhost:1080/pets

Drive it from Postman or Bruno

[Run in Postman]

Install

ChannelCommand
Dockerdocker run -d --rm -p 1080:1080 mockserver/mockserver
Docker from GitHub Container Registry (avoids Docker Hub's pull limit)docker run -d --rm -p 1080:1080 ghcr.io/mock-server/mockserver
Homebrew (macOS/Linux)brew install mockserver
Helm (chart guide)helm upgrade --install --namespace mockserver mockserver oci://ghcr.io/mock-server/charts/mockserver
Maven Central [mockserver]org.mock-server:mockserver-netty-no-dependencies — see all Maven artifacts (server, WARs, JUnit 4/5, Spring, Maven plugin)
npmmockserver-node (start/stop)

Client libraries (create expectations, verify requests, drive the control plane from your tests):

[Java] [Node] [PyPI] [Gem] [Go] [Packagist] [NuGet] [Crates.io]

Full install options (SNAPSHOT repository, WAR deployment, Testcontainers modules, package-manager channels) are on the Self-Hosting guide and Where to find MockServer.

Requirements

Runtime: Java 17+ (raised from Java 11 in MockServer 6.0.0 — see the Java 17 / Jakarta upgrade guide; pin to 5.15.x if you need Java 11). The official Docker image bundles its own JVM, so containerised users need no JVM of their own.

Building from source: JDK 17+.

Security note: MockServer is a development and testing tool only — see SECURITY.md.

Documentation

Versions

[Latest release]

  • What changed: changelog and GitHub releases (every version is also a git tag mockserver-<version>).
  • API docs for a version: Java API at https://mock-server.com/versions/<version>/apidocs/index.html; REST API on SwaggerHub (one spec per major.minor.x).
  • Java 11: the last Java 11-compatible release is 5.15.0 (January 2023).

6.0.0 breaking change: the <classifier>shaded</classifier> Maven form was removed. Replace mockserver-netty:<version>:shaded with mockserver-netty-no-dependencies:<version> (same shaded bytes, new coordinates).

Community & Contributing

Maintainers

Source: README.md at commit 7db1289

Tools

0
SourceWeft started this package once in an isolated sandbox, without credentials, to list its tools. That failed: the package type cannot run in the sandbox.

Version history

6
  1. v9.4.0LatestNov 20, 2026
  2. v9.3.0Nov 17, 2026
  3. v9.2.0Oct 29, 2026
  4. v9.1.0Oct 21, 2026
  5. v9.0.0Oct 16, 2026
  6. v8.0.0Sep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts