yapi-mcp
The yapi-mcp server provides YApi API management capabilities, allowing you to browse, search, and manage API definitions stored in a YApi instance.
List Projects (
yapi_list_projects): Retrieve the configured YApi project's ID, name, and description. No parameters required.Get Categories (
yapi_get_categories): Fetch all interface categories within a project, along with a summary of APIs grouped under each category.Search APIs (
yapi_search_apis): Search for APIs within a project by keyword (matched against title or path), with an optional filter by HTTP method (GET, POST, PUT, DELETE, PATCH).Get API Details (
yapi_get_api_details): Retrieve full details of a specific API by its ID, including request parameters, headers, request body type/structure, and response body.Create or Update APIs (
yapi_save_api): Create a new API or update an existing one. Providing anapi_idtriggers an update; omitting it creates a new API. Supports setting the path, title, description, method, category, query parameters, request headers, request body type/structure, and response body schema.
Click on "Deploy 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 list all my projects"
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
English | 中文
A zero-dependency YApi MCP server that exposes YApi's API-management capabilities to Claude Code and any MCP client.
Why this exists
The npm package @yogeliu/yapi-mcp-server has two defects that make it completely unusable:
Broken
inputSchemaserialization — it returns the Zod schema object itself asinputSchema. AfterJSON.stringifyit becomes{"_def":...}, an invalid structure. MCP clients reject it withtools fetch failed, so none of the tools ever load.Wrong interface-list strategy — YApi's
/api/interface/listignorescatidon most versions and returns only the first page by default. The original package's "iterate categories" approach causes massive duplication and misses most interfaces; it also reads the wrong id field (_id).
This project is rewritten from scratch with zero runtime dependencies (only Node ≥18 built-in fetch), hand-written valid JSON Schemas, and project-level pagination with dedup — fixing all of the above.
Related MCP server: YAPI MCP Server
Tools
Tool | Description |
| List the configured project (id / name / desc) |
| List project categories and the APIs under each |
| Search APIs by keyword (title / path), optional method filter |
| Full detail of one API (params / headers / body / response) |
| Create or update an API (with |
Install
Option 1: npx (recommended)
No install needed — use it directly in your MCP config:
{ "command": "npx", "args": ["-y", "@hizml/yapi-mcp"] }Option 2: clone
git clone https://github.com/hizml/yapi-mcp.gitPoint the config at the local file:
{ "command": "node", "args": ["/absolute/path/to/yapi-mcp/yapi-mcp.mjs"] }Configuration
Two environment variables:
YAPI_BASE_URL— YApi host, e.g.http://yapi.example.comYAPI_TOKEN— formatprojectId:tokenValue, from the YApi project "Settings → token"
Claude Code (~/.claude.json)
{
"mcpServers": {
"yapi": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@hizml/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "http://your-yapi-host",
"YAPI_TOKEN": "227:your_token_here"
}
}
}
}Full example: examples/claude-code-config.json.
Features
Zero dependencies — pure Node ESM, only Node ≥18 built-in
fetchValid JSON Schema — every
inputSchemais hand-written standard JSON Schema, so clients validate it fineFull pagination — project-level pagination + dedup, no missing or duplicate APIs
Robust errors — param errors, timeouts, and YApi
errcodeall becomeisErrormessages; the process never crashesDebuggable — set
DEBUG=1to emit logs to stderr
Known limitations
Currently single-token (single-project); for multiple projects, run multiple instances
YApi's
/api/interface/listtotalfield is unreliable, so this tool stops paginating when a page returns fewer than the page size
License
MIT
Available Tools
5 toolsyapi_get_api_detailsA
获取接口详细信息(请求参数、请求头、请求体类型与结构、响应体等)。
Inputs: api_id (required).
yapi_get_categoriesB
获取指定项目的接口分类列表(分类 ID、名称,以及每个分类下的接口概要)。
Inputs: project_id (required).
yapi_list_projectsA
列出当前 token 配置的 YApi 项目信息(项目 ID、名称、描述)。无参数。
Inputs: no named parameters.
yapi_save_apiA
创建或更新 YApi 接口。带 api_id 走更新(/api/interface/up),不带走创建(/api/interface/add)。至少需提供 project_id 与 catid。
Inputs: catid (required), project_id (required), desc, path, +8 more.
yapi_search_apisA
在项目内按关键词搜索接口(匹配 title/path,可选按 method 过滤),返回接口列表。
Inputs: query (required), method, project_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct operation: listing projects, retrieving categories, getting API details, saving APIs, and searching. There is no functional overlap; an agent can clearly distinguish them.
All tools follow a consistent 'yapi_verb_noun' pattern using snake_case, with clear and descriptive verbs (get, list, save, search). No mixing of conventions.
Five tools is well-scoped for a YApi integration, covering the core interactions: project listing, category browsing, API details, creation/updating, and searching. Not excessive or insufficient.
Core CRUD and search are present, but a delete API tool is missing, which could be a gap for lifecycle management. However, the main workflows (discover, read, create/update) are covered.
Related MCP Connectors
Discover and call 10,000+ production APIs from one MCP server. Pay-per-call billing for AI agents.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- 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.30 npm9GPL 3.0
- AlicenseBqualityDmaintenanceAn MCP server for the YAPI interface management platform that enables users to manage projects, categories, and API interfaces. It supports querying project details, listing interfaces, and creating or modifying API documentation through natural language.913 npm3MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for YApi that enables LLMs to manage API interfaces, projects, and categories through natural language, supporting multiple projects and path fuzzy matching.15 npmGPL 3.0
- AlicenseBqualityFmaintenanceEnables AI tools to search, create, update, and manage YApi API interfaces, projects, and categories through natural language.122MIT