YAPI MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YAPI MCP Serverfind the login interface in project 42"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
YAPI MCP Server
A Model Context Protocol (MCP) server for interacting with a YAPI instance. This server enables LLMs to retrieve API documentation details from your YAPI projects.
This release uses the MCP 2026-07-28 protocol over stdio. Legacy MCP initialization is intentionally not supported.
Features
List Interfaces: Get all interface categories and basic interface info within a project
List Project Interfaces: Page through a flat project interface list without loading the whole project
List Category Interfaces: Page through interfaces for a category ID from a YAPI
/cat_<id>URLGet Interface Details: Retrieve detailed information for a specific interface by its ID
Get Interface Details Batch: Retrieve up to 10 interface details with bounded concurrency and per-ID errors
Search Interfaces: Search for interfaces by keyword in titles or paths
Runtime Response Validation: Reject malformed YAPI envelopes and tool payloads without exposing response values or request URLs
Related MCP server: Swagger/OpenAPI MCP Server
Tools
Every tool advertises an MCP output schema. Successful text content is the JSON serialization of the same validated structured result.
yapi_list_interfaces
Lists all interface categories and the interfaces within them for a specific YAPI project.
Input:
project_id(optional): Numeric project ID. Not required ifYAPI_PROJECT_IDis set.limit(optional, default100): Maximum interfaces to return; allowed range is1to500.
Returns: A structured object containing categories, including category_id, with simplified interface objects (id, category_id, title, path, method, status), return counts, and truncation metadata.
yapi_list_category_interfaces
Lists one page of interfaces for a category ID without loading every interface in the project.
Input:
category_id(positive integer, required): The numeric ID from a YAPI/cat_<id>URL.page(optional, default1): One-based page number.limit(optional, default100): Page size; allowed range is1to500.
Returns: Interface summaries plus returned, total, and total_pages pagination metadata.
yapi_list_project_interfaces
Lists exactly one server-paginated page of interfaces for a project.
Input:
project_id(optional): Numeric project ID. Not required ifYAPI_PROJECT_IDis set.page(optional, default1): One-based page number.limit(optional, default100): Page size; allowed range is1to500.
Returns: A flat interface page with project_id, page, limit, returned, total, and total_pages metadata.
yapi_get_interface_details
Gets detailed information for a specific YAPI interface by its ID.
Input:
project_id(optional): Numeric project ID. Not required ifYAPI_PROJECT_IDis set.interface_id(number, required): The ID of the specific YAPI interface.
Returns: A structured object whose interface field contains the full interface specification (request/response parameters, headers, body schemas, etc.).
yapi_get_interface_details_batch
Gets details for a bounded set of known interface IDs while preserving input order. Requests run with a fixed concurrency limit of 3, and one failed ID does not discard successful entries.
Input:
project_id(optional): Numeric project ID. Not required ifYAPI_PROJECT_IDis set.interface_ids(array, required): Between 1 and 10 unique positive integer interface IDs.
Returns: A structured object with ordered per-ID results, requested, succeeded, and failed counts. Each result contains either success: true with interface, or success: false with a credential-safe error.
yapi_search_interfaces
Searches for interfaces by keyword in their titles or paths using bounded server-paginated scanning.
Input:
project_id(optional): Numeric project ID. Not required ifYAPI_PROJECT_IDis set.keyword(string, required): The keyword to search for.limit(optional, default100): Maximum matches to return; allowed range is1to500.max_scan_pages(optional, default10): Maximum YAPI pages to scan; allowed range is1to100.
Returns: Matching interfaces (including category_id when supplied by YAPI) plus pages_scanned, interfaces_scanned, project pagination totals, and truncation metadata. total is the number of matches found in the scanned pages. truncated_reason is match_limit, max_scan_pages, or null after a complete scan.
Prerequisites
A running YAPI instance
Access to the project token(s) for the YAPI projects you want to interact with (found in YAPI project "Settings" -> "Tokens")
Node.js 22+ installed
Environment Variables
Variable | Required | Description |
| Yes | Base URL of your YAPI instance (e.g., |
| Yes | Project credential. It is read only from the process environment and never accepted as tool input |
| No | Default numeric project ID. Tool calls may override it with |
| No | HTTP timeout in milliseconds ( |
Installation & Configuration
Build from Source
git clone <this-repo>
cd yapi-mcp-server
npm install
npm run buildLocal Development (npm link)
For local development, use npm link to create a global symlink:
cd yapi-mcp-server
npm linkThis makes mcp-server-yapi command available globally, avoiding hardcoded paths.
Claude Desktop
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %AppData%\Claude\claude_desktop_config.json
{
"mcpServers": {
"yapi": {
"command": "mcp-server-yapi",
"env": {
"YAPI_URL": "<your-yapi-url>",
"YAPI_PROJECT_TOKEN": "<your-project-token>"
}
}
}
}Claude Code (CLI)
Use the claude mcp command to add the server:
# Add to user config (available in all projects)
claude mcp add-json yapi -s user '{
"type": "stdio",
"command": "mcp-server-yapi",
"env": {
"YAPI_URL": "<your-yapi-url>",
"YAPI_PROJECT_TOKEN": "<your-project-token>"
}
}'
# Or add to project config (only for current project)
claude mcp add-json yapi -s project '{
"type": "stdio",
"command": "mcp-server-yapi",
"env": {
"YAPI_URL": "<your-yapi-url>",
"YAPI_PROJECT_TOKEN": "<your-project-token>"
}
}'
# Verify the configuration
claude mcp list
claude mcp get yapiCursor IDE
Add to your Cursor MCP settings:
macOS: ~/.cursor/mcp.json
Windows: %USERPROFILE%\.cursor\mcp.json
{
"mcpServers": {
"yapi": {
"command": "mcp-server-yapi",
"env": {
"YAPI_URL": "<your-yapi-url>",
"YAPI_PROJECT_TOKEN": "<your-project-token>"
}
}
}
}Using npx (Recommended for distribution)
Version 0.8.0 requires an MCP 2026-07-28 client:
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "@zjlgdx/yapi-mcp-server@0.8.0"],
"env": {
"YAPI_URL": "<your-yapi-url>",
"YAPI_PROJECT_TOKEN": "<your-project-token>"
}
}
}
}Usage Examples
Once configured, you can ask Claude to:
"List all APIs in my YAPI project"
"List interfaces from YAPI category URL .../cat_114557"
"Get details for interface ID 12345"
"Search for APIs related to 'user' in my project"
"Show me all POST endpoints"
Troubleshooting
Server not starting
Ensure Node.js 22+ is installed
Verify the path to
dist/index.jsis correctCheck that
YAPI_URLis set and accessible
Authentication errors
Verify your
YAPI_PROJECT_TOKENis correctCheck token permissions in YAPI project settings
Network errors
Ensure your YAPI instance is accessible from your machine
Check firewall settings if using internal network
Development
# Install dependencies
npm install
# Build
npm run build
# Build and run the MCP 2026-07-28 stdio smoke tests
npm test
# Watch mode
npm run watch
# Run directly (requires env vars)
YAPI_URL=http://yapi.example.com YAPI_PROJECT_TOKEN=xxx npm startThe server is read-only: all exposed tools use YAPI GET endpoints and are advertised with MCP read-only annotations. Diagnostic output is written only to stderr; stdout is reserved for MCP messages.
Publishing
The npm package is @zjlgdx/yapi-mcp-server. The unscoped mcp-server-yapi package belongs to an unrelated publisher and must never be used as this repository's release target.
After the one-time bootstrap below, publishing is performed only by .github/workflows/publish.yml when a stable GitHub Release is published. The release tag must be v<package.json version>, point to a commit on main, and pass the same build, test, audit, and package-content gates used by CI. The workflow uses npm Trusted Publishing through GitHub OIDC; do not add an NPM_TOKEN secret or use manual publishing as a fallback.
Because npm requires a package to exist before Trusted Publishing can be configured, the owner of the npm zjlgdx user or organization scope must perform a one-time bootstrap with an npm account protected by 2FA:
Confirm that the authenticated npm account owns the
@zjlgdxscope.From a temporary clean copy of an exact, verified
maincommit, set a disposable prerelease version such as0.0.0-bootstrap.0without committing it, then runnpm publish --access public --tag bootstrap. Do not manually publish a stable release version.Immediately configure Trusted Publishing on the new package with these exact values:
Publisher: GitHub Actions
Organization or user:
zjlgdxRepository:
yapi-mcp-serverWorkflow filename:
publish.ymlEnvironment:
npmAllowed action:
npm publish
Set package publishing access to require 2FA and disallow traditional tokens.
The bootstrap prerelease is the only manual publish. Every stable version must use the release workflow. The GitHub npm environment must allow only tags matching v*. Enable required reviewers when a reviewer distinct from the releaser is available. Trusted Publishing requires a public GitHub-hosted runner and automatically generates npm provenance for this public package.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.76089MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables LLMs to explore and interact with API specifications by providing tools for loading, browsing, and getting detailed information about API endpoints.41214ISC
- AlicenseBqualityDmaintenanceA Model Context Protocol server that allows AI development tools like Cursor and Claude Desktop to retrieve detailed YAPI interface information by interface ID.189MIT
- Alicense-qualityDmaintenanceMCP server for YApi that enables LLMs to manage API interfaces, projects, and categories through natural language, supporting multiple projects and path fuzzy matching.6GPL 3.0
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
MCP (Model Context Protocol) server for Appwrite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zjlgdx/yapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server