yulinlina

mcp-mock

Community yulinlina
Updated

Spin up deterministic mock MCP servers from a JSON fixture file for agent and client testing.

mcp-mock

Spin up deterministic mock MCP servers from a JSON fixture file for agent and client testing.

License Language Status Python License MCP

🎯 Why?

Trending repos show a wave of MCP gateways, agent harnesses, and CLI clients, but testing tooling is still primitive. Developers need deterministic offline MCP servers to validate clients and agent tool use without hitting real APIs. Existing MCP examples are SDK snippets, not a fixture-driven mock server with CLI ergonomics.

Target audience: Developers building MCP clients, agent harnesses, and CI pipelines who need reproducible offline tool endpoints.

✨ Features

  • ✨ JSON fixture specs for MCP tools
  • ✨ stdio JSON-RPC server supporting initialize, tools/list, and tools/call
  • ✨ canned results, tool-level errors, latency simulation, and {{argument}} templating
  • ✨ CLI commands to init, validate, list, run, and call mock tools

πŸš€ Quick Start

# Install
pip install mcp-mock

# Run
mcp-mock --help

πŸ“¦ Installation

From Source

git clone https://github.com/YOUR_USERNAME/mcp-mock.git
cd mcp-mock
# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest -v

🎬 Demo

The GIF above was recorded using Charm VHS:

vhs < demo.tape

πŸ“– Usage

# Show help
mcp-mock --help

# Common usage examples
mcp-mock --example

πŸ—οΈ Architecture

graph LR
    A[Input] --> B[Core Engine]
    B --> C[Output]
    B --> D[Plugins]
    D --> E[Extensions]

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT Β© 2026 β€” See LICENSE for details.

If this project helped you, please ⭐ star it!

Made with ❀️ and AI

MCP Server Β· Populars

MCP Server Β· New

    jonashertner

    OpenCaseLaw

    Open Swiss legal corpus + MCP server: 1M+ court decisions (1875–today), 21k laws, 10M-edge citation graph, 42 MCP tools. CC0 data, MIT code. Live at mcp.opencaselaw.ch

    Community jonashertner
    SystemCraftsman

    Strimzi Kafka CLI

    Command Line Interface for the Strimzi Kafka Operator

    Community SystemCraftsman
    DROOdotFOO

    Raxol

    Write one app, render it to a terminal, a browser, or as agent tools. The terminal for your Gundam.

    Community DROOdotFOO
    morluto

    REA: Reverse Engineer Anything

    Reverse engineer anything with agents, from app behavior down to native binaries.

    Community morluto
    nedlir

    MCPwner

    Model Context Protocol server for autonomous vulnerability discovery

    Community nedlir