@wllcyg/yapi-mcp
Enables searching YApi interfaces by keyword and retrieving detailed interface schemas, including request/response, for project-level tokens.
README
@wllcyg001/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 dev
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", "@wllcyg001/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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.