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. - Loads multiple OpenAPI specifications from a directory - Exposes API operations and schemas through MCP protocol - Enables LLMs to
Add this skill
npx mdskills install ReAPI-com/mcp-openapiWell-documented MCP server providing comprehensive OpenAPI integration with 7 tools and excellent setup guidance
1# @reapi/mcp-openapi23A 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.45## Features67- Loads multiple OpenAPI specifications from a directory8- Exposes API operations and schemas through MCP protocol9- Enables LLMs to understand and work with your APIs directly in your IDE10- Supports dereferenced schemas for complete API context11- Maintains a catalog of all available APIs1213## Powered by [ReAPI](https://reapi.com)1415This open-source MCP server is sponsored by [ReAPI](https://reapi.com), 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:1617### ๐จ API CMS18- Design APIs using an intuitive no-code editor19- Generate and publish OpenAPI specifications automatically20- Collaborate with team members in real-time21- Version control and change management2223### ๐งช API Testing24- The most developer-friendly no-code API testing solution25- Create and manage test cases with an intuitive interface26- Powerful assertion and validation capabilities27- Serverless cloud test executor28- Perfect for both QA teams and developers29- CI/CD integration ready3031Try ReAPI for free at [reapi.com](https://reapi.com) and experience the future of API development.3233## Cursor Configuration3435To integrate the MCP OpenAPI server with Cursor IDE, you have two options for configuration locations:3637### Option 1: Project-specific Configuration (Recommended)38Create 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 projects3940```json41{42 "mcpServers": {43 "@reapi/mcp-openapi": {44 "command": "npx",45 "args": ["-y", "@reapi/mcp-openapi@latest", "--dir", "./specs"],46 "env": {}47 }48 }49}50```5152> **Tip**: Using a relative path like `./specs` makes the configuration portable and easier to share across team members.53>54> **Note**: We recommend using `@latest` tag as we frequently update the server with new features and improvements.55>56> **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.5758### Option 2: Global Configuration59Create or edit `~/.cursor/mcp.json` in your home directory to make the server available across all projects:6061```json62{63 "mcpServers": {64 "@reapi/mcp-openapi": {65 "command": "npx",66 "args": ["-y", "@reapi/mcp-openapi@latest", "--dir", "/path/to/your/specs"],67 "env": {}68 }69 }70}71```7273### Enable in Cursor Settings7475After adding the configuration:76771. Open Cursor IDE782. Go to Settings > Cursor Settings > MCP793. Enable the @reapi/mcp-openapi server804. Click the refresh icon next to the server to apply changes8182> **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](https://docs.cursor.com/context/model-context-protocol#yolo-mode) in Cursor settings.8384The server is now ready to use. When you add new OpenAPI specifications to your directory, you can refresh the catalog by:85861. Opening Cursor's chat panel872. Typing one of these prompts:88 ```89 "Please refresh the API catalog"90 "Reload the OpenAPI specifications"91 ```9293### OpenAPI Specification Requirements94951. Place your OpenAPI 3.x specifications in the target directory:96 - Supports both JSON and YAML formats97 - Files should have `.json`, `.yaml`, or `.yml` extensions98 - Scanner will automatically discover and process all specification files991002. Specification ID Configuration:101 - By default, the filename (without extension) is used as the specification ID102 - To specify a custom ID, add `x-spec-id` in the OpenAPI info object:103 ```yaml104 openapi: 3.0.0105 info:106 title: My API107 version: 1.0.0108 x-spec-id: my-custom-api-id # Custom specification ID109 ```110111 > **Important**: Setting a custom `x-spec-id` is crucial when working with multiple specifications that have:112 > - Similar or identical endpoint paths113 > - Same schema names114 > - Overlapping operation IDs115 >116 > The spec ID helps distinguish between these similar resources and prevents naming conflicts. For example:117 > ```yaml118 > # user-service.yaml119 > info:120 > x-spec-id: user-service121 > paths:122 > /users:123 > get: ...124 >125 > # admin-service.yaml126 > info:127 > x-spec-id: admin-service128 > paths:129 > /users:130 > get: ...131 > ```132 > Now you can reference these endpoints specifically as `user-service/users` and `admin-service/users`133134## How It Works1351361. The server scans the specified directory for OpenAPI specification files1372. It processes and dereferences the specifications for complete context1383. Creates and maintains a catalog of all API operations and schemas1394. Exposes this information through the MCP protocol1405. IDE integrations can then use this information to:141 - Provide API context to LLMs142 - Enable intelligent code completion143 - Assist in API integration144 - Generate API-aware code snippets145146147## Tools1481491. `refresh-api-catalog`150 - Refresh the API catalog151 - Returns: Success message when catalog is refreshed1521532. `get-api-catalog`154 - Get the API catalog, the catalog contains metadata about all openapi specifications, their operations and schemas155 - Returns: Complete API catalog with all specifications, operations, and schemas1561573. `search-api-operations`158 - Search for operations across specifications159 - Inputs:160 - `query` (string): Search query161 - `specId` (optional string): Specific API specification ID to search within162 - Returns: Matching operations from the API catalog1631644. `search-api-schemas`165 - Search for schemas across specifications166 - Inputs:167 - `query` (string): Search query168 - `specId` (optional string): Specific API specification ID to search169 - Returns: Matching schemas from the API catalog1701715. `load-api-operation-by-operationId`172 - Load an operation by operationId173 - Inputs:174 - `specId` (string): API specification ID175 - `operationId` (string): Operation ID to load176 - Returns: Complete operation details1771786. `load-api-operation-by-path-and-method`179 - Load an operation by path and method180 - Inputs:181 - `specId` (string): API specification ID182 - `path` (string): API endpoint path183 - `method` (string): HTTP method184 - Returns: Complete operation details1851867. `load-api-schema-by-schemaName`187 - Load a schema by schemaName188 - Inputs:189 - `specId` (string): API specification ID190 - `schemaName` (string): Name of the schema to load191 - Returns: Complete schema details192193## Roadmap1941951. **Semantic Search**196 - Enable natural language queries for API operations and schemas197 - Improve search accuracy with semantic understanding1981992. **Remote Specs Sync**200 - Support syncing OpenAPI specifications from remote sources2012023. **Code Templates**203 - Expose code templates through MCP protocol204 - Provide reference patterns for LLM code generation2052064. **Community Contributions**207 - Submit feature requests and bug reports208 - Contribute to improve the server209210## Example Prompts in Cursor211212Here are some example prompts you can use in Cursor IDE to interact with your APIs:2132141. **Explore Available APIs**215 ```216 "Show me all available APIs in the catalog with their operations"217 "List all API specifications and their endpoints"218 ```2192202. **API Operation Details**221 ```222 "Show me the details of the create pet API endpoint"223 "What are the required parameters for creating a new pet?"224 "Explain the response schema for the pet creation endpoint"225 ```2262273. **Schema and Mock Data**228 ```229 "Generate mock data for the Pet schema"230 "Create a valid request payload for the create pet endpoint"231 "Show me examples of valid pet objects based on the schema"232 ```2332344. **Code Generation**235 ```236 "Generate an Axios client for the create pet API"237 "Create a TypeScript interface for the Pet schema"238 "Write a React hook that calls the create pet endpoint"239 ```2402415. **API Integration Assistance**242 ```243 "Help me implement error handling for the pet API endpoints"244 "Generate unit tests for the pet API client"245 "Create a service class that encapsulates all pet-related API calls"246 ```2472486. **Documentation and Usage**249 ```250 "Show me example usage of the pet API with curl"251 "Generate JSDoc comments for the pet API client methods"252 "Create a README section explaining the pet API integration"253 ```2542557. **Validation and Types**256 ```257 "Generate Zod validation schema for the Pet model"258 "Create TypeScript types for all pet-related API responses"259 "Help me implement request payload validation for the pet endpoints"260 ```2612628. **API Search and Discovery**263 ```264 "Find all endpoints related to pet management"265 "Show me all APIs that accept file uploads"266 "List all endpoints that return paginated responses"267 ```268269These prompts demonstrate how to leverage the MCP server's capabilities for API development. Feel free to adapt them to your specific needs or combine them for more complex tasks.270271## Contributing272273Contributions are welcome! Please feel free to submit a Pull Request.
Full transparency โ inspect the skill content before installing.