V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
gorvey

给 YAPI 做了个获取接口详情的 MCP

  •  
  •   gorvey · Jun 25, 2025 · 1512 views
    This topic created in 310 days ago, the information mentioned may be changed or developed.

    用途

    YAPI 是一个接口文档管理平台,类似 Apifox ,是开源可以自己部署的。但是很久没更新了

    给前端使用,当后端接口出了,静态页面写完了就可以使用

    复制接口的 ID ,MCP 会获取到接口的 path ,请求参数,响应参数。然后就可以让大模型继续生成 TS 类型,生成请求代码,给静态页面添加接口

    如何使用

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

    命令行参数

    参数 说明 必需 示例
    --email YAPI 登录邮箱 --email [email protected]
    --password YAPI 登录密码 --password mypassword
    --url YAPI 服务器地址 --url https://yapi.company.com

    github 地址

    https://github.com/Gorvey/yapi-get-interface-mcp

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2394 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.