Skip to main content
Glama

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.

Related MCP server: mcp-mock

✨ 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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A mock MCP server for testing MCP client implementations and development workflows. Supports tools, prompts, and resources across multiple transport protocols (stdio, HTTP, SSE).
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight mock MCP server for local testing and resilience experiments, providing predictable tool responses with simulated latency and errors.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A fake MCP server that emulates the Pennylane MCP experience for local development, testing, demos, and CI pipelines, providing deterministic fixtures and authentication modes without needing a real Pennylane account.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Serves deterministic MCP protocol fixtures generated from tool contracts, enabling testing of MCP clients, gateways, and agent harnesses without live credentials or external services.
      MIT