- Home
- MCP servers
- YApi
YApi
- javascript
0
GitHub Stars
javascript
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"tstonelee-mcp-yapi-server": {
"command": "node",
"args": [
"./node_modules/mcp-yapi-server/dist/index.js"
],
"env": {
"YAPI_TOKEN": "your_token_here",
"YAPI_BASE_URL": "https://yapi.example.com"
}
}
}
}This MCP server provides a direct bridge to YApi API documentation inside editors that support the Model Context Protocol. By running a local service or a global command, you can query, list, and search YApi interfaces from within your MCP-enabled editor, making it easier to explore API structures and generate code or types on the fly.
How to use
Install and run the MCP server, then configure your MCP client (Cursor) to point at the local or globally installed command. In your editor, paste a YApi URL to query interface details, view full request/response parameters, list interfaces for a project, or search interfaces by keyword. You can also leverage AI-assisted features to generate code and type definitions from the API data.
How to install
Prerequisites: Node.js installed on your system. You will also need npm to install and manage packages.
# Install as a global MCP server
npm install -g mcp-yapi-server
# Or install as a project dependency
npm install mcp-yapi-server
Configuration for Cursor
Choose one of the following MCP server configurations and place it in your Cursor MCP settings.
{
"mcpServers": {
"yapi": {
"command": "node",
"args": ["./node_modules/mcp-yapi-server/dist/index.js"],
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token_here"
}
}
}
}
Additional configuration (global install)
If you install the server globally, you can configure Cursor to start it with the global command.
{
"mcpServers": {
"yapi": {
"command": "mcp-yapi-server",
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token_here"
}
}
}
}
Notes on installation modes
Do not rely on npx for running the server in Cursor configurations, as dependencies may not resolve reliably. Prefer a local installation in your project or a global installation.
Troubleshooting
Common issues include token authentication failures and incorrect base URLs. Ensure your YAPI_BASE_URL is reachable and that YAPI_TOKEN is set to a valid token for your YApi instance.
Development and build
If you want to contribute or modify the server, clone the project, install dependencies, and run the development workflow.
# Clone and install
git clone https://github.com/TStoneLee/mcp-yapi-server.git
cd mcp-yapi-server
npm install
# Development mode
npm run dev
# Build
npm run build
Available tools
queryInterfaceDetails
Fetches full details for a specific API interface, including request and response parameters.
listInterfaces
Lists all interfaces within a project or category, enabling quick browsing of available endpoints.
searchInterfaces
Search interfaces by keyword to quickly locate relevant API endpoints.
aiAssistCode
AI-assisted generation of code snippets or type definitions from the queried API data.