Yapi MCP Server

# YApi MCP Server 这是一个 Model Context Protocol (MCP) 服务器,用于与 YApi 接口管理平台集成,支持自动生成 TypeScript 类型定义、Mock 数据和 API 请求代码。 ## ✨ 功能特性 ### 🔧 核心功能 -

Local serverstdio

What is the Yapi MCP server?

YApi MCP Server 这是一个 Model Context Protocol (MCP) 服务器,用于与 YApi 接口管理平台集成,支持自动生成 TypeScript 类型定义、Mock 数据和 API 请求代码。 ## ✨ 功能特性 ### 🔧 核心功能 - 配置文件读取: 自动读取项目中的 yapi.config.json 配置文件 - YApi 数据获取: 通过配置的 remoteUrl 获取 YApi. That is what the yapi mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

// 方式二 使用了 fnm、nvm 等 node 管理器,子进程中可能没有初始化 node 环境导致报错,使用下面的配置 { "mcpServers": { "yapi-cli": { "command": "/bin/zsh", "args": [ "-lic", "exec npx -y -p @vtian/yapi-cli yapi-mcp" ], "cwd": "${workspaceFolder}" } } } ```

Getting it running

Installation goes through your MCP client rather than a global install: point it at @vtian/yapi-cli on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

What it needs from you

Configuration is passed through the environment: YAPI_SKILLS_ZIP_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. It is maintained by tiandashu; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How to install the Yapi MCP server

//方式一
{
	"mcpServers": {
		"yapi": {
			"command": "node",
			"args": ["/absolute/path/to/yapi-cli/dist/mcp/index.js"]
		}
	}
}

//方式二
{
    "mcpServers": {
        "yapi2": {
            "command": "npm",
            "args": [
                "exec",
                "--prefix",
                "/absolute/path/to/yapi-cli",
                "--",
                "yapi-mcp"
            ]
        }
    }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
YAPI_SKILLS_ZIP_URLEndpoint or connection string the server talks to.Yes

Frequently asked questions

The recommended yapi-cli supports CLI, MCP, skill, multiple YApi projects and spaces, and uses yapiopenapi to reduce context size and token usage.