AI Skill Hub 强烈推荐:MockServer 是一款优质的MCP工具。已获得 4.9k 颗 GitHub Star,AI 综合评分 8.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
MockServer 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MockServer 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/mock-server/mockserver-monorepo
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mockserver": {
"command": "npx",
"args": ["-y", "mockserver-monorepo"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 MockServer 执行以下任务... Claude: [自动调用 MockServer MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mockserver": {
"command": "npx",
"args": ["-y", "mockserver-monorepo"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
MockServer
/mockserver/dashboard.See the changelog for what has shipped in each version.
Feature requests are submitted to GitHub issues and tracked on the project roadmap.
Runtime: MockServer 6.x requires Java 17+. The minimum was raised from Java 11 as part of the Jakarta EE 10 / Spring 7 platform modernisation — see the Java 17 / Jakarta upgrade guide. If you are still on Java 11, pin to the 5.15.x line (no longer receiving security updates). The official Docker image already bundles a Java 17 runtime.
Building from source: requires JDK 17+; the produced bytecode targets Java 17.
Security Note: MockServer is a development and testing tool only. See SECURITY.md for important security considerations.
Run MockServer with Docker, then mock an endpoint and call it:
```bash
…or, on macOS / Linux, install it with [Homebrew](https://brew.sh/) and run the `mockserver` command directly:
bash brew install mockserver mockserver run --port 1080
#### One-command recipes
For common end-to-end setups, the [`examples/docker-compose`](examples/docker-compose) recipes are a single `docker compose up` each — mock from an OpenAPI spec, a record/replay proxy, a contract-validating proxy, or a chaos proxy:
bash cd examples/docker-compose/mock-from-openapi docker compose up curl http://localhost:1080/pets ```
The same can be done from any client library or the dashboard at <http://localhost:1080/mockserver/dashboard>. For more configuration options see the Docker documentation.
For every way to run MockServer yourself — Docker, docker-compose recipes, the mockserver CLI, the JVM-less binary bundle, Helm/Kubernetes, the JAR, and Testcontainers — see the Self-Hosting MockServer guide.
Explore MockServer's REST control plane from an API client — create expectations, verify requests, and inspect recorded traffic:
examples/postman (guide).examples/bruno in Bruno via Open Collection (guide).MockServer includes a built-in MCP server for AI coding assistant integration at /mockserver/mcp. See llms.txt and AI Integration docs.
MockServer 是一个功能强大的 HTTP(S) Mock Server 与 Proxy 工具,专为测试场景设计。它能够模拟应用程序所依赖的各类 API,帮助开发者在目标系统不可用、不完整或难以复现的情况下,依然能够高效地进行开发与测试工作。
MockServer 支持模拟几乎所有的 API 协议,包括 HTTP/1.1、HTTPS、HTTP/2、HTTP/3、gRPC、gRPC-Web、JSON-RPC、WebSockets 以及原始 TCP 协议。此外,它还支持 Kafka 和 MQTT 等消息代理。你可以通过 Method、Path、Query、Headers、Cookies 及 Body(支持 JSON、XML、JSONPath、XPath、Regex、OpenAPI)进行精确的请求匹配。同时,它还具备强大的 Proxy & Record 功能,支持端口转发、HTTP 代理、HTTPS Tunneling (CONNECT) 和 SOCKS 代理,并能完整记录所有流量。
运行 MockServer 6.x 版本需要 Java 17 或更高版本。由于项目进行了 Jakarta EE 10 和 Spring 7 平台的现代化升级,最低 Java 版本已从 Java 11 提升至 Java 17。建议开发者在升级前参考官方的 Java 17 / Jakarta 迁移指南。
你可以通过 Docker 快速启动 MockServer 进行体验。对于 macOS 或 Linux 用户,也可以使用 Homebrew 进行安装,通过执行 `brew install mockserver` 后直接运行 `mockserver run --port 1080` 命令来启动服务。
你可以通过简单的命令快速模拟一个 Endpoint。例如,通过 Docker 启动后,可以配置一个 GET 请求,使其在访问 `/hello` 时返回 200 状态码及 "Hello World" 内容。此外,项目在 `examples/docker-compose` 中提供了多种一键式配置方案(One-command recipes),支持根据 OpenAPI 规范进行 Mock,或实现 Record/Replay 代理及契约测试等复杂场景。
MockServer 作为一个高度可定制的测试工具,提供了丰富的 API 接口用于模拟和代理流量。它不仅可以作为 Mock Server 模拟外部依赖,还可以作为 Proxy 拦截、检查并修改实时流量,确保测试环境的高度可控性。
MockServer 深度集成了 AI 能力,内置了符合 Model Context Protocol (MCP) 标准的 MCP Server,可通过 `/mockserver/mcp` 路径进行访问。这使得开发者能够将其无缝集成到 AI Coding Assistant 中,通过 `llms.txt` 和专门的 AI Integration 文档,实现智能化、自动化的 API 测试工作流。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,MockServer 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | mockserver-monorepo |
| 原始描述 | 开源MCP工具:MockServer enables easy mocking of any system you integrate with via HTTP or HTT。⭐4.9k · Java |
| Topics | mockhttpjava |
| GitHub | https://github.com/mock-server/mockserver-monorepo |
| License | Apache-2.0 |
| 语言 | Java |
收录时间:2026-06-02 · 更新时间:2026-06-02 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端