Yapi
БесплатноНе проверенExposes YApi's API management capabilities to MCP clients, enabling operations like listing projects, categories, searching APIs, and managing API details.
Описание
Exposes YApi's API management capabilities to MCP clients, enabling operations like listing projects, categories, searching APIs, and managing API details.
README
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.
Tools
| Tool | Description |
|---|---|
yapi_list_projects |
List the configured project (id / name / desc) |
yapi_get_categories |
List project categories and the APIs under each |
yapi_search_apis |
Search APIs by keyword (title / path), optional method filter |
yapi_get_api_details |
Full detail of one API (params / headers / body / response) |
yapi_save_api |
Create or update an API (with api_id → update; without → create) |
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.git
Point 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
fetch - Valid JSON Schema — every
inputSchemais hand-written standard JSON Schema, so clients validate it fine - Full pagination — project-level pagination + dedup, no missing or duplicate APIs
- Robust errors — param errors, timeouts, and YApi
errcodeall becomeisErrormessages; the process never crashes - Debuggable — 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
Установка Yapi
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/hizml/yapi-mcpFAQ
Yapi MCP бесплатный?
Да, Yapi MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Yapi?
Нет, Yapi работает без API-ключей и переменных окружения.
Yapi — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Yapi в Claude Desktop, Claude Code или Cursor?
Открой Yapi на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Yapi with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
