Yapi Fetch Mcp

@xiaozhi666666 Claim

Basic information

Runtime
TypeScript
License
MIT
Transports
stdio
Author
xiaozhi666666
Submitted by
Community
Quality
25
Stars
1

About Yapi Fetch Mcp Server

Reusable MCP server for reading YApi interface metadata from a URL, interface ID, or project ID.

Yapi Fetch Mcp is a MCP server in the Browser Automation category listed in the AddMCP.net directory, published by xiaozhi666666. It exposes 3 tools, including get_interface, list_project_interfaces, search_project_interfaces. Supported transport: stdio. Runtime: TypeScript. License: MIT. The repository has 1 GitHub stars. Source code is hosted on github.com. Related topics: yapi-mcp-fetch-https-typescript.

Setup

{
    "mcpServers": {
        "yapi": {
            "command": "npx",
            "args": [
                "-y",
                "yapi-fetch-mcp"
            ],
            "env": {
                "YAPI_HOST": "https://yapi.example.com",
                "YAPI_TOKEN": "project-token"
            }
        }
    }
}

Yapi Fetch Mcp config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "yapi": {
            "command": "npx",
            "args": [
                "-y",
                "yapi-fetch-mcp"
            ],
            "env": {
                "YAPI_HOST": "https://yapi.example.com",
                "YAPI_TOKEN": "project-token"
            }
        }
    }
}

Yapi Fetch Mcp tools

  • get_interface — Read one YApi interface by URL or interface ID and return normalized request/response metadata.
    url:string, interfaceId:string|number, includeRaw:boolean, host:string, token:string, cookie:string
  • list_project_interfaces — Read a YApi project's interface menu. Useful for discovering interface IDs before calling get_interface.
    url:string, projectId:string|number, includeRaw:boolean, host:string, token:string, cookie:string
  • search_project_interfaces — Search/list YApi project interfaces with pagination.
    url:string, projectId:string|number, includeRaw:boolean, host:string, token:string, cookie:string, keyword:string, page:integer, limit:integer, categoryId:string|number

Overview

What is Yapi Fetch Mcp?

Yapi Fetch Mcp is an MCP server for reading YApi interface metadata. It can fetch interface path, request parameters, request body, and response structure via YApi page URL, interface ID, or project ID. It is intentionally project‑agnostic, pulling structured data while leaving code generation (services, types, models, API clients) to the coding agent.

How to use Yapi Fetch Mcp?

Install globally with npm install -g yapi-fetch-mcp. Configure environment variables YAPI_HOST and either YAPI_TOKEN (project token) or YAPI_COOKIE (browser cookie). Then add the server to your MCP client (e.g., Codex) using npx -y yapi-fetch-mcp or the global command. Authentication can also be passed directly in tool parameters.

Key features of Yapi Fetch Mcp

  • Retrieve single interface detail by YApi page URL or interface ID.
  • Read a YApi project’s full interface directory.
  • Search project interfaces by keyword with pagination.
  • Supports both project‑token and cookie/session authentication.
  • Returns normalized request/response metadata; optionally includes raw YApi data.

Use cases of Yapi Fetch Mcp

  • AI coding agents automatically understanding API endpoints documented in YApi.
  • Generating TypeScript types, service stubs, or API clients from YApi definitions.
  • Searching for interfaces by keyword across a YApi project.
  • Retrieving interface details without manual browsing when building integration tools.

Frequently asked questions

1 How do I get a long‑term token?

The YAPI_TOKEN is a project‑level token found in your YApi project’s Settings page (under “Token” or “Project Token”).

2 What if my YApi uses `Authorization: Bearer` instead of a query‑parameter token?

The current version sends the token only as a query parameter. If your access token must go in the Authorization header, use YAPI_COOKIE instead, or extend the code for your private YApi.

3 Can I authenticate with a browser cookie?

Yes. Set the YAPI_COOKIE environment variable with the full cookie string (e.g., _yapi_token=...; _yapi_uid=...). This works for YApi instances that require login.

4 What YApi API endpoints does this MCP call?

It uses /api/interface/get, /api/interface/list_menu, and /api/interface/list from the standard YApi API.

5 Can I run this from source instead of installing the npm package?

Yes. Clone the repository, run npm install && npm build, then point your MCP client’s command to node /absolute/path/to/build/src/index.js.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬