# YApi MCP

> YApi MCP is an open-source MCP server for developer tools. Pull YApi interface docs, requests and responses into coding agents from a project URL. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/contextdong/yapi-mcp
- **MCP Registry name:** io.github.ContextDong/yapi-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-16

## About

YApi MCP lets a coding agent read API documentation hosted on a YApi instance so it can write matching client code. Paste a YApi project or interface page URL and the server parses out the host, project id and interface id, lists and searches interfaces, and returns normalised request and response definitions as JSON Schema or examples.

Authentication uses either a login JWT, sent as the _yapi_token and _yapi_uid cookies, or a project open token. Credentials can come from tool arguments, runtime configuration inside the process, environment variables or a .env file, or a .yapi-mcp.json file, in that order of priority. The README tells users never to commit those files.

It installs from PyPI as contextdong-yapi-mcp and runs with uvx over stdio, or from Git. The README is written in Chinese and is MIT-licensed.

## Features

- **URL parsing:** Extracts host, project id and interface id from a YApi page address.
- **Interface search:** Lists and searches interfaces in a project.
- **Normalised definitions:** Returns request and response JSON as schema or examples.
- **Catalogue export:** Exports the interface catalogue, with optional details.
- **Flexible credentials:** Arguments, runtime configuration, environment or config file.
- **Two auth modes:** Login JWT or project open token.

## Good for

- Have an agent build a client from YApi docs
- Search a project's interfaces by keyword
- Export an interface catalogue for review
- Wire login endpoints into an app from pasted URLs

## Install

### Claude Code (Terminal)

```sh
claude mcp add yapi-mcp --env YAPI_TOKEN='<YAPI_TOKEN>' -- uvx contextdong-yapi-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "yapi-mcp": {
      "command": "uvx",
      "args": [
        "contextdong-yapi-mcp"
      ],
      "env": {
        "YAPI_TOKEN": "<YAPI_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "yapi-mcp": {
      "command": "uvx",
      "args": [
        "contextdong-yapi-mcp"
      ],
      "env": {
        "YAPI_TOKEN": "<YAPI_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "yapi-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "contextdong-yapi-mcp"
      ],
      "env": {
        "YAPI_TOKEN": "<YAPI_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "yapi-mcp": {
      "command": "uvx",
      "args": [
        "contextdong-yapi-mcp"
      ],
      "env": {
        "YAPI_TOKEN": "<YAPI_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "yapi-mcp": {
      "command": "uvx",
      "args": [
        "contextdong-yapi-mcp"
      ],
      "env": {
        "YAPI_TOKEN": "<YAPI_TOKEN>"
      }
    }
  }
}
```

## Tools

- `yapi_configure`: Set credentials dynamically for the running server.
- `yapi_get_config`: View non-sensitive configuration.
- `yapi_parse_url`: Parse host and ids from a YApi page URL.
- `yapi_get_project`: Return project metadata.
- `yapi_list_interfaces`: Return a searchable interface index.
- `yapi_get_interface`: Return the full JSON definition of one interface.
- `yapi_export_catalog`: Export the catalogue, optionally with details.

## FAQ

### How do I authenticate?

With a login JWT or a project open token set as YAPI_TOKEN, plus the YApi host as YAPI_BASE_URL.

### How is YApi MCP installed?

From PyPI as contextdong-yapi-mcp via uvx or pip, or directly from Git.

### Does YApi MCP cover non-JSON APIs?

The README describes JSON requests and JSON responses.

### What licence applies?

MIT.

### Is YApi MCP free?

Yes. YApi MCP is open source, so you can use and self-host it for free.

### How do I add YApi MCP to Claude Code?

Run this command in your terminal: claude mcp add yapi-mcp --env YAPI_TOKEN='<YAPI_TOKEN>' -- uvx contextdong-yapi-mcp

### What are the best alternatives to YApi MCP?

The closest alternatives to YApi MCP are python-sdk, fastapi_mcp, tyk, JiZhiMCP and fastmcp.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [python-sdk](https://ai-powered.com/mcp/python-sdk): python-sdk is an open-source MCP server for developer tools.
- [fastapi_mcp](https://ai-powered.com/mcp/fastapi-mcp): fastapi_mcp is an open-source MCP server for ai models and llm tooling.
- [tyk](https://ai-powered.com/mcp/tyk): tyk is an open-source MCP server for developer tools.
- [JiZhiMCP](https://ai-powered.com/mcp/jizhimcp): JiZhiMCP is an MCP server for developer tools.
- [fastmcp](https://ai-powered.com/mcp/fastmcp): fastmcp is an open-source MCP server for developer tools.
- [Openapi®](https://ai-powered.com/mcp/openapi-2): Openapi® is a paid MCP server for developer tools.
- [Aliyun Yunxiao Projex MCP](https://ai-powered.com/mcp/aliyun-yunxiao-projex-mcp): Aliyun Yunxiao Projex MCP is an open-source MCP server for productivity.
- [Uipath](https://ai-powered.com/mcp/uipath): Uipath is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/yapi-mcp
