GB

guocong-bincai/yapi_mcp_pro

Developer tools

This page was translated automatically. Technical details may differ from the original. View the original

21 stars 6 forks Quality 70 Trend 10MIT

A powerful Model Context Protocol (MCP) server designed specifically for the YApi interface management platform. Supports direct operation of YApi in AI editors such as Cursor, Claude Desktop, and more, providing comprehensive interface lifecycle management functionality.

Overview

A powerful Model Context Protocol (MCP) server designed specifically for the YApi interface management platform. Supports direct operation of YApi in AI editors such as Cursor, Claude Desktop, and more, providing comprehensive interface lifecycle management functionality. : - ✅ : Displays version number such as 0.2.1 - ❌ : Shows error messages, cannot find commands, or gets stuck and doesn't work 💡 NPM caches may be corrupted or expired, preventing proper downloads or running of packages. Clearing the cache can resolve most connection issues. 🎯 : Uses NPM package stdio mode, no local build, ready to use out of the box! 📦 : Use npx -y yapi-mcp-pro to ensure always using the latest 🔒 version :Cookie authentication automatically discovers all items, simple configuration Copy your YAPI server address from your browser's address bar, for example: http://your-yapi-server.com 1. : Log in to your YAPI system normally in your browser 2. : Press F12 or right-click and select "Check" 3. : Click the "Network" tab 4. : Click any feature on the YAPI page (such as refresh page) 5. : Click any network request (as shown in the red box below) 6. : Find "Request Headers" in the right panel 7. : Find the "Cookie" field and copy the full Cookie value (as shown in the red box below) 💡 : - Cookies must include two key fields: _yapi_token and _yapi_uid - Full format such as: _yapi_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...; _yapi_uid=1413; Other cookie values - Please copy the full cookie string without missing any parts : 1. Create a .cursor folder in your project's root directory (if it doesn't exist) 2. Create a mcp.json file in the .cursor folder 3. Copy the following configuration into the file:

Overview (machine translated)

A powerful Model Context Protocol (MCP) server designed specifically for the YApi interface management platform. Supports direct operation of YApi in AI editors such as Cursor, Claude Desktop, and more, providing comprehensive interface lifecycle management functionality.

🚨 Quick Solutions to Common Problems

⚠️ Important: NPM Caching Issues (Must Read!) )

If you encounter connection issues, check this first:

🔍 ** Criteria for Judgment**:

  • ✅ Normal: Version number displayed as 0.2.1
  • ❌ Exception: Error messages displayed, commands not found, or the device gets stuck and doesn’t move

💡 > **Why does this issue occur? **

NPM cache may be corrupted or expired, causing inability to properly download or run packages. Cleaning the cache can resolve most connection issues.

🔧 Quick Troubleshooting Checklist

Checklist Normal status Exception handling
🔥 ** NPM package version** npx yapi-mcp-pro --version with output Must run: npm cache clean --force
YApi Service Accessable curl -I {YAPI_URL} Returns 200 Check YApi service status and network connection
Token validity Able to access the YApi interface normally Regain token or check permissions
Environment Variables YAPI_BASE_URL and YAPI_TOKEN are set Check the environment variable or configuration file

🚦 Cursor status light explanation

Status Meaning Solution
🟢 Green Light Connection Normal Can be used normally
🔴 Red Light Connection Failed 1. First, execute npm cache clean --force 2. Check the configuration file 3. Verify YApi connection
🟡 Yellow Light Connection Timeout Check Network and Firewall Settings
⚫ No display Configuration error Check JSON syntax and reconfigure

💊 One-Click Script Repair

If you encounter a problem, copy the following command and fix it with one click:


🚀 Want to get started right away?

Only 2 things needed:

  1. 📍 Your YAPI server address
  2. 🍪 Cookies in the browser

⏱️ ** Setup time: less than 5 minutes **

👉 Click here to start configuration

⚡ Get started in 5 minutes

🎯 > Recommended method: Use the stdio mode of the NPM package, no local build, ready to use out of the box!

📦 > Auto-Update: Use npx -y yapi-mcp-pro to ensure you always use the latest version

🔒 > Secure and Convenient: Cookie authentication automatically discovers all items, with simple configuration

This page was translated automatically. Technical details may differ from the original.

Install

npx -y yapi-mcp-pro
New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "yapi-mcp-pro": { "command": "npx", "args": ["-y", "yapi-mcp-pro"], "env": { "YAPI_BASE_URL": "http://your-yapi-server.com", "YAPI_TOKEN": "_yapi_token=您的真实token; _yapi_uid=您的用户ID", "NODE_ENV": "cli" } } } }