The Yapi MCP server acts as a bridge between AI assistants and the Yapi API management platform, making it easy to interact with API documentation through natural language. Instead of manually clicking through a web interface to find endpoints or study schemas, a developer can simply ask an AI to find a specific service or list project details. It effectively gives an LLM direct access to a team's internal API registry, streamlining the development process by bringing documentation directly into the coding environment. Beyond simple lookups, this tool provides a robust set of functions for deep exploration of API architecture. It includes specific tools for listing projects, browsing interface categories, and retrieving granular details about specific endpoints, such as request parameters and response formats. The server also features built-in cache management—including manual refresh and statistics tracking—to ensure that the AI is always working with the most up-to-date documentation without unnecessary latency or backend load. Designed for flexible deployment, the server can be hosted via Java or Docker and integrates seamlessly with MCP-compatible clients like Cursor. By configuring project-specific tokens, developers can secure and customize access to multiple Yapi projects simultaneously. This setup empowers AI agents to not only answer questions about existing APIs but also assist in complex integration tasks by referencing real-time interface definitions, significantly reducing the cognitive load for developers working in service-heavy environments.
Category: CRM, ERP & E-commerce
Tags: api-management, api-registry, documentation, integration, yapi
bash git clone https://github.com/yyykf/yapi-mcp-server.git cd yapi-mcp-server 3. Build the project: bash mvn clean package 4. Run the application: bash java -jar target/yapi-mcp-server-0.0.1-SNAPSHOT.jar Method 2: Run with Docker 1. Ensure you have Docker and Docker Compose installed. 2. Clone the repository: bash git clone https://github.com/yyykf/yapi-mcp-server.git cd yapi-mcp-server 3. Start the server: bash docker-compose up -d ---src/main/resources/application-mcp.yml: yaml spring: cloud: openfeign: client: config: yapiClient: url: http://yapi.com # Replace with your Yapi URL yapi: project-tokens: 123456: "your-project-token-1" # Project ID: Token 789012: "your-project-token-2" # Add more projects as neededmcp.json configuration file: json { "mcpServers": { "yapi": { "url": "http://127.0.0.1:8888/sse" } } } ---listProjects | List all configured Yapi projects with their IDs and names | | listCategories | Get interface categories for a specific Yapi project (Requires projectId) | | listCatInterfaces | List interfaces within a specific category (Requires catId) | | searchInterfaces | Search API interfaces by project name, keyword, or path | | getInterfaceDetail | Get detailed information about a specific API interface (Requires interfaceId) | | refreshCache | Manually refresh the Yapi cache | | clearProjectCache | Clear cache for a specific project (Requires projectId) | | getCacheStats | Get cache statistics information | ---getInterfaceDetail tool to generate type-safe interfaces (TypeScript) or API service functions based on the real-time documentation in Yapi. Example: "Look up the 'Create Order' API in Yapi and generate a TypeScript interface for the request body and a Zod schema for the response."searchInterfaces tool through natural language to query their entire Yapi instance. The AI can search by keywords, paths, or project names to find existing functionality across the whole company. Example: "Search all Yapi projects for any existing interfaces related to 'user password reset' or 'email verification' so I don't duplicate work."getInterfaceDetail to fetch the source of truth from Yapi and performs an immediate "diff" between the implementation and the documentation to identify mismatches in field names or data types. Example: "The login request is returning a 400 error. Check the current code against the Yapi definition for the `auth/login` interface and tell me if I'm missing any required parameters."
Part of MCP Servers
The Yapi MCP server is an open-source integration running on Java that exposes tools to connect AI assistants to the Yapi API management platform. It allows developers to browse project categories, fetch endpoint schemas, search paths, and manage cached API details through standard Model Context Protocol messages.
You can clone the repository from GitHub, configure your Yapi URL and project tokens in the application-mcp.yml file, and run it using Maven and Java 21 or Docker Compose. After the server starts, connect it to your MCP client by pointing an SSE URL to http://127.0.0.1:8888/sse.
The server provides tools including listProjects, listCategories, listCatInterfaces, searchInterfaces, and getInterfaceDetail. It also includes cache administration tools such as refreshCache, clearProjectCache, and getCacheStats to inspect and clear documentation caches without restarting the application.
The Yapi MCP server operates over Server-Sent Events on port 8888 and works with any MCP-compliant client that supports SSE transport, such as Cursor. It can be registered directly inside your client's mcp.json settings file.
Yes, the Yapi MCP server is open-source software licensed under the MIT License. The complete source code, build scripts, and Docker configuration files are hosted on GitHub.