Install
$ agentstack add mcp-fengf233-mcp-mock-server ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
MCP 服务器
基于 Model Context Protocol (MCP) 的模拟服务器,用于开发和测试 MCP 客户端。
功能
- 工具调用:提供模拟工具,支持参数化模板
- 提示词管理:动态生成提示词内容
- 资源访问:提供模拟资源数据
- 多传输支持:支持 StreamableHTTP 和 SSE 传输
快速开始
安装依赖
go mod tidy
配置服务器
编辑 mock.yaml 文件配置服务器参数:
server:
host: "0.0.0.0"
port: 9999
transport: "StreamableHTTP" # 或 "sse"
运行服务器
# 编译
go build
# 运行
./mcp_server
服务器将在 http://localhost:9999/mcp 启动。
配置说明
工具配置
在 mock.yaml 中定义工具:
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:
- name: "summarize_article"
description: "Summarize a given article"
arguments:
- name: "article"
required: true
mock_template: "Summarize: {{article}}"
资源配置
resources:
- name: "user_profile"
mime_type: "application/json"
uri: "internal://resources/user_profile.json"
mock_content: "{\"user_id\": \"{{user_id}}\"}"
项目结构
mcp_server/
├── main.go # 服务器主程序
├── config.go # 配置加载和解析
├── registry.go # 工具、提示词、资源注册
├── mock.yaml # 服务器配置文件
├── go.mod # 模块定义
└── go.sum # 依赖校验
依赖
github.com/mark3labs/mcp-go/server:MCP 服务器库github.com/mark3labs/mcp-go/mcp:MCP 协议定义gopkg.in/yaml.v3:YAML 配置文件解析
使用示例
- 启动服务器:
./mcp_server - 使用 MCP 客户端连接:
mcp_client -type http -url http://localhost:9999/mcp - 在客户端中调用工具、获取提示词、查看资源
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: fengf233
- Source: fengf233/mcp-mock-server
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.