Skip to main content
Glama

YAPI Interface MCP Server

by Gorvey

yapi-get-interface-mcp

一个用于获取YAPI接口详情的MCP(Model Context Protocol)服务器,支持与Cursor、Claude Desktop等AI开发工具集成。

使用方法

可用工具

yapi-get-interface

根据接口ID获取YAPI接口详情

参数:

  • id:接口ID(数字格式)

使用示例:

AI工具会自动调用该工具并返回接口的完整信息,包括:

  • 接口基本信息(名称、路径、方法等)
  • 请求参数(路径参数、查询参数、请求头、请求体)
  • 响应信息(响应体、响应类型等)
  • 其他元数据(创建时间、状态、标签等)

命令行参数

参数说明必需示例
--emailYAPI登录邮箱--email admin@company.com
--passwordYAPI登录密码--password mypassword
--urlYAPI服务器地址--url https://yapi.company.com

快速开始

在Cursor中配置

创建或编辑 .cursor/mcp.json 文件(项目级配置)或 ~/.cursor/mcp.json 文件(全局配置):

{ "mcpServers": { "yapi-get-interface-mcp": { "command": "npx", "args": [ "yapi-get-interface-mcp", "--email", "your@email.com", "--password", "yourpassword", "--url", "https://yapi.yourcompany.com" ] } } }

环境要求

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0

安装

使用npx可以直接运行,无需本地安装:

# 克隆项目 git clone https://github.com/Gorvey/yapi-get-interface-mcp.git cd yapi-get-interface-mcp # 安装依赖 pnpm install # 构建项目 pnpm run build

开发指南

项目结构

src/ ├── config/ # 配置管理 │ └── yapi-config.ts ├── server/ # MCP服务器 │ ├── server.ts │ ├── tools.ts │ └── resources.ts ├── yapi/ # YAPI客户端 │ └── client.ts └── index.ts # 入口文件

开发脚本

# 开发模式(带示例配置) pnpm run dev # 监听文件变化自动构建 pnpm run watch # 清理构建文件 pnpm run clean # 构建项目 pnpm run build # 使用MCP Inspector调试 pnpm run inspector

调试

使用MCP Inspector进行调试:

pnpm run inspector

这将启动一个交互式界面,帮助你测试和调试MCP工具。

常见问题

1. YAPI连接失败

  • 检查YAPI服务器地址是否正确
  • 确认邮箱和密码是否正确
  • 检查网络连接和YAPI服务器可访问性

2. 接口ID无效

  • 确保接口ID是数字格式
  • 检查接口在YAPI中是否存在
  • 确认有访问该接口的权限

3. MCP服务器未被识别

  • 确保已正确构建项目(pnpm run build
  • 检查配置文件中的路径是否正确
  • 重启AI开发工具

许可证

MIT License

贡献

欢迎提交Issue和Pull Request来改进这个项目。

更多信息

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Model Context Protocol server that allows AI development tools like Cursor and Claude Desktop to retrieve detailed YAPI interface information by interface ID.

  1. 使用方法
    1. 可用工具
    2. 命令行参数
  2. 快速开始
    1. 在Cursor中配置
  3. 环境要求
    1. 安装
      1. 开发指南
        1. 项目结构
        2. 开发脚本
        3. 调试
      2. 常见问题
        1. YAPI连接失败
        2. 接口ID无效
        3. MCP服务器未被识别
      3. 许可证
        1. 贡献
          1. 更多信息

            Related MCP Servers

            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants to explore and interact with Cursor IDE's SQLite databases, providing access to project data, chat history, and composer information.
              Last updated -
              10
              Python
              • Apple
            • -
              security
              F
              license
              -
              quality
              A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
              Last updated -
              1
              Python
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.
              Last updated -
              7
              292
              7
              TypeScript
              MIT License
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol (MCP) server that allows Claude AI to interact with custom tools, enabling extension of Claude's capabilities through the MCP framework.
              Last updated -
              TypeScript
              • Apple

            View all related MCP servers

            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/Gorvey/yapi-get-interface-mcp'

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