About Mcp Yapi Server
Mcp Yapi Server connects YApi API documentation to MCP-compatible editors such as Cursor. It lets developers look up interface details and search project APIs, with results available for AI-assisted code and type generation.
Key features
- 01Look up API details from a YApi URL
- 02Show request and response parameters
- 03List project interfaces
- 04Search interfaces by keyword
- 05Support AI-assisted code and type generation
Use cases
- 01Inspect an API from its YApi link
- 02Review endpoint request and response fields
- 03Find project interfaces by keyword
- 04Use API documentation for code generation
MCP support
The MCP server exposes YApi interface lookup, listing, and search capabilities to compatible editors and AI clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEmcp-yapi-server
基于 Model Context Protocol (MCP) 的 YApi 集成服务器,在 Cursor 等支持 MCP 的编辑器中直接查询 YApi API 文档。
✨ 功能特性
- 🔗 直接粘贴 URL - 最简单!粘贴 YApi 链接即可查询
- 🔍 查询接口详情 - 完整的请求/响应参数
- 📋 列出接口 - 查看项目所有接口
- 🔎 搜索接口 - 按关键词搜索
- 🤖 AI 辅助 - 自动生成代码、类型定义等
📦 安装
npm install -g mcp-yapi-server
或作为项目依赖:
npm install mcp-yapi-server
🚀 快速开始
1. 安装
npm install -g mcp-yapi-server
2. 配置 Cursor
在 Cursor 设置中添加 MCP 服务器配置:
推荐方式 - 本地安装:
# 在项目目录中安装
npm install mcp-yapi-server
{
"mcpServers": {
"yapi": {
"command": "node",
"args": ["./node_modules/mcp-yapi-server/dist/index.js"],
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token_here"
}
}
}
}
或全局安装:
npm install -g mcp-yapi-server
{
"mcpServers": {
"yapi": {
"command": "mcp-yapi-server",
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token_here"
}
}
}
}
⚠️ 注意: 不推荐使用
npx方式,因为依赖可能无法正确解析。请使用本地安装或全局安装。
3. 重启 Cursor
4. 开始使用
在 Cursor 中直接粘贴 YApi 链接:
https://yapi.example.com/project/100/interface/api/12345
📚 文档
🔧 常见问题
"No server info found"
原因: Node.js 版本 < 18
解决: nvm install 18 && nvm use 18
"请登录..."
原因: 需要配置 Token
解决: 在 Cursor 配置中设置 YAPI_TOKEN
详见 故障排除文档
🛠 开发
# 克隆项目
git clone https://github.com/TStoneLee/mcp-yapi-server.git
cd mcp-yapi-server
# 安装依赖
npm install
# 开发模式
npm run dev
# 构建
npm run build
📄 许可证
MIT License
🔗 相关链接
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.