@wllcyg/yapi-mcp
Click on "Install 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., "@@wllcyg/yapi-mcpsearch yapi interfaces for 'login' and get the first result's detail"
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.
@wllcyg/yapi-mcp
YApi MCP Server(Node.js + MCP SDK),提供按需查询的两个核心工具:
search_yapi_interfacesget_yapi_interface_detail
Token 仅支持 project 级。
group级 URL 不支持鉴权。
1. 安装与构建
npm install
npm run build本地开发:
npm run devRelated MCP server: YApi MCP Server
2. 配置
环境变量
YAPI_BASE_URL(必填)YAPI_TOKEN_FILE(可选,默认~/.yapi-mcp-tokens.json)YAPI_TIMEOUT_MS(可选,默认8000)YAPI_RETRY_COUNT(可选,默认1)YAPI_TOKEN(可选,单项目临时兜底)
Token 文件
路径:~/.yapi-mcp-tokens.json
{
"695": "token_for_project_695",
"703": "token_for_project_703"
}3. MCP 客户端配置示例(Cursor)
{
"mcpServers": {
"yapi": {
"command": "node",
"args": ["D:/self/yapi-mcp/dist/index.js"],
"env": {
"YAPI_BASE_URL": "http://10.255.30.245:3000"
}
}
}
}如果你后续发布 npm 包,也可改为:
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "@wllcyg/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "http://10.255.30.245:3000"
}
}
}
}4. 工具定义
search_yapi_interfaces
输入:
keyword: string(必填)projectId?: numberprojectUrl?: string(如.../project/695/interface/api)method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"pathHint?: stringlimit?: number(默认 10,最大 50)
输出:
匹配接口列表:
interfaceId / name / method / path / projectId / score
get_yapi_interface_detail
输入:
interfaceId: number(必填)projectId?: numberprojectUrl?: stringincludeMock?: boolean(默认 false)
输出:
接口详情(request/response schema,默认不返回 mock)
5. 错误码
INVALID_ARGUMENTPROJECT_ID_REQUIREDPROJECT_TOKEN_REQUIREDTOKEN_SCOPE_UNSUPPORTEDPROJECT_NOT_ACCESSIBLEINTERFACE_NOT_FOUNDUPSTREAM_TIMEOUTUPSTREAM_ERRORRATE_LIMITED
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wllcyg/yapi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server