📇 🏠 - Discover and explain OpenAPI specifications and generate code or mock data from them
@reapi/mcp-openapi
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol (MCP) server that loads and serves multiple OpenAPI specifications to enable LLM-powered IDE integrations. This server acts as a bridge between your OpenAPI specifications and LLM-powered development tools like Cursor and other code editors.
Features
- Loads multiple OpenAPI specifications from a directory
- Exposes API operations and schemas through MCP protocol
- Enables LLMs to understand and work with your APIs directly in your IDE
- Supports dereferenced schemas for complete API context
- Maintains a catalog of all available APIs
Powered by ReAPI
This open-source MCP server is sponsored by ReAPI, a next-generation API platform that simplifies API design and testing. While this server provides local OpenAPI integration for development, ReAPI offers two powerful modules:
🎨 API CMS
- Design APIs using an intuitive no-code editor
- Generate and publish OpenAPI specifications automatically
- Collaborate with team members in real-time
- Version control and change management
🧪 API Testing
- The most developer-friendly no-code API testing solution
- Create and manage test cases with an intuitive interface
- Powerful assertion and validation capabilities
- Serverless cloud test executor
- Perfect for both QA teams and developers
- CI/CD integration ready
Try ReAPI for free at reapi.com and experience the future of API development.
Cursor Configuration
To integrate the MCP OpenAPI server with Cursor IDE, you have two options for configuration locations:
Option 1: Project-specific Configuration (Recommended)
Create a .cursor/mcp.json file in your project directory. This option is recommended as it allows you to maintain different sets of specs for different projects
> **Tip**: Using a relative path like ./specs makes the configuration portable and easier to share across team members.
>
> **Note**: We recommend using @latest tag as we frequently update the server with new features and improvements.
>
> **Important**: Project-specific configuration helps manage LLM context limits. When all specifications are placed in a single folder, the combined metadata could exceed the LLM's context window, leading to errors. Organizing specs by project keeps the context size manageable.
Option 2: Global Configuration
Create or edit ~/.cursor/mcp.json in your home directory to make the server available across all projects:
Enable in Cursor Settings
After adding the configuration:
1. Open Cursor IDE
2. Go to Settings > Cursor Settings > MCP
3. Enable the @reapi/mcp-openapi server
4. Click the refresh icon next to the server to apply changes
> **Note**: By default, Cursor requires confirmation for each MCP tool execution. If you want to allow automatic execution without confirmation, you can enable Yolo mode in Cursor settings.
The server is now ready to use. When you add new OpenAPI specifications to your directory, you can refresh the catalog by:
1. Opening Cursor's chat panel
2. Typing one of these prompts:
OpenAPI Specification Requirements
1. Place your OpenAPI 3.x specifications in the target directory:
- Supports both JSON and YAML formats
- Files should have .json, .yaml, or .yml extensions
- Scanner will automatically discover and process all specification files
2. Specification ID Configuration:
- By default, the filename (without extension) is used as the specification ID