mock
Mock MCP Server - AI-driven mock data orchestration with OpenAPI JSON Schema for testing
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):
- Install the package:
npm install -D mock-mcp
or with yarn:
yarn add -D mock-mcp
or with pnpm:
pnpm add -D mock-mcp
- 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"]
}
}
}
- 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
openmcp
Turn any openapi file into an mcp server, with just the tools you need.
furi
CLI & API for MCP management
mcp-openapi
OpenAPI specification MCP server.
openapi2mcptools
OpenAPI specifications => MCP (Model Context Protocol) tools
sufetch
Type-safe OpenAPI clients with MCP server for AI-driven API exploration
mcp-chaos-rig
A local MCP server that breaks on demand. Test your client against auth failures, disappearing tools, flaky responses, and token expiry, all from a web UI.