mcp-mock
simple mcp mock server
claude mcp add --transport stdio fengf233-mcp-mock-server docker run -i fengf233/mcp-mock-server \ --env PORT="9999" \ --env TRANSPORT="StreamableHTTP"
How to use
This MCP server is a mock implementation for developing and testing MCP clients. It exposes configurable tools, dynamic prompts, and simulated resources, with support for multiple transport methods (StreamableHTTP and SSE). After starting, clients can connect to the MCP endpoint at http://localhost:9999/mcp and invoke defined tools or request prompts and resources. You can define tools (with parameters and mock templates), prompts (with argument structures and mock responses), and resources (with MIME types and mock content) in a mock.yaml configuration file, enabling realistic MCP interactions for client development and testing.
How to install
Prerequisites:
- Docker installed (for the provided docker-based run) or a Go environment if you choose to build locally from source.
- git to clone the repository (optional if you already have the code).
Installation steps (Docker-based run):
- Ensure Docker is running on your machine.
- Pull and run the mock server image: docker run -i fengf233/mcp-mock-server
- The server will be available at http://localhost:9999/mcp by default (as configured via TRANSPORT and PORT in the environment).
- Place and edit mock.yaml to configure tools, prompts, and resources as needed.
If you prefer building from source (Go), prerequisites are:
- Go 1.20+ installed
- GOPATH/module mode enabled (go mod in use)
Build steps (local Go build):
- git clone <repository-url>
- cd mcp-mock
- go mod tidy
- go build
- ./mcp_server
Configuration example (mock.yaml): server: host: "0.0.0.0" port: 9999 transport: "StreamableHTTP" # or "sse"
Tools example: tools:
- name: "get_weather"
description: "Get current weather for a city"
parameters:
- name: "city" type: string required: true mock_template: "The current weather in {{city}} is sunny, 25°C."
Prompts example: prompts:
- name: "summarize_article"
description: "Summarize a given article"
arguments:
- name: "article" required: true mock_template: "Summarize: {{article}}"
Resources example: resources:
- name: "user_profile" mime_type: "application/json" uri: "internal://resources/user_profile.json" mock_content: "{"user_id": "{{user_id}}"}"
Additional notes
Tips:
- Ensure mock.yaml is valid YAML; indentation and spacing are important.
- If you change the transport to SSE, verify clients use an SSE-capable MCP client.
- When debugging, check the server logs for configuration loading errors and invalid tool/prompt/resource definitions.
- The mock server supports dynamic content generation through templates; customize mock_template values to reflect realistic responses.
- For production-like testing, simulate resource MIME types and content to validate client handling of binary vs text data.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go