Provides an MCP server to access YApi interface documentation by interface ID and via URL.
Configuration
View docs{
"mcpServers": {
"abeixiaolu-yapi-mcp": {
"command": "npx",
"args": [
"-y",
"yapi-mcp-server@latest"
],
"env": {
"YAPI_TOKEN": "your-yapi-token",
"YAPI_BASE_URL": "http://your-yapi-server.com"
}
}
}
}You can run a lightweight MCP server that connects to YApi to fetch interface documentation. This server lets you retrieve interface details by ID and supports parsing YApi URLs to obtain the same information, making it easy to integrate YApi data into your tooling and dashboards.
Use the MCP client to connect to the YApi MCP server and request interface details by ID or via a YApi URL. You can simply provide an interface ID to fetch its details or supply a direct YApi URL to retrieve the corresponding interface information. The server also supports parsing YApi URLs automatically to return the associated interface data.
Direct URL usage example: Please get the information for this interface: http://localhost:40001/project/11/interface/api/23
Tool-based usage example: Please use yapi-get-interface tool to get details for interface ID 789
Prerequisites: Ensure Node.js and npm are installed on your machine.
Step 1: Install and run the MCP server via npx with the latest package.
Step 2: Provide your YApi server URL and an access token to enable authentication.
Step 3: Start using the MCP client to query interface details by ID or by URL.
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "yapi-mcp-server@latest"],
"env": {
"YAPI_BASE_URL": "http://your-yapi-server.com",
"YAPI_TOKEN": "your-yapi-token"
}
}
}
}Environment variables you need to set are YAPI_BASE_URL and YAPI_TOKEN. The token can be obtained by logging in to YApi, opening Profile Settings, and copying the token.
Please use the YApi MCP server with the provided environment values:
YAPI_BASE_URL=http://your-yapi-server.com
YAPI_TOKEN=your-yapi-tokenFetches interface details by ID from the YApi MCP server.
Parses a YApi URL to retrieve interface information via the MCP server.