--- title: MockServer description: Open-source HTTP/HTTPS mock server, recording proxy, and MCP server for AI assistants. Mock any API, record and replay traffic, generate from OpenAPI. layout: default ---

MockServer

Mock any HTTP service. Record traffic. Now with MCP for AI assistants.

Fork MockServer on GitHub  
MockServer GitHub Project  Join MockServer Slack  BuildKite Build Status
 

Getting Started

To get started see the guide for mocking, proxying, connecting an AI assistant via MCP, or the code examples.

 

What is MockServer

For any system you integrate with via HTTP or HTTPS MockServer can be used as:

MockServer is also AI-native: every instance ships a built-in Model Context Protocol (MCP) server at /mockserver/mcp with no extra configuration, and the documentation is published in machine-readable form for LLMs. In practice this means:

See AI & MCP Integration below for the full list of AI capabilities.

When MockServer receives a request it matches the request against active expectations that have been configured. Then, if no matches are found, it proxies the request if appropriate; otherwise a 404 is returned.

For each request received the following steps happen:

  1. find matching expectation and perform action
  2. if no matching expectation proxy request
  3. if not a proxy request return 404

An expectation defines the action that is taken, for example, a response could be returned.

MockServer supports the follow actions:

 

Proxying with MockServer

MockServer can:

MockServer supports the following proxying techniques:

 

AI & MCP Integration

MockServer is built to be AI-native. A built-in Model Context Protocol (MCP) server lets AI coding assistants drive the mock server in natural language, and an OpenAPI spec provides a fallback for tools that don't yet speak MCP. All documentation, including llms.txt, llms-full.txt, and ai.txt, is structured for retrieval and citation by LLMs.

The MCP endpoint requires no extra configuration — start MockServer and the AI surface is on the same port:

docker run -d --rm -p 1080:1080 mockserver/mockserver
# MCP endpoint immediately available at http://localhost:1080/mockserver/mcp
 

Why use MockServer

MockServer allows you to mock any server or service via HTTP or HTTPS, such as a REST or RPC service.

This is useful in the following scenarios:

Mocking Dependencies & Verifying Request

Given a system with service dependencies, as follows:

System In Production

MockServer could be used to mock the service dependencies, as follows:

Mocking service dependencies with MockServer

Isolating Single Service / Application

A single page application may load static resources such as HTML, CSS and JavaScript from a web server and also make AJAX calls to one or more separate services, as follows:

Single Page Application

To isolate a single AJAX service, for development or debugging, the MockServer can selectively forward specific requests to local instance of the service:

Isolating Single Service

Using MockServer as a content routing load balancer is described in more detail in the section called Isolate Single Service.

Why use MockServer as a proxy

MockServer allows you to record request from the system-under-test or two analysis an existing system by recording outbound requests.

This is useful in the following scenarios:

Recording Requests & Analysing Behaviour

MockServer can record all proxied requests, as follows:

Recording service requests with MockServer Proxy

Verifying Request

MockServer can verify proxied service requests, as follows:

Verifying service requests with MockServer Proxy

 

Developer Documentation

For detailed information about MockServer's internal architecture, infrastructure, build system, and operations, see the Contributing page, which links to comprehensive technical documentation on GitHub.