███╗ ███╗ ██████╗██████╗ ██╗ ██╗██╗ ██╗
████╗ ████║██╔════╝██╔══██╗██║ ██║╚██╗ ██╔╝
██╔████╔██║██║ ██████╔╝███████║ ╚████╔╝
██║╚██╔╝██║██║ ██╔═══╝ ██╔══██║ ╚██╔╝
██║ ╚═╝ ██║╚██████╗██║ ██║ ██║ ██║
╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝
无需更改代码即可将您的REST API转换为智能的、基于聊天的MCP服务器
🚀 准备尝试吗? npm install -g mcphy • 🎯 快速开始 • 📖 API 文档 • 🎨 示例 • ⭐ 点赞
# 选项1:全局安装
npm install -g mcphy
# 选项2:不安装试用
npx mcphy --help
# 1. 使用您的API规范初始化
mcphy init
# 2. 启动对话式服务器
mcphy serve
# 3. 打开浏览器
open http://localhost:3000
就这样! 开始用简单的英语与您的API进行对话。
如果mcphy init失败,请尝试以下快速修复:
❌ 没有找到API规范?
# 显式指定您的API规范文件
mcphy init -f path/to/your/swagger.yaml
❌ 规范无效?
# 验证您的规范
mcphy validate path/to/your/api.yaml
❌ 文件未找到?
# 检查文件是否存在并使用绝对路径
mcphy init -f /full/path/to/api.yaml
📖 查看详细解决方案的全面故障排除指南
想立即测试MCPhy?使用我们包含的示例:
# 克隆并使用示例API测试
git clone https://github.com/sehmim/mcphy.git
cd mcphy
npm install
npm run build
npm link
# 使用示例测试
cd examples
mcphy init -f sample-swagger.yaml
mcphy serve
然后打开http://localhost:3000并尝试:
您: "为John Doe创建2025-01-15的机油更换预约"
MCPhy: ✅ 匹配POST /bookings
📤 正在进行API调用...
📋 响应: {"id": "booking-123", "status": "created"}
| 命令 | 描述 |
|---|---|
mcphy init | 使用API规范初始化项目 |
mcphy serve | 启动MCP服务器 |
mcphy validate <file> | 验证API规范 |
mcphy export | 创建独立包 |
MCPhy现在使用GPT-4来智能地理解和增强所有API规范!
使用方法:
# 适用于任何格式 - OpenAPI、Swagger 或 Postman
mcphy init -f api-spec.yaml
mcphy init -f swagger.json
mcphy init -f postman_collection.json
# 验证任何格式
mcphy validate your-api-file
💡 OpenAI API密钥的好处(可选):
git clone https://github.com/sehm
im/mcphy.git
cd mcphy
npm install
npm run build
npm link
MIT © 2025 MCPhy
由开发者为开发者制作 ❤️
</div>