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 ServerGet the full menu of 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 reading YAPI API documentation. Enables LLM clients (Claude Code, Cursor, etc.) to browse and inspect YAPI project interfaces.
Features
Browse project info, categories, and interfaces
Get full API detail including request/response schemas
Paginated listing with LLM-friendly Markdown output
Token-based authentication via environment variables
Related MCP server: Apidog MCP Server
Requirements
Node.js >= 18.0.0
Installation
From npm
npx @zhuxian/yapi-mcp-serverFrom source
git clone <repo-url>
cd yapi-mcp
npm install
npm run buildConfiguration
The server requires three environment variables:
Variable | Description | Example |
| Your YAPI instance URL |
|
| Cookie token for authentication |
|
| Your YAPI user ID |
|
How to get Token and UID: Open browser DevTools -> Application -> Cookies, find
_yapi_tokenand_yapi_uidvalues.
Usage
Claude Code
Option 1: Using CLI command
# Add to current project
claude mcp add yapi -e YAPI_BASE_URL=https://yapi.example.com -e YAPI_TOKEN=your_token -e YAPI_UID=1828 -- npx -y @zhuxian/yapi-mcp-server
# Add globally (available in all projects)
claude mcp add yapi -s user -e YAPI_BASE_URL=https://yapi.example.com -e YAPI_TOKEN=your_token -e YAPI_UID=1828 -- npx -y @zhuxian/yapi-mcp-serverOption 2: Manual configuration
Add to ~/.claude/settings.json:
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "@zhuxian/yapi-mcp-server"],
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token",
"YAPI_UID": "1828"
}
}
}
}Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"yapi": {
"command": "npx",
"args": ["-y", "@zhuxian/yapi-mcp-server"],
"env": {
"YAPI_BASE_URL": "https://yapi.example.com",
"YAPI_TOKEN": "your_token",
"YAPI_UID": "1828"
}
}
}
}Local Development
YAPI_BASE_URL=https://yapi.example.com YAPI_TOKEN=xxx YAPI_UID=1828 npm run devTools
yapi_get_project
Get project basic information including name, description, base path, and environment configurations.
Parameters:
Name | Type | Required | Description |
| number | Yes | The YAPI project ID |
yapi_get_cat_menu
Get the list of interface categories (folders) for a project.
Parameters:
Name | Type | Required | Description |
| number | Yes | The YAPI project ID |
yapi_list_interfaces
List interfaces in a project with pagination.
Parameters:
Name | Type | Required | Description |
| number | Yes | The YAPI project ID |
| number | No | Page number (default: 1) |
| number | No | Items per page, max 100 (default: 20) |
yapi_list_by_category
List interfaces belonging to a specific category with pagination.
Parameters:
Name | Type | Required | Description |
| number | Yes | Category ID (from |
| number | No | Page number (default: 1) |
| number | No | Items per page, max 100 (default: 20) |
yapi_get_interface
Get complete details of a single API interface including request parameters, headers, body schema, and response schema.
Parameters:
Name | Type | Required | Description |
| number | Yes | The interface ID |
yapi_get_full_menu
Get all interfaces grouped by category. Returns the complete hierarchy for the project.
Note: May return large payloads for projects with many interfaces.
Parameters:
Name | Type | Required | Description |
| number | Yes | The YAPI project ID |
yapi_get_by_url
Parse a YAPI page URL and fetch the corresponding data automatically.
Parameters:
Name | Type | Required | Description |
| string | Yes | Full YAPI page URL |
Supported URL formats:
/project/{id}/interface/api- Project overview/project/{id}/interface/api/{interfaceId}- Interface detail/project/{id}/interface/api/cat_{catId}- Category listing
Typical Workflow
A recommended sequence when exploring a YAPI project:
1. yapi_get_project → Understand the project
2. yapi_get_cat_menu → See category structure
3. yapi_list_by_category → Browse interfaces in a category
4. yapi_get_interface → Get full detail for a specific APIOr simply use yapi_get_by_url with a YAPI page URL.
Scripts
Script | Description |
| Compile with SWC + generate type declarations |
| Watch mode compilation |
| Run the compiled server |
| Run directly with |
| Type check without emitting |
License
MIT
Available Tools
7 toolsyapi_get_by_urlGet YAPI Data by URLA
Parse a YAPI page URL and fetch the corresponding data automatically. Supports project URLs (/project/{id}/interface/api), interface URLs (/project/{id}/interface/api/{interfaceId}), and category URLs (/project/{id}/interface/api/cat_{catId}).
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Full YAPI page URL, e.g. http://yapi.example.com/project/1/interface/api/100 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses supported URL patterns and the automatic fetch behavior, but lacks details on error handling, idempotency, permission requirements, or rate limits. For a fetch tool, this is minimal but acceptable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence that states the purpose and then lists the supported patterns. Every sentence is necessary, and no extra words are used.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given one required parameter, no output schema, and no annotations, the description covers the essential: what URLs work. It could mention fallback behavior or error responses, but for a simple fetch tool, it is reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds significant context by specifying the exact URL formats and examples (e.g., project, interface, category URLs). This goes beyond the schema's generic 'Full YAPI page URL' description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it parses a YAPI page URL and fetches corresponding data automatically, and enumerates three specific URL patterns it supports (project, interface, category). This differentiates it from sibling tools like yapi_get_project or yapi_get_interface, which require specific IDs rather than URLs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when a YAPI page URL is available, but it does not explicitly state when to prefer this tool over alternatives like yapi_get_project or yapi_get_interface. There is no mention of when NOT to use it or any prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yapi_get_interfaceGet YAPI Interface DetailA
Get complete details of a single API interface including request parameters (headers, query, body), response body schema, description, and status.
| Name | Required | Description | Default |
|---|---|---|---|
| interface_id | Yes | The interface ID to retrieve details for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It accurately describes the tool as a read operation returning detailed interface data. However, it does not disclose potential side effects, authentication requirements, or rate limits, though for a simple get operation this is acceptable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that immediately conveys the tool's purpose and included components. It is concise with no extraneous information, earning its place without waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one required parameter, no output schema), the description covers the essential functionality. It explains what the tool returns and is mostly self-contained. However, it does not address differences from sibling tool yapi_get_by_url, which might retrieve similar details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the single parameter 'interface_id' well-documented in the schema. The description adds contextual value by specifying what details are returned, but does not provide additional parameter-level semantics beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it retrieves complete details of a single API interface, listing specific components like request parameters and response schema. It distinguishes from sibling tools such as yapi_list_interfaces (listing) and yapi_get_by_url (by URL) by focusing on a single interface by ID.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like yapi_get_by_url or yapi_list_interfaces. It does not mention prerequisites, limitations, or exclusion criteria, leaving the agent to infer usage solely from the description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yapi_get_projectGet YAPI Project InfoB
Get project basic information including name, description, base URL, and environment configurations.
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The YAPI project ID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description should disclose behavioral traits. It implies a read operation but does not mention auth needs, rate limits, or error handling. Minimal disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no filler, front-loaded with purpose. Efficiently communicates the tool's function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a simple retrieval tool with one parameter. Lacks details on prerequisites, error conditions, or expected behavior for invalid inputs.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already describes the single parameter with 100% coverage. Description adds no extra meaning beyond the schema; lists return fields but that is not parameter-specific.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool retrieves project basic information, listing specific data fields. It distinguishes from siblings by the resource (project info) but does not explicitly differentiate from other yapi tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like yapi_get_by_url or yapi_get_full_menu. The description lacks usage context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yapi_list_by_categoryList Interfaces by CategoryB
List interfaces belonging to a specific category with pagination.
| Name | Required | Description | Default |
|---|---|---|---|
| cat_id | Yes | The category ID (obtained from yapi_get_cat_menu) | |
| page | No | Page number (default: 1) | |
| limit | No | Items per page, max 100 (default: 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It mentions pagination, which is a useful behavioral clue, but does not disclose whether the operation is read-only, requires authentication, or has any rate limits or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that conveys the essential purpose without extraneous words. It is appropriately front-loaded and concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description should ideally explain the return format, which it does not. It adequately describes the input and basic behavior (pagination) but lacks context on the response structure or edge cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, so baseline is 3. The description only adds 'with pagination', which loosely relates to page and limit parameters but provides no additional semantics beyond what the schema already specifies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'List' and resource 'interfaces belonging to a specific category with pagination', making the core function clear. However, it does not differentiate from the sibling tool 'yapi_list_interfaces', which likely lists all interfaces without category filter.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for listing interfaces in a specific category, but it does not explicitly state when to use this tool versus alternatives like 'yapi_list_interfaces' or 'yapi_get_interface'. No guidance on when not to use it is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yapi_list_interfacesList YAPI InterfacesB
List interfaces in a project with pagination. Returns basic info (ID, title, path, method, status) for each interface.
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The YAPI project ID | |
| page | No | Page number (default: 1) | |
| limit | No | Items per page, max 100 (default: 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, description bears full burden. It states it returns basic info but does not disclose behavioral traits like read-only nature, authentication needs, error behavior, or pagination behavior (e.g., max pages, order).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise, front-loaded sentences. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and 3 simple params, description covers basic return info. Lacks mention of how to obtain project_id (e.g., from yapi_get_project) and default sort order, but is largely sufficient for a listing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers all parameters with descriptions (100% coverage). Description adds context about return fields but does not meaningfully enhance parameter understanding beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb (List), resource (interfaces in a project), and key features (pagination). It distinguishes from siblings like yapi_get_interface (single interface) and yapi_list_by_category (by category).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., yapi_get_interface for a single interface, yapi_list_by_category for categorized listing). No exclusions or prerequisites mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a clearly distinct purpose: URL parsing, category listing, full hierarchy, single interface details, project info, listing by category, and general listing. No overlap.
All tools follow the pattern 'yapi_<verb>_<noun>', but 'yapi_get_by_url' deviates slightly from the direct resource naming of others (e.g., 'yapi_get_interface'). Overall consistent.
7 tools is well-scoped for a read-only API documentation server, covering project info, categories, full hierarchy, interface details, and multiple listing methods.
The surface covers core read operations; missing search by method/status or interface modification is acceptable for a read-only server. Minor gaps in filtering.
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 Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
@latest documentation and code examples to 9000+ libraries for LLMs and AI code editors in a singl…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables reading and searching API documentation from YApi instances, allowing AI models to access interface definitions, project API lists, and search through API endpoints using YApi URLs or project IDs.15MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI tools to search and explore API documentation from Apidog projects or OpenAPI/Swagger specifications, providing endpoint details, schemas, and project statistics through natural language queries.1,2361ISC
- AlicenseNot gradedqualityDmaintenanceEnables interaction with YApi API management platform through natural language, allowing automated interface management including creating/updating APIs, managing categories, importing data, and retrieving project information.299GPL 3.0
- AlicenseCqualityDmaintenanceEnables AI assistants to manage YAPI API documentation by providing tools to create, update, and retrieve interface details. It also supports running automated tests and managing API data across multiple configured projects.1119MIT
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/AlwaysLoveme/yapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server