1. Conduid
  2. Developer Tools
  3. yapi-server
MCP server · Developer Tools

yapi-server

YApi MCP Server

Unclaimed devtools
39Low

Scored 4 months ago · breakdown

About yapi-server

yapi-server is an MCP server published by git+kevinLiJ in the Developer Tools category: yApi MCP Server. It has been installed 0 times through Conduid.

Install

Install
npx yapi-mcp-server
Claude Code
claude mcp add yapi-mcp-server-gitkevin -- npx -y yapi-mcp-server
npx
npx -y yapi-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about yapi-server

Powered by Claude · Grounded in docs

I know everything about yapi-server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ·README presentNot checked yet.
  • ·License declaredNot checked yet.
  • ·Tests presentNot checked yet.
  • ·Dependencies pinnedNot checked yet.
  • ·No dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

yapi-mcp-server

简介

yapi-mcp-serverModel Context Protocol (MCP) 的服务端实现。支持通过 MCP 协议获取 YApi 接口详情。


快速开始

全局node环境需 >=18

配置 mcp.json

在项目根目录下新建或编辑 mcp.json 文件,内容如下:

{
  "mcpServers": {
    "yapi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "yapi-mcp-server",
        "--yapiToken=你的YApiToken",
        "--yapiHost=https://yapi.xxx.net"
      ]
    }
  }
}
  • 你的YApiToken 替换为实际的 YApi Token(token 获取路径:yapi 项目->设置->token 配置->工具标识)
  • https://yapi.xxx.net 替换为你的 YApi 服务域名

MCP Server 功能

  • 工具名yapi_get_apis_detail
  • 功能:批量获取 YApi 接口的详细信息。
  • 参数
    • apiIds:YApi 接口 ID 组成的数组。例如,接口地址为 /project/1/interface/api/66,则 ID 为 66。支持同时传入多个 ID。
  • 返回值:对应接口的详细信息对象数组,结构与 YApi 返回一致。

实践

mcp配置成功之后,直接对cursor说:

生成接口代码
@api/index.ts
@https://yapi.XXX.net/project/13533/interface/api/1554281
@https://yapi.XXX.net/project/13533/interface/api/1554288
@https://yapi.XXX.net/project/13533/interface/api/1554334

cursor就会调用yapi-mcp-server获取接口的信息,并根据项目代码规范,生成对应的接口代码,比如:

// 删除组织:https://yapi.XXX.net/project/13533/interface/api/1554334
export function deleteOrg(data: { id: number }) {
  return axios({
    url: "/goapi/admin/org/delete",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/json",
    },
  });
}

ai 可以给 接口函数起名字,爽歪歪!

制定规范,使生成的接口代码更符合规范

在 .cursorrules 文件中,编写接口代码的规范,比如:

// .cursorrules

接口代码规范:

- apiName 驼峰且动词前置,保持简洁
- 使用 axiosInstance
- 注释需包含接口名和 yapi 文档链接
- headers 有需要再加

import { axiosInstance as axios } from '@/api/axiosToken'

// {{$value.title}}:{{$value.yapiDocUrl}}
export function {{$value.apiName}}(data) {
  return axios({
    url: '{{$value.path}}',
    method: '{{$value.method}}',
    data,
    // headers: { ... } // 如有自定义 header 再补充
  })
}

参考链接

README mirrored from the source repository 4 months ago. The original is authoritative.

Questions

About yapi-server

How do I install yapi-server?

Run npx yapi-mcp-server, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is yapi-server safe to use with an AI agent?

Its trust score is 39 out of 100 (low). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is yapi-server still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.