Yapi Mcp Server — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Yapi Mcp Server (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
这是一个 Model Context Protocol (MCP) 服务器,用于与 YApi 接口管理平台集成,支持自动生成 TypeScript 类型定义、Mock 数据和 API 请求代码。
yapi.config.json 配置文件推荐使用最新的yapi-cli, 相比当前项目支持了以下功能:
{
"mcpServers": {
"yapi-mcp": {
"command": "npx",
"args": ["-y", "@vtian/yapi-mcp-server", "--stdio"]
}
}
}
在您的前端项目根目录下创建 yapi.config.json 文件:
{
"remoteUrl": "https://your-yapi-domain.com/api/open/plugin/export-full?type=json&pid=1437&status=all&token=your-token",
"type": "yapi",
"dataKey": "data",
"mockPath": "src/mocks",
"typePath": "src/types",
"apiPath": "src/api"
}#### 必填字段
remoteUrl: YApi 项目导出接口 URLtype: 平台类型,固定为 "yapi"#### 可选字段
dataKey: 响应数据字段名,默认 "data"mockPath: Mock 文件输出路径,默认 "src/mocks"typePath: 类型文件输出路径,默认 "src/types"apiPath: API 代码输出路径,默认 "src/api"本项目提供以下 5 个 MCP 工具,可以通过支持 MCP 协议的客户端(如 Claude Desktop、cursor)调用:
从项目中查找并读取 yapi.config.json 配置文件。
从 YApi 服务器获取接口数据,支持缓存机制(30 分钟)。
根据接口 JSON Schema 生成 TypeScript 类型定义。
根据接口 Schema 智能生成符合结构的 Mock 数据。
生成 Axios 或 Fetch 风格的 API 请求函数代码。




/** 用户信息接口 */
export interface UserInfoData {
/** 用户ID */
userId: number
/** 用户名 */
username: string
/** 邮箱 */
email: string
}/**
* 用户信息接口
*/
export const getUserInfo = async (): Promise<UserInfoData> => {
const response = await axios.get('/api/user/info')
return response.data
}{
"code": "200",
"success": true,
"message": "操作成功",
"data": {
"userId": 12345,
"username": "测试用户",
"email": "[email protected]"
}
}MIT License
如有问题或建议,请通过 Issues 或内部渠道联系开发团队。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.