yapi-mcp

yapi-mcp

Exposes YApi's API management capabilities to MCP clients, enabling operations like listing projects, categories, searching APIs, and managing API details.

Category
Visit Server

README

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:

  1. Broken inputSchema serialization — it returns the Zod schema object itself as inputSchema. After JSON.stringify it becomes {"_def":...}, an invalid structure. MCP clients reject it with tools fetch failed, so none of the tools ever load.
  2. Wrong interface-list strategy — YApi's /api/interface/list ignores catid on 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", "@mail-tom/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.com
  • YAPI_TOKEN — format projectId: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 fetch
  • Valid JSON Schema — every inputSchema is 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 errcode all become isError messages; the process never crashes
  • Debuggable — set DEBUG=1 to emit logs to stderr

Known limitations

  • Currently single-token (single-project); for multiple projects, run multiple instances
  • YApi's /api/interface/list total field is unreliable, so this tool stops paginating when a page returns fewer than the page size

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured