Command Palette

Search for a command to run...

UnylyUnyly
Browse all

@Wllcyg/Yapi

FreeNot checked

Enables searching YApi interfaces by keyword and retrieving detailed interface schemas, including request/response, for project-level tokens.

GitHubEmbed

About

Enables searching YApi interfaces by keyword and retrieving detailed interface schemas, including request/response, for project-level tokens.

README

YApi MCP Server(Node.js + MCP SDK),提供按需查询的两个核心工具:

  • search_yapi_interfaces
  • get_yapi_interface_detail

Token 仅支持 project 级group 级 URL 不支持鉴权。

1. 安装与构建

npm install
npm run build

本地开发:

npm run dev

2. 配置

环境变量

  • YAPI_BASE_URL(必填)
  • YAPI_TOKEN_FILE(可选,默认 ~/.yapi-mcp-tokens.json
  • YAPI_TIMEOUT_MS(可选,默认 8000
  • YAPI_RETRY_COUNT(可选,默认 1
  • YAPI_TOKEN(可选,单项目临时兜底)

Token 文件

路径:~/.yapi-mcp-tokens.json

{
  "695": "token_for_project_695",
  "703": "token_for_project_703"
}

3. MCP 客户端配置示例(Cursor)

{
  "mcpServers": {
    "yapi": {
      "command": "node",
      "args": ["D:/self/yapi-mcp/dist/index.js"],
      "env": {
        "YAPI_BASE_URL": "http://10.255.30.245:3000"
      }
    }
  }
}

如果你后续发布 npm 包,也可改为:

{
  "mcpServers": {
    "yapi": {
      "command": "npx",
      "args": ["-y", "@wllcyg001/yapi-mcp"],
      "env": {
        "YAPI_BASE_URL": "http://10.255.30.245:3000"
      }
    }
  }
}

4. 工具定义

search_yapi_interfaces

输入:

  • keyword: string(必填)
  • projectId?: number
  • projectUrl?: string(如 .../project/695/interface/api
  • method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"
  • pathHint?: string
  • limit?: number(默认 10,最大 50)

输出:

  • 匹配接口列表:interfaceId / name / method / path / projectId / score

get_yapi_interface_detail

输入:

  • interfaceId: number(必填)
  • projectId?: number
  • projectUrl?: string
  • includeMock?: boolean(默认 false)

输出:

  • 接口详情(request/response schema,默认不返回 mock)

5. 错误码

  • INVALID_ARGUMENT
  • PROJECT_ID_REQUIRED
  • PROJECT_TOKEN_REQUIRED
  • TOKEN_SCOPE_UNSUPPORTED
  • PROJECT_NOT_ACCESSIBLE
  • INTERFACE_NOT_FOUND
  • UPSTREAM_TIMEOUT
  • UPSTREAM_ERROR
  • RATE_LIMITED

from github.com/wllcyg/yapi-mcp

Install @Wllcyg/Yapi in Claude Desktop, Claude Code & Cursor

Recommended · one command, every IDE
unyly install wllcyg-yapi-mcp

Installs into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.

First time? Get the CLI: curl -fsSL https://unyly.org/install | sh

Or configure manually

Run in your terminal:

claude mcp add wllcyg-yapi-mcp -- npx -y @wllcyg001/yapi-mcp

FAQ

Is @Wllcyg/Yapi MCP free?

Yes, @Wllcyg/Yapi MCP is free — one-click install via Unyly at no cost.

Does @Wllcyg/Yapi need an API key?

No, @Wllcyg/Yapi runs without API keys or environment variables.

Is @Wllcyg/Yapi hosted or self-hosted?

A hosted option is available: Unyly runs the server in the cloud, no local setup required.

How do I install @Wllcyg/Yapi in Claude Desktop, Claude Code or Cursor?

Open @Wllcyg/Yapi on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare @Wllcyg/Yapi with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs