Skip to main content
Glama
wllcyg

@wllcyg/yapi-mcp

by wllcyg

@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

Related MCP server: YApi MCP Server

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

Available Tools

2 tools
get_yapi_interface_detailA

Get YApi interface detail including request/response schema. Token scope is project-level only.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectIdNo
projectUrlNo
includeMockNo
interfaceIdYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description adds a token scope constraint and indicates the included content (request/response schema). However, it does not explicitly state read-only behavior or potential error cases, leaving some behavioral uncertainty.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with no fluff, front-loaded with the core action and additional token scope constraint. It earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 4 parameters and no output schema or annotations, so the description must clarify parameter usage and return values. It only mentions request/response schema and token scope, leaving significant gaps for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters are explained in the description, and the schema has no property descriptions (0% coverage). Parameter names like projectId and includeMock are self-explanatory, but the description adds no semantics or required/optional context, failing to compensate for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves YApi interface detail including request/response schema. The verb 'get' and resource 'interface detail' are specific and distinguish it from the sibling search tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit usage guidance is provided. The description implies usage when a specific interface ID is known and full schema details are needed, but it does not contrast with search_yapi_interfaces or state prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_yapi_interfacesA

Search YApi interfaces by natural language keyword within a project. Token scope is project-level only.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
methodNo
keywordYes
pathHintNo
projectIdNo
projectUrlNo

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the token scope is project-level, which is a useful behavioral hint, but it does not mention return format, pagination, or confirm read-only behavior. Since 'search' implies read-only, this is acceptable but not richly transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the core purpose, and adds only the necessary token scope note. Every sentence earns its place; no fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 6 parameters, no output schema, and no annotations. The description is too brief to cover parameter meanings, output behavior, or selection guidance versus the sibling. This is a significant gap for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for all parameters. It clarifies 'keyword' as natural language and implies project scoping via projectId/projectUrl, but it does not explain 'limit', 'method', or 'pathHint'. This leaves the majority of parameters semantically under-defined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action (search) on a specific resource (YApi interfaces) with a natural language keyword and project scope. This distinguishes it from the sibling tool get_yapi_interface_detail, which presumably retrieves a single interface's details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for searching within a project via natural language, which provides clear context. However, it does not explicitly mention when to use this tool versus get_yapi_interface_detail or any exclusion criteria, so it falls short of a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.3
    • First observedget_yapi_interface_detail
    • First observedsearch_yapi_interfaces

TDQS

A3.8/5.0
Disambiguation5/5

Search and detail retrieval are clearly distinct stages in the workflow—one identifies interfaces, the other inspects a specific one. No functional overlap exists, so an agent can easily choose the right tool.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with snake_case: search_yapi_interfaces and get_yapi_interface_detail. The verb-first style is uniform and predictable.

Tool Count3/5

With only 2 tools, the server feels minimal for a YApi integration. This is borderline for the rubric's definition of a thin tool set, though it could be defensible if the scope is intentionally limited to read-only search and retrieval.

Completeness4/5

The read-only workflow is well covered: search for interfaces and retrieve full details. However, there is no way to list all interfaces without a keyword, and no CRUD or project-level operations, which are reasonable gaps for the stated purpose.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wllcyg/yapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server