
MCPClientMock
io.github.Akkshay10由 GitHub 账号 Akkshay10 发布v1.0.2更新于 Oct 24, 2026
MCP server for James Bloom MockServer - create expectations, verify requests, and manage mock state
概览
面向 James Bloom MockServer 的 MCP 服务器,让助手创建模拟 HTTP 期望、校验收到的请求,并清理或重置模拟状态。
- 可以做什么
- 创建模拟 HTTP 期望,可设置请求匹配条件(方法、路径、查询参数、请求头、请求体)与响应(状态码、响应头、响应体、延迟、次数、有效期)
- 校验 MockServer 是否收到符合条件的请求,可指定至少、至多或精确次数
- 按匹配条件筛选并获取已记录的请求
- 按条件清理或全部清理期望与已记录请求,并可整体重置 MockServer
- 查看 MockServer 的连接状态与配置
- 适用场景
- 适合在后端尚未就绪时开发或测试 HTTP 接口,或让助手针对某个 MockServer 实例搭建并检查模拟端点,用于前端与集成测试。
- 运行要求
- 需要 Node.js 18 或更高版本,通过 npx 或全局 npm 安装运行。还需一个正在运行的 MockServer 实例,通过环境变量 MOCKSERVER_HOST(默认 localhost)和 MOCKSERVER_PORT(默认 1080)指定。仅支持桌面客户端。
安装
在 SourceWeft 中
- 打开 控制台中的 MCPClientMock,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
mockserver-mcp
An MCP (Model Context Protocol) server for interacting with James Bloom's MockServer. This enables AI assistants to create mock HTTP expectations, verify requests, clear state, and manage MockServer instances programmatically.
Prerequisites
You need a running MockServer instance:
Installation
Using npx (recommended)
Global installation
Configuration
Environment Variables
MCP Client Configuration
Add to your MCP client configuration file (e.g., Claude Desktop, Kiro, Cursor):
For shared team MockServer, change MOCKSERVER_HOST to your server's address.
Available Tools
mockserver_create_expectation
Create a mock HTTP expectation on MockServer.
Parameters:
httpRequest(required): Request matching criteriamethod: HTTP method (GET, POST, PUT, DELETE, etc.)path: URL path to matchqueryStringParameters: Query parameters to matchheaders: Headers to matchbody: Body matcher withtype(STRING, JSON, REGEX, XPATH, JSON_PATH) andvalue
httpResponse: Response configurationstatusCode: HTTP status codeheaders: Response headersbody: Response body (string or object)delay: Response delay withtimeUnitandvalue
times: How many times to match (remainingTimes,unlimited)timeToLive: Expectation lifetime (timeUnit,timeToLive)
Example:
mockserver_verify
Verify that requests matching criteria were received by MockServer.
Parameters:
httpRequest(required): Request matching criteria (same as create_expectation)times: Expected request countatLeast: Minimum number of requestsatMost: Maximum number of requestsexactly: Exact number of requests
Example:
mockserver_clear
Clear expectations and recorded requests from MockServer.
Parameters:
httpRequest(optional): Request matcher to clear specific expectations. If not provided, clears all.
Example:
mockserver_reset
Perform a full reset of MockServer, clearing all expectations and recorded requests.
Parameters: None
mockserver_retrieve_requests
Retrieve recorded requests from MockServer.
Parameters:
httpRequest(optional): Request matcher to filter recorded requests
Example:
mockserver_status
Get MockServer connection status and configuration.
Parameters: None
Why Mocking?
API mocking enables early testing — start building and testing your frontend or integrations before the backend is ready. No more waiting. Ship faster.
Requirements
- Node.js >= 18.0.0
- A running MockServer instance
Links
- npm: https://www.npmjs.com/package/mockserver-mcp
- GitHub: https://github.com/Akkshay10/MCPClientMock
- MCP Registry: https://registry.modelcontextprotocol.io
License
MIT
来源:README.md,提交 d4bf387
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分