yapi-mcp
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-mcplist 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", "@mail-tom/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", "@mail-tom/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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/hizml/yapi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server