Token导航 LogoToken导航TokenDH.com
Yapi Interface MCP logo
运维云端stdio官方级别未说明来源级核验

Yapi Interface MCP

MCP Server

@modelcontextprotocol/inspector

一个用于YAPI接口管理平台的MCP服务器,支持项目查询、分类管理、接口管理等功能。

工具数

9

提示词数

0

GitHub Stars

1

资源数

0
JavaScriptClaude云端部署Claude DesktopClaudeCursorWindsurfCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

W-Abel-jia

提供方

W-Abel-jia

最后核验

2026/5/17 20:19

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @modelcontextprotocol/inspector node dist/index.js

详细介绍

YAPI MCP Server

一个用于 YAPI 接口管理平台的 MCP (Model Context Protocol) 服务器,支持查询项目、接口列表、接口分类、接口详情,以及新增和修改接口等功能。

功能特性

  • 🔍 项目查询 - 获取项目信息和项目列表
  • 📂 分类管理 - 查询接口分类、新增分类
  • 📋 接口管理 - 查询接口列表、接口详情、新增接口、修改接口
  • 🔐 Cookie 认证 - 通过邮箱密码登录自动获取认证

安装

# 克隆项目
git clone https://github.com/W-Abel-jia/yapi-interface-mcp.git
cd yapi-interface-mcp

# 安装依赖
npm install

# 构建
npm run build

配置

方式一:配置文件(推荐)

在项目根目录创建 yapi-interface-mcp.config.json 文件:

{
  "baseUrl": "http://your-yapi-server:3000",
  "email": "your-email@example.com",
  "password": "your-password"
}

方式二:环境变量

环境变量说明必填
YAPI_BASE_URLYAPI 服务器地址
YAPI_EMAIL登录邮箱
YAPI_PASSWORD登录密码

使用方式

在 Claude Desktop 中使用

编辑 Claude Desktop 配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

添加以下配置:

{
  "mcpServers": {
    "yapi": {
      "command": "node",
      "args": ["/path/to/yapi-interface-mcp/dist/index.js"],
      "env": {
        "YAPI_BASE_URL": "http://your-yapi-server:3000",
        "YAPI_EMAIL": "your-email@example.com",
        "YAPI_PASSWORD": "your-password"
      }
    }
  }
}

重启 Claude Desktop 即可使用。

在其他 MCP 客户端中使用

如 Cursor、Windsurf、Cline 等,参考各客户端的 MCP 配置方式:

  • 命令: node /path/to/yapi-interface-mcp/dist/index.js
  • 环境变量: 配置 YAPI_BASE_URL 和认证信息

使用 MCP Inspector 测试

cd yapi-interface-mcp
npx @modelcontextprotocol/inspector node dist/index.js

支持的工具

工具名称功能描述必需参数
yapi-get-project获取项目信息projectId
yapi-get-project-list获取项目列表-
yapi-get-categories获取项目的接口分类列表projectId
yapi-get-interfaces-by-category获取指定分类下的接口列表catid
yapi-get-interfaces获取项目的所有接口列表projectId
yapi-get-interface获取接口详情id
yapi-create-interface新增接口title, path, method, catid
yapi-update-interface修改接口id
yapi-create-category新增分类name, project_id

工具参数说明

yapi-get-project

projectId: number - 项目ID

yapi-get-categories

projectId: number - 项目ID

yapi-get-interfaces-by-category

catid: number - 分类ID

yapi-get-interfaces

projectId: number - 项目ID

yapi-get-interface

id: string - 接口ID(数字格式)

yapi-create-interface

title: string - 接口标题
path: string - 接口路径,如 /api/user
method: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "PATCH"
catid: number - 分类ID
desc?: string - 接口描述
status?: "done" | "designing" | "dev" | "undone"
req_body_type?: "form" | "json" | "file" | "raw" | "text"
req_body_other?: string - 请求体 JSON Schema
req_body_form?: Array
req_headers?: Array
req_params?: Array
req_query?: Array
res_body_type?: "json" | "raw" | "text"
res_body?: string - 响应体 JSON Schema

yapi-update-interface

id: number - 接口ID
...其他参数同 yapi-create-interface(均为可选)

yapi-create-category

name: string - 分类名称
project_id: number - 项目ID
desc?: string - 分类描述

开发

# 安装依赖
npm install

# 开发模式(监听文件变化)
npm run dev

# 构建
npm run build

# 运行
npm start

注意事项

  1. 安全性 - 配置文件 yapi-interface-mcp.config.json 包含敏感信息,请勿提交到版本控制系统。已添加到 .gitignore
  2. 网络访问 - 确保 MCP 服务器能够访问 YAPI 服务器。

License

MIT

目录标签

目录标签

JavaScriptClaude云端部署接口管理本地部署项目查询分类管理Cookie认证YAPI

支持客户端

Claude DesktopClaudeCursorWindsurfCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

@modelcontextprotocol/inspector

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosessionremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP