← 返回
开发者工具

Yapi

Query and sync YApi interface documentation. Use when user mentions "yapi 接口文档", YAPI docs, asks for request/response details, or needs docs sync. Also trigg...
Query and sync YApi interface documentation. Use when user mentions "yapi 接口文档", YAPI docs, asks for request/response details, or needs docs sync. Also trigg...
leeguooooo
开发者工具 clawhub v1.0.1 2 版本 99866.5 Key: 无需
★ 0
Stars
📥 2,244
下载
💾 5
安装
2
版本
#latest

概述

YApi interface docs

Command policy

Prefer yapi command. If missing, fallback to one-shot npx without forcing global install:

yapi -h
# fallback:
npx -y @leeguoo/yapi-mcp -h

In command examples below, yapi can be replaced by npx -y @leeguoo/yapi-mcp.

Quick workflow

  1. If user gives a YApi URL, verify it belongs to configured base_url.
  2. Confirm auth (yapi whoami), then run yapi login only when needed.
  3. Resolve target by api_id / keyword / category.
  4. Fetch raw JSON first, then summarize: method, path, headers, params, body, response schema/examples.
  5. For docs sync tasks, do --dry-run first, then real sync.

URL detection

  1. Read configured base_url from ~/.yapi/config.toml.
  2. rg -n "^base_url\\s*=" ~/.yapi/config.toml
    
  3. If URL origin matches base_url, extract IDs from path:
    • /project/123/... -> project_id=123
    • .../api/456 -> api_id=456
    • .../api/cat_789 -> catid=789
  4. Prefer direct lookup when api_id exists:
  5. yapi --path /api/interface/get --query id=<api_id>
    

Common commands

# version/help
yapi --version
yapi -h

# auth
yapi whoami
yapi login

# search / fetch
yapi search --q keyword --project-id 310
yapi --path /api/interface/get --query id=123
yapi --path /api/interface/list_cat --query catid=123

Config cache locations:

  • Config: ~/.yapi/config.toml
  • Auth cache: ~/.yapi-mcp/auth-*.json

Docs sync

Binding mode (recommended):

yapi docs-sync bind add --name projectA --dir docs/release-notes --project-id 267 --catid 3667
yapi docs-sync --binding projectA --dry-run
yapi docs-sync --binding projectA

Notes:

  • Binding file: .yapi/docs-sync.json
  • Mapping outputs: .yapi/docs-sync.links.json, .yapi/docs-sync.projects.json, .yapi/docs-sync.deployments.json
  • Default behavior syncs changed files only; use --force for full sync.
  • Compatible with directory .yapi.json config as fallback (without binding).
  • Mermaid/PlantUML/Graphviz/D2 rendering depends on local tool availability; missing tools do not block basic sync.

Interface creation guardrails

  • Always set req_body_type (use json if unsure) and provide res_body (prefer JSON Schema) when creating/updating interfaces.
  • Put structured request/response fields in req_* / res_body, not only in free-text desc/markdown.

版本历史

共 2 个版本

  • v1.0.1 当前
    2026-03-28 16:52 安全 安全
  • v1.0.0
    2026-03-07 11:41

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

email skill

leeguooooo
通过邮箱 CLI 管理与读取邮件,支持 JSON 输出,可安全高效地列出、查看、删除和监控邮件。
★ 1 📥 2,079
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,950
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,564