MCP Server for YAPI API Platform Integration
npm install criller-yapi-mcp-serverA Model Context Protocol (MCP) server for YAPI API Platform integration. Enable AI assistants to interact with YAPI seamlessly.
1. Get your YAPI Token: Login to your YAPI platform and get the token from project settings
2. Configure Claude Desktop: Add the following to your MCP settings file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
``json`
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": [
"-y",
"criller-yapi-mcp-server",
"--yapi-base-url=http://your-yapi-server.com",
"--yapi-token=your-token-here"
]
}
}
}
3. Start using: Restart Claude Desktop and you're ready to go!
This MCP server provides 11 tools covering all YAPI Open APIs:
- Get project information$3
- yapi_add_category - Add interface category
- yapi_get_category_menu - Get category menu list$3
- yapi_get_interface - Get interface details
- yapi_list_interfaces_by_cat - List interfaces by category
- yapi_add_interface - Add new interface
- yapi_update_interface - Update interface
- yapi_get_interface_list - Get interface list
- yapi_update_interface_basic - Update interface basic info
- yapi_get_interface_cat_list - Get interface menu tree$3
- yapi_import_data - Import data (Swagger, HAR, Postman, etc.)π Usage Examples
Once configured, you can interact with YAPI using natural language:
- "Show me the details of project 123"
- "List all categories in project 456"
- "Get the interface with ID 789"
- "Add a new category called 'User Management' to project 123"
- "Import this Swagger file to project 456"
π§ Alternative Configuration Methods
$3
`json
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "criller-yapi-mcp-server"],
"env": {
"YAPI_BASE_URL": "http://your-yapi-server.com",
"YAPI_TOKEN": "your-token-here"
}
}
}
}
`$3
For development or debugging:
`bash
git clone https://github.com/criller/yapi-mcp-server.git
cd yapi-mcp-server
npm install
cp .env.example .env
Edit .env and set your YAPI_BASE_URL and YAPI_TOKEN
npm run dev
`Then configure Claude Desktop:
`json
{
"mcpServers": {
"yapi": {
"command": "node",
"args": ["/absolute/path/to/yapi-mcp-server/dist/index.js"],
"env": {
"YAPI_BASE_URL": "http://your-yapi-server.com",
"YAPI_TOKEN": "your-token"
}
}
}
}
`π οΈ Development
$3
`bash
npm run typecheck
`$3
`bash
npm run build
`$3
`bash
npx @modelcontextprotocol/inspector npx -y criller-yapi-mcp-server
`π Project Structure
`
yapi-mcp-server/
βββ src/
β βββ index.ts # MCP Server entry point
β βββ config.ts # Configuration management
β βββ types.ts # TypeScript types
β βββ yapi-client.ts # YAPI API client
β βββ tools/ # MCP tools
β βββ project-tools.ts # Project management
β βββ category-tools.ts # Category management
β βββ interface-tools.ts# Interface management
β βββ import-tools.ts # Data import
βββ package.json
βββ tsconfig.json
βββ README.md
``Contributions are welcome! Please check CONTRIBUTING.md for details.
MIT