YAPI MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YAPI MCP Server list all API interfaces for project 123"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YAPI MCP Server
一个用于 YAPI 接口管理平台的 MCP (Model Context Protocol) 服务器,支持查询项目、接口列表、接口分类、接口详情,以及新增和修改接口等功能。
功能特性
🔍 项目查询 - 获取项目信息和项目列表
📂 分类管理 - 查询接口分类、新增分类
📋 接口管理 - 查询接口列表、接口详情、新增接口、修改接口
🔐 Cookie 认证 - 通过邮箱密码登录自动获取认证
Related MCP server: yapi-mcp-server
安装
# 克隆项目
git clone https://github.com/W-Abel-jia/yapi-interface-mcp.git
cd yapi-interface-mcp
# 安装依赖
npm install
# 构建
npm run build配置
方式一:配置文件(推荐)
在项目根目录创建 yapi-interface-mcp.config.json 文件:
{
"baseUrl": "http://your-yapi-server:3000",
"email": "your-email@example.com",
"password": "your-password"
}方式二:环境变量
环境变量 | 说明 | 必填 |
| YAPI 服务器地址 | ✅ |
| 登录邮箱 | ✅ |
| 登录密码 | ✅ |
使用方式
在 Claude Desktop 中使用
编辑 Claude Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"yapi": {
"command": "node",
"args": ["/path/to/yapi-interface-mcp/dist/index.js"],
"env": {
"YAPI_BASE_URL": "http://your-yapi-server:3000",
"YAPI_EMAIL": "your-email@example.com",
"YAPI_PASSWORD": "your-password"
}
}
}
}重启 Claude Desktop 即可使用。
在其他 MCP 客户端中使用
如 Cursor、Windsurf、Cline 等,参考各客户端的 MCP 配置方式:
命令:
node /path/to/yapi-interface-mcp/dist/index.js环境变量: 配置
YAPI_BASE_URL和认证信息
使用 MCP Inspector 测试
cd yapi-interface-mcp
npx @modelcontextprotocol/inspector node dist/index.js支持的工具
工具名称 | 功能描述 | 必需参数 |
| 获取项目信息 |
|
| 获取项目列表 | - |
| 获取项目的接口分类列表 |
|
| 获取指定分类下的接口列表 |
|
| 获取项目的所有接口列表 |
|
| 获取接口详情 |
|
| 新增接口 |
|
| 修改接口 |
|
| 新增分类 |
|
工具参数说明
yapi-get-project
projectId: number - 项目IDyapi-get-categories
projectId: number - 项目IDyapi-get-interfaces-by-category
catid: number - 分类IDyapi-get-interfaces
projectId: number - 项目IDyapi-get-interface
id: string - 接口ID(数字格式)yapi-create-interface
title: string - 接口标题
path: string - 接口路径,如 /api/user
method: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "PATCH"
catid: number - 分类ID
desc?: string - 接口描述
status?: "done" | "designing" | "dev" | "undone"
req_body_type?: "form" | "json" | "file" | "raw" | "text"
req_body_other?: string - 请求体 JSON Schema
req_body_form?: Array<{name, type, required, desc}>
req_headers?: Array<{name, value?, required, desc?}>
req_params?: Array<{name, desc?}>
req_query?: Array<{name, required, desc?}>
res_body_type?: "json" | "raw" | "text"
res_body?: string - 响应体 JSON Schemayapi-update-interface
id: number - 接口ID
...其他参数同 yapi-create-interface(均为可选)yapi-create-category
name: string - 分类名称
project_id: number - 项目ID
desc?: string - 分类描述开发
# 安装依赖
npm install
# 开发模式(监听文件变化)
npm run dev
# 构建
npm run build
# 运行
npm start注意事项
安全性 - 配置文件
yapi-interface-mcp.config.json包含敏感信息,请勿提交到版本控制系统。已添加到.gitignore。网络访问 - 确保 MCP 服务器能够访问 YAPI 服务器。
License
MIT
Available Tools
9 toolsyapi-create-categoryC
新增 YAPI 接口分类
Inputs: name (required), project_id (required), desc.
yapi-create-interfaceD
新增 YAPI 接口
Inputs: title (required), path (required), method (required), catid (required), +10 more.
yapi-get-categoriesC
获取项目的接口分类列表
Inputs: projectId (required).
yapi-get-interfaceB
获取接口详情,支持格式:数字ID
Inputs: id (required).
yapi-get-interfacesB
获取项目的所有接口列表
Inputs: projectId (required).
yapi-get-interfaces-by-categoryC
获取指定分类下的接口列表
Inputs: catid (required).
yapi-get-projectC
获取 YAPI 项目信息
Inputs: projectId (required).
yapi-get-project-listB
获取 YAPI 项目列表
Inputs: no named parameters.
yapi-update-interfaceC
修改 YAPI 接口
Inputs: id (required), title, path, method, +11 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Every tool has a clearly distinct purpose with no ambiguity. The tools are organized around specific resources (categories, interfaces, projects) and actions (create, get, update), making it easy for an agent to select the right tool. For example, yapi-get-interfaces and yapi-get-interfaces-by-category serve different but complementary purposes without overlap.
All tool names follow a consistent pattern: 'yapi-' prefix, followed by a verb (create, get, update), then a noun (category, interface, project). This predictable structure enhances readability and makes the tool set easy to navigate. There are no deviations in naming conventions across the nine tools.
With 9 tools, the server is well-scoped for managing YAPI resources. Each tool earns its place by covering essential operations like listing, creating, and updating interfaces and categories, as well as retrieving project information. This count is appropriate for the domain without being overwhelming or insufficient.
The tool set provides strong coverage for core CRUD operations on interfaces and categories, and project listing. However, there are minor gaps, such as missing update and delete operations for categories and projects, which agents might need to work around. Overall, it supports key workflows but isn't fully comprehensive.
Maintenance
Related MCP Connectors
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for AI access to Swagger by SmartBear.
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for the YApi platform that allows AI assistants to search, create, and manage API documentation directly within tools like Cursor. It supports multi-project management and seamless integration into AI-driven programming workflows for interface maintenance.151 npm124MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables fetching YApi interface details via a tool, allowing AI assistants to generate API code based on YApi documentation.41 npmISC
- AlicenseNot gradedqualityDmaintenanceMCP server for YApi that enables LLMs to manage API interfaces, projects, and categories through natural language, supporting multiple projects and path fuzzy matching.14 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for YApi that enables developers to search, view, create, and update API definitions directly from MCP-compatible IDEs.2MIT