Get the FREE Ultimate OpenClaw Setup Guide →

mock

Mock MCP Server - AI-driven mock data orchestration with OpenAPI JSON Schema for testing

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mcpland-mock-mcp npx -y mock-mcp adapter

How to use

Mock MCP Server runs as a Daemon + Adapter architecture that enables multiple MCP clients to operate against AI-generated mock data without port conflicts. The server uses your OpenAPI JSON Schema definitions to ground generated mocks and supports batch processing with claim-based concurrency. Tools exposed by the adapter allow you to connect from tests, request mocks, and drive AI-generated responses that conform to your API contracts. Typical usage involves installing the mock-mcp package, configuring your MCP client to point at the mock-mcp adapter, and using the provided connect and requestMock interfaces to inject mocks during test runs.

Within the MCP ecosystem, you can connect a test client to fetch a mock client, describe the interception with metadata (including schema URL, the schema object, and instructions), and then request mocks for intercepted calls. The system coordinates multiple clients through a shared daemon per project, preventing race conditions and ensuring that mocks evolve consistently across test runs. The available capabilities include schema-aware generation, batch collection, and IPC-based communication via Unix Domain Sockets or Named Pipes, rather than traditional TCP ports.

How to install

Prerequisites:

  • Node.js and npm (or yarn/pnpm) installed on your development machine
  • Git available to clone or install from npm registry

Install the package as a dev dependency in your project (example using npm):

  1. Install the package:
npm install -D mock-mcp

or with yarn:

yarn add -D mock-mcp

or with pnpm:

pnpm add -D mock-mcp
  1. If you need to initialize or configure the MCP client in your project, follow the Quick Start guidance in the README to add the adapter configuration:
{
  "mcpServers": {
    "mock-mcp": {
      "command": "npx",
      "args": ["-y", "mock-mcp", "adapter"]
    }
  }
}
  1. Start using the server via your MCP client configuration. The adapter will start the daemon as needed and expose IPC-based communication for mock data requests.

Additional notes

Tips and notes:

  • The adapter connects to a shared daemon per project, eliminating port conflicts when multiple MCP clients run concurrently.
  • Communication happens via IPC (Unix Domain Sockets on macOS/Linux or Named Pipes on Windows).
  • Ensure your OpenAPI JSON Schema is accessible to the tooling and that metadata includes a valid schemaUrl and instructions for mock generation.
  • If you encounter issues with daemon startup, check for existing daemon processes per project and ensure the working directory aligns with your project root to enable proper IPC paths.
  • Environment variables are not strictly required for basic operation, but you may introduce project-specific overrides or toggles as needed in your test environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers