listInterfaces
Lists the interfaces in the configured YAPI project
Puts one YAPI project's interface definitions in front of an assistant, over SSE, using a project token you already have.
LABSCO SUMMARY
YAPI is usually the place where the API contract actually lives, and the value here is that an assistant can read it directly instead of being pasted a screenshot of it. Two consequences of the design worth knowing before you wire it up: the project is fixed at configuration time, and because it serves SSE the server has to be running before the client connects — this is not a process your client will start for you.
A small MCP server that gives an assistant access to YAPI interface details. It is scoped to one YAPI project — the base URL, token and project ID are fixed in the environment rather than passed per call — and it speaks SSE, so the client connects to a URL instead of spawning a process.
Access to the interface details held in your YAPI instance for the project the token authorises, retrieved live rather than from an export. Because the project is pinned by configuration, the assistant reads that project and nothing else on the instance — running a second project means running a second copy of the server on its own port.
A running YAPI instance plus a project ID and a project token for it. Three values go in a .env file at the project root: YAPI_BASE_URL, YAPI_TOKEN and YAPI_PROJECT_ID. Node.js v14 or higher, and npm or yarn. Clone the repository, run npm install and npm start, then add it to your client as an SSE server at http://localhost:3001/sse — 3001 is the PORT in the repository's .env and the server's default.
Build from source — git clone https://github.com/devilMing/yapi-mcp-server
USE CASES
Let the assistant read the interface definition from your YAPI project directly, so the request and response shapes come from the source of truth rather than from memory.
Pull the interface details for the endpoint you are touching and compare them against what the implementation actually sends.
Point the assistant at the project token for the service you have just been handed, and ask it what the interfaces there do.
Listed in project docs. Your client may show a different list.
listInterfacesLists the interfaces in the configured YAPI project
getInterfaceGets one interface's details by id
getInterfaceByPathGets an interface's details by its path
getInterfaceByNameGets an interface's details by its name
BEFORE YOU INSTALL
4 tools named in the project's documentation.
The documented client runs the server on your machine.
INSTALLATION
git clone https://github.com/devilMing/yapi-mcp-server
cd yapi-mcp-server
npm installCreate a .env file in the root directory with the following variables:
YAPI_BASE_URL=<YOUR_YAPI_BASE_URL>
YAPI_TOKEN=<YOUR_YAPI_TOKEN>
YAPI_PROJECT_ID=<YOUR_YAPI_PROJECT_ID>
PORT=3001Then start the server, and keep it running:
npm start{
"mcpServers": {
"yapi": {
"type": "SSE",
"url": "http://localhost:3001/sse"
}
}
}Keep npm start running. 3001 is the PORT in the repository's .env and the server's default; if you change PORT, change the URL to match.