Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yxfan-dev/yapi-mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
YApi MCP Server
A Model Context Protocol server for YApi integration
This is a TypeScript-based MCP server that provides integration with YApi (YAML API) platform. It allows Claude and other AI assistants to interact with YApi through the Model Context Protocol.
Features
Tools
get_interface_detail
- 获取YApi接口详情- 接受接口ID作为参数
- 返回接口的详细信息
get_project_list
- 获取YApi项目列表- 可选参数:分组ID、页码、每页数量
- 返回项目列表信息
get_category_list
- 获取YApi分类列表- 接受项目ID作为参数
- 返回分类列表信息
get_follow_list
- 获取用户关注的信息列表- 不需要参数
- 返回用户关注的信息列表
get_interfaces_by_project_and_tag
- 根据项目ID和标签查询接口的详细信息- 接受项目ID和标签作为参数
- 返回符合条件的接口详细信息
安装
从NPM安装
npm install -g yapi-mcp-server
手动安装
克隆仓库并安装依赖:
git clone https://github.com/yourusername/yapi-mcp-server.git
cd yapi-mcp-server
npm install
npm run build
配置
要使用YApi MCP服务器,您需要配置以下环境变量:
YAPI_BASE_URL
: YApi服务器的基础URLYAPI_USERNAME
: YApi用户名YAPI_PASSWORD
: YApi密码
使用方法
与Claude Desktop集成
在Claude Desktop配置文件中添加服务器配置:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"yapi-server": {
"command": "yapi-mcp-server",
"env": {
"YAPI_BASE_URL": "http://your-yapi-server-url",
"YAPI_USERNAME": "your-username",
"YAPI_PASSWORD": "your-password"
}
}
}
}
与Claude VSCode扩展集成
在VSCode设置中添加服务器配置:
{
"mcpServers": {
"yapi-server": {
"command": "yapi-mcp-server",
"env": {
"YAPI_BASE_URL": "http://your-yapi-server-url",
"YAPI_USERNAME": "your-username",
"YAPI_PASSWORD": "your-password"
}
}
}
}
开发
安装依赖:
npm install
构建服务器:
npm run build
开发模式(自动重新构建):
npm run watch
调试
由于MCP服务器通过stdio通信,调试可能比较困难。我们建议使用MCP Inspector:
npm run inspector
Inspector将提供一个URL,您可以在浏览器中访问调试工具。