@wllcyg/yapi-mcp

@wllcyg/yapi-mcp

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

Category
Visit Server

README

@wllcyg001/yapi-mcp

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

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
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
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
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
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

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