Get the FREE Ultimate OpenClaw Setup Guide →

mcpmock

https://mcpmock.ai/ docs and samples.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio aratoai-mcpmock node server.js

How to use

MCPMock provides a configurable MCP (Model Context Protocol) mock server designed to help you develop, test, and demonstrate MCP-based clients and AI agents. It offers a library of mock tools, dynamic responses, and programmable tool behavior (static, template, sequence, and function-based responses) so you can simulate real MCP environments without depending on external services. The server exposes an MCP endpoint that you can initialize, list available tools, and call specific tools with arguments, enabling end-to-end testing of your MCP clients and workflows. Use it to prototype tool integrations, validate protocol handling, and iterate on tool definitions before wiring them to live services.

To interact with MCPMock, first start the server, then connect your MCP client to the provided endpoint. The server supports the standard MCP flow: initialize a connection, request a list of tools, and call a tool with the required arguments. Tools can be created and managed through the MCPMock UI or API, enabling you to craft realistic tool responses for your testing scenarios. This makes it suitable for AI agent development, integration testing, and demonstration environments where consistent, repeatable MCP interactions are crucial.

How to install

Prerequisites:

  • Node.js (version 18+ recommended) and npm
  • Git (optional, for cloning the repository)

Install from source:

  1. Clone the repository: git clone https://github.com/AratoAi/mcp-mock-server.git cd mcp-mock-server

  2. Install dependencies: npm install

  3. Configure environment (optional):

    • Create a .env file if you need environment-specific settings. Sample variables you might add: MCP_SERVER_PORT=3000 MCP_API_TOKEN=your-token
  4. Run the server: npm start

    or if your package.json defines a start script, use the exact command provided there

  5. Verify the server is listening (default port 3000): curl http://localhost:3000/

If you prefer running via npx or a packaged binary, follow the repository's guidance on installation methods once available in the documentation.

Additional notes

Tips and considerations:

  • Environment variables: Use .env to configure port, host, and any authentication or mock behavior toggles if supported by your setup.
  • Tool definitions: MCPMock supports static, template, sequence, and function tool responses. Leverage these to simulate various scenarios (e.g., rate limits, errors, or progressive tool outputs).
  • Endpoints: Ensure your MCP client targets the correct server URL provided by MCPMock (the endpoint format is typical MCP server endpoints as shown in the README).
  • Debugging: Check server logs for tool loading or initialization errors. Enable verbose logging if available to diagnose protocol mismatches.
  • Security: For demos or local testing, keep authentication disabled or use a safe API token. Do not expose MCP endpoints publicly in production-grade environments.

Related MCP Servers

Sponsor this space

Reach thousands of developers