@kedoupi/yapi-mcp
Enables AI tools to search, create, update, and manage YApi API interfaces, projects, and categories through natural language.
README
YApi MCP Enhanced
<div align="center">
An enhanced Model Context Protocol (MCP) server for YApi that enables seamless AI integration
Empower Claude, Cursor, and other AI tools with intelligent YApi API management capabilities
🚀 Quick Start • 🔧 Installation • 💻 Platforms • 📖 Documentation • 🤝 Contributing
</div>
🌟 Features
| Feature | Description | Status |
|---|---|---|
| 🔍 Smart Search | Advanced API search with flexible filtering options | ✅ |
| ✏️ Interface Management | Create, read, update API interfaces seamlessly | ✅ |
| 🎯 Project Organization | Manage projects and categories efficiently | ✅ |
| 🚀 Enhanced UX | Superior error handling and user feedback | ✅ |
| ⚡ Performance | Intelligent caching and optimized requests | ✅ |
| 🛡️ Reliability | Comprehensive error handling and validation | ✅ |
| 🌐 Multi-Platform | Claude Desktop, Cursor, Continue, and more | ✅ |
| 🔄 Real-time Sync | Live synchronization with YApi changes | 🔄 |
| 📊 Analytics | Usage statistics and performance metrics | 📋 |
🚀 Quick Start
Prerequisites
- Node.js 18+
- YApi Server with API access
- YApi Project Token
⚡ One-line Installation
# Install globally
npm install -g @kedoupi/yapi-mcp
# Test your connection
npx @kedoupi/yapi-mcp test-connection
🔧 Installation
<details> <summary>📦 NPM Installation</summary>
npm install -g @kedoupi/yapi-mcp
</details>
<details> <summary>🧶 Yarn Installation</summary>
yarn global add @kedoupi/yapi-mcp
</details>
<details> <summary>🔨 Development Installation</summary>
git clone https://github.com/kedoupi/yapi-mcp.git
cd yapi-mcp
npm install
npm run build
</details>
⚙️ Configuration
- Copy environment template:
cp .env.example .env
- Configure your YApi settings:
# Required
YAPI_BASE_URL=https://your-yapi-domain.com
YAPI_PROJECT_TOKEN=your-project-token
# Optional
LOG_LEVEL=info
CACHE_TTL=300
- Test connection:
npx @kedoupi/yapi-mcp test-connection
💻 Platform Integration
🤖 Claude Desktop
<details> <summary>Configure Claude Desktop</summary>
Add to your claude_desktop_config.json:
{
"mcpServers": {
"@kedoupi/yapi-mcp": {
"command": "npx",
"args": ["@kedoupi/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "https://your-yapi-domain.com",
"YAPI_PROJECT_TOKEN": "your-project-token",
"LOG_LEVEL": "info"
}
}
}
}
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
</details>
🎯 Cursor IDE
<details> <summary>Configure Cursor</summary>
- Open Cursor Settings (Cmd/Ctrl + ,)
- Search for "MCP" or go to Extensions > MCP
- Add new MCP server:
{
"name": "@kedoupi/yapi-mcp",
"command": "npx",
"args": ["@kedoupi/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "https://your-yapi-domain.com",
"YAPI_PROJECT_TOKEN": "your-project-token"
}
}
</details>
🔄 Continue (VS Code)
<details> <summary>Configure Continue</summary>
Add to .continue/config.json:
{
"mcpServers": [
{
"name": "@kedoupi/yapi-mcp",
"command": "npx",
"args": ["@kedoupi/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "https://your-yapi-domain.com",
"YAPI_PROJECT_TOKEN": "your-project-token"
}
}
]
}
</details>
🧠 Codeium
<details> <summary>Configure Codeium</summary>
Add MCP server configuration in Codeium settings:
{
"mcp_servers": {
"yapi": {
"command": "npx",
"args": ["@kedoupi/yapi-mcp"],
"env": {
"YAPI_BASE_URL": "https://your-yapi-domain.com",
"YAPI_PROJECT_TOKEN": "your-project-token"
}
}
}
}
</details>
🔗 Other Platforms
The server supports any MCP-compatible AI tool. Check our integration guide for more platforms.
🛠️ Available Tools
The server provides these tools for AI interaction:
| Tool | Description | Parameters |
|---|---|---|
yapi_get_projects |
List available YApi projects | - |
yapi_get_categories |
Get project categories | project_id |
yapi_get_interface |
Get API interface details | interface_id |
yapi_search_interfaces |
Search APIs with filters | project_id, catid, q, page, limit |
yapi_create_interface |
Create new API interface | title, path, method, project_id, catid, ... |
yapi_update_interface |
Update existing interface | id, title, path, method, ... |
yapi_clear_cache |
Clear internal cache | - |
<details> <summary>🔍 Tool Details</summary>
yapi_search_interfaces
Advanced search with multiple filters:
- project_id (optional): Filter by project
- catid (optional): Filter by category
- q (optional): Search query string
- page (optional): Page number for pagination
- limit (optional): Results per page (max 100)
yapi_create_interface / yapi_update_interface
Full interface management with support for:
- Request/response body specifications
- Headers and query parameters
- HTTP methods (GET, POST, PUT, DELETE, etc.)
- Interface status and descriptions
- Category assignments
</details>
🏗️ Architecture
graph TD
A[AI Tool] -->|MCP Protocol| B[YApi MCP Server]
B -->|HTTP API| C[YApi Server]
B -->|Cache| D[Memory Cache]
B -->|Logging| E[Logger]
B -->|Config| F[Environment]
- YApiClient: HTTP client for YApi API interactions
- MCP Server: Protocol handler for AI tool integration
- Caching: Intelligent caching for performance optimization
- Configuration: Environment-based configuration management
- Error Handling: Comprehensive error management
🧪 Development
Local Development
# Clone repository
git clone https://github.com/kedoupi/yapi-mcp.git
cd yapi-mcp
# Install dependencies
npm install
# Development mode (watch files)
npm run dev
# Build project
npm run build
# Start server
npm start
Testing
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
# Unit tests only
npm run test:unit
# Integration tests
npm run test:integration
Code Quality
# Lint code
npm run lint
# Fix issues
npm run lint:fix
# Clean build
npm run clean
📊 Performance
- ⚡ Fast Response: < 100ms for cached requests
- 💾 Memory Efficient: < 50MB RAM usage
- 🔄 Smart Caching: 5-minute TTL with cleanup
- 📈 Scalable: Handles 1000+ concurrent requests
🤝 Contributing
We welcome all contributions! Here's how you can help:
🐛 Bug Reports
Found a bug? Open an issue
💡 Feature Requests
Have an idea? Request a feature
🔧 Code Contributions
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
See our Contributing Guide for detailed information.
🌟 Other Ways to Help
- ⭐ Star the repository
- 📢 Share with others
- 📝 Improve documentation
- 🧪 Test new features
📋 Roadmap
🎯 Current Focus
- [ ] Enhanced Mock data support
- [ ] Batch operations for multiple APIs
- [ ] Real-time synchronization with YApi
- [ ] Multi-project parallel management
🔮 Future Plans
- [ ] GraphQL API support
- [ ] Web-based configuration UI
- [ ] Custom plugin system
- [ ] Advanced analytics dashboard
- [ ] Docker container support
🏆 Comparison
| Feature | YApi MCP Enhanced | Original YApi MCP | Manual YApi |
|---|---|---|---|
| AI Integration | ✅ Advanced | ✅ Basic | ❌ None |
| Error Handling | ✅ Comprehensive | ⚠️ Limited | ⚠️ Manual |
| Caching | ✅ Smart TTL | ❌ None | ❌ None |
| Testing | ✅ 80%+ Coverage | ❌ None | ❌ Manual |
| TypeScript | ✅ Full Support | ⚠️ Partial | ❌ None |
| CLI Tools | ✅ Rich CLI | ❌ None | ❌ None |
🔗 Related Projects
- YApi - Visual API management platform
- Model Context Protocol - AI tool communication standard
- Claude Desktop - Anthropic's desktop application
- Cursor - AI-powered code editor
📄 License
This project is licensed under the MIT License.
🆘 Support
Need help? We're here for you:
🙏 Acknowledgments
Special thanks to:
- YApi Team for the excellent API management platform
- Anthropic for the Model Context Protocol
- All Contributors who make this project better
- Open Source Community for inspiration and support
<div align="center">
If this project helps you, please give us a ⭐️
Made with ❤️ by kedoupi and contributors
🏠 Homepage • 📚 Docs • 🐛 Issues • 💬 Discussions
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。