YAPI Interface MCP Server
A Model Context Protocol server that allows AI development tools like Cursor and Claude Desktop to retrieve detailed YAPI interface information by interface ID.
Tools
yapi-get-interface
根据接口ID获取YAPI接口详情,支持格式:数字ID
README
yapi-get-interface-mcp
一个用于获取YAPI接口详情的MCP(Model Context Protocol)服务器,支持与Cursor、Claude Desktop等AI开发工具集成。
<a href="https://glama.ai/mcp/servers/@Gorvey/yapi-get-interface-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@Gorvey/yapi-get-interface-mcp/badge" alt="YAPI Interface Server MCP server" /> </a>
使用方法
可用工具
yapi-get-interface
根据接口ID获取YAPI接口详情
参数:
id:接口ID(数字格式)
使用示例:

AI工具会自动调用该工具并返回接口的完整信息,包括:
- 接口基本信息(名称、路径、方法等)
- 请求参数(路径参数、查询参数、请求头、请求体)
- 响应信息(响应体、响应类型等)
- 其他元数据(创建时间、状态、标签等)
命令行参数
| 参数 | 说明 | 必需 | 示例 |
|---|---|---|---|
--email |
YAPI登录邮箱 | 是 | --email admin@company.com |
--password |
YAPI登录密码 | 是 | --password mypassword |
--url |
YAPI服务器地址 | 是 | --url https://yapi.company.com |
快速开始
在Cursor中配置
创建或编辑 .cursor/mcp.json 文件(项目级配置)或 ~/.cursor/mcp.json 文件(全局配置):
{
"mcpServers": {
"yapi-get-interface-mcp": {
"command": "npx",
"args": [
"yapi-get-interface-mcp",
"--email", "your@email.com",
"--password", "yourpassword",
"--url", "https://yapi.yourcompany.com"
]
}
}
}
环境要求
- Node.js >= 18.0.0
- pnpm >= 8.0.0
安装
使用npx可以直接运行,无需本地安装:
# 克隆项目
git clone https://github.com/Gorvey/yapi-get-interface-mcp.git
cd yapi-get-interface-mcp
# 安装依赖
pnpm install
# 构建项目
pnpm run build
开发指南
项目结构
src/
├── config/ # 配置管理
│ └── yapi-config.ts
├── server/ # MCP服务器
│ ├── server.ts
│ ├── tools.ts
│ └── resources.ts
├── yapi/ # YAPI客户端
│ └── client.ts
└── index.ts # 入口文件
开发脚本
# 开发模式(带示例配置)
pnpm run dev
# 监听文件变化自动构建
pnpm run watch
# 清理构建文件
pnpm run clean
# 构建项目
pnpm run build
# 使用MCP Inspector调试
pnpm run inspector
调试
使用MCP Inspector进行调试:
pnpm run inspector
这将启动一个交互式界面,帮助你测试和调试MCP工具。
常见问题
1. YAPI连接失败
- 检查YAPI服务器地址是否正确
- 确认邮箱和密码是否正确
- 检查网络连接和YAPI服务器可访问性
2. 接口ID无效
- 确保接口ID是数字格式
- 检查接口在YAPI中是否存在
- 确认有访问该接口的权限
3. MCP服务器未被识别
- 确保已正确构建项目(
pnpm run build) - 检查配置文件中的路径是否正确
- 重启AI开发工具
许可证
MIT License
贡献
欢迎提交Issue和Pull Request来改进这个项目。
更多信息
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。