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: mock-llm-mcp

✨ 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

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MEOK MCP Test MCP — golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in

  • Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yulinlina/mcp-mock'

If you have feedback or need assistance with the MCP directory API, please join our Discord server