Token导航 LogoToken导航TokenDH.com
mcpmock (Strowk) logo
AI代理未说明官方级别未说明来源级核验

mcpmock (Strowk)

MCP Server

一个从YAML文件中的案例列表生成模拟Model Context Protocol服务器的CLI工具,用于开发和测试环境。

工具数

1

提示词数

0

GitHub Stars

6

资源数

0
命令行工具GoAI代理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

strowk

提供方

strowk

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

mcpmock

CLI tool that generates a mock Model Context Protocol server from list of cases in a YAML file.

安装

来自npm: npm install -g @strowk/mcpmock

Github发布: 下载,解压缩并将二进制文件放入PATH中

来源:

go get github.com/strowk/mcpmock
go install github.com/strowk/mcpmock

用法

例如,如果你在YAML文件中定义了这样的东西:

case: List tools

# requesting list of tools
in: {"jsonrpc": "2.0", "method": "tools/list", "id": 1}

# expect one tool in the list
out: {"jsonrpc": "2.0", "result":{ "tools": [{"description": "Hello MCP", "inputSchema": {"type": "object"}, "name": "hello"}] }, "id": 1}

---

case: Call Hello tool

# calling the tool
in: {"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "hello", "arguments": {}}, "id": 1}

# expect "Hi!" as output
out: {
  "jsonrpc": "2.0", 
  "id": 1,
  "result": {
    "content": [
      {"type": "text", "text": "Hi!"}
    ],
    "isError": false
  }, 
}

然后,如果你把它放在文件夹里 testdata (确保文件也以结尾 _test.yaml)然后像这样运行mcpmock:

mcpmock serve testdata

它将启动一个带有stdio传输的模拟MCP服务器,为YAML文件中定义的情况提供服务。

如果您现在将此内容复制并粘贴到您的终端中:

{"jsonrpc": "2.0", "method": "tools/list", "id": 1}

,您应该看到第一个MCP案例中定义的工具列表。

并发送以下内容:

{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "hello", "arguments": {}}, "id": 1}

,您应该得到第二种情况中定义的输出。

它还将注意更换 id 响应中的字段 id 根据请求,如果您发送以下内容:

{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "hello", "arguments": {}}, "id": 2}

,您应该得到第二种情况中定义的输出,但 id 字段设置为 2.

目录标签

目录标签

命令行工具GoAI代理MCP协议本地部署模拟服务器CLI工具YAML解析开发测试

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP