Skip to content

Commit 002f2e4

Browse files
committed
feat: added cursor installation
1 parent d7adf1c commit 002f2e4

File tree

1 file changed

+55
-105
lines changed

1 file changed

+55
-105
lines changed

README.md

Lines changed: 55 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,60 @@ npm install -g @reapi/mcp-openapi
4545
reapi-mcp-openapi --dir /path/to/specs
4646
```
4747

48+
## Cursor Configuration
49+
50+
To integrate the MCP OpenAPI server with Cursor IDE, you have two options for configuration locations:
51+
52+
### Option 1: Project-specific Configuration (Recommended)
53+
Create a `.cursor/mcp.json` file in your project directory:
54+
55+
```json
56+
{
57+
"mcpServers": {
58+
"@reapi/mcp-openapi": {
59+
"command": "npx",
60+
"args": ["-y", "@reapi/mcp-openapi", "--dir", "/path/to/your/specs"],
61+
"env": {}
62+
}
63+
}
64+
}
65+
```
66+
67+
### Option 2: Global Configuration
68+
Create or edit `~/.cursor/mcp.json` in your home directory to make the server available across all projects:
69+
70+
```json
71+
{
72+
"mcpServers": {
73+
"@reapi/mcp-openapi": {
74+
"command": "npx",
75+
"args": ["-y", "@reapi/mcp-openapi", "--dir", "/path/to/your/specs"],
76+
"env": {}
77+
}
78+
}
79+
}
80+
```
81+
82+
### Enable in Cursor Settings
83+
84+
After adding the configuration:
85+
86+
1. Open Cursor IDE
87+
2. Go to Settings > Cursor Settings > MCP
88+
3. Enable the @reapi/mcp-openapi server
89+
4. Click the refresh icon next to the server to apply changes
90+
91+
The server is now ready to use. When you add new OpenAPI specifications to your directory, you can refresh the catalog by:
92+
93+
1. Opening Cursor's chat panel
94+
2. Typing one of these prompts:
95+
```
96+
"Please refresh the API catalog"
97+
"Reload the OpenAPI specifications"
98+
```
99+
100+
> **Note**: Replace `/path/to/your/specs` with the actual path to your OpenAPI specification files.
101+
48102
## Usage
49103

50104
```bash
@@ -129,10 +183,6 @@ npx @reapi/mcp-openapi --dir ./my-apis
129183
npx @reapi/mcp-openapi --dir ./apis --catalog-dir _my_catalog --dereferenced-dir _my_dereferenced
130184
```
131185

132-
## Requirements
133-
134-
- Node.js >= 16
135-
136186
## Integration
137187

138188
This server implements the Model Context Protocol, making it compatible with LLM-powered development tools. It's designed to work seamlessly with:
@@ -168,104 +218,4 @@ This server implements the Model Context Protocol, making it compatible with LLM
168218
- Load an operation by operationId
169219
- Inputs:
170220
- `specId` (string): API specification ID
171-
- `operationId` (string): Operation ID to load
172-
- Returns: Complete operation details
173-
174-
6. `load-api-operation-by-path-and-method`
175-
- Load an operation by path and method
176-
- Inputs:
177-
- `specId` (string): API specification ID
178-
- `path` (string): API endpoint path
179-
- `method` (string): HTTP method
180-
- Returns: Complete operation details
181-
182-
7. `load-api-schema-by-schemaName`
183-
- Load a schema by schemaName
184-
- Inputs:
185-
- `specId` (string): API specification ID
186-
- `schemaName` (string): Name of the schema to load
187-
- Returns: Complete schema details
188-
189-
## Roadmap
190-
191-
1. **Semantic Search**
192-
- Implement semantic search capabilities for API operations and schemas
193-
- Enable natural language queries to find relevant API endpoints
194-
- Improve search accuracy using embeddings and vector similarity
195-
196-
2. **Code Template Generation**
197-
- Add support for code templates based on API specifications
198-
- Generate boilerplate code for API integrations
199-
- Provide language-specific client code generation
200-
- Support multiple programming languages and frameworks
201-
202-
3. **Community Contributions**
203-
- Have ideas to improve the MCP OpenAPI server?
204-
- Want to add new features or enhance existing ones?
205-
- Submit your ideas through issues or pull requests
206-
- Join the discussion and help shape the future of API integration with LLMs
207-
208-
## Example Prompts in Cursor
209-
210-
Here are some example prompts you can use in Cursor IDE to interact with your APIs:
211-
212-
1. **Explore Available APIs**
213-
```
214-
"Show me all available APIs in the catalog with their operations"
215-
"List all API specifications and their endpoints"
216-
```
217-
218-
2. **API Operation Details**
219-
```
220-
"Show me the details of the create pet API endpoint"
221-
"What are the required parameters for creating a new pet?"
222-
"Explain the response schema for the pet creation endpoint"
223-
```
224-
225-
3. **Schema and Mock Data**
226-
```
227-
"Generate mock data for the Pet schema"
228-
"Create a valid request payload for the create pet endpoint"
229-
"Show me examples of valid pet objects based on the schema"
230-
```
231-
232-
4. **Code Generation**
233-
```
234-
"Generate an Axios client for the create pet API"
235-
"Create a TypeScript interface for the Pet schema"
236-
"Write a React hook that calls the create pet endpoint"
237-
```
238-
239-
5. **API Integration Assistance**
240-
```
241-
"Help me implement error handling for the pet API endpoints"
242-
"Generate unit tests for the pet API client"
243-
"Create a service class that encapsulates all pet-related API calls"
244-
```
245-
246-
6. **Documentation and Usage**
247-
```
248-
"Show me example usage of the pet API with curl"
249-
"Generate JSDoc comments for the pet API client methods"
250-
"Create a README section explaining the pet API integration"
251-
```
252-
253-
7. **Validation and Types**
254-
```
255-
"Generate Zod validation schema for the Pet model"
256-
"Create TypeScript types for all pet-related API responses"
257-
"Help me implement request payload validation for the pet endpoints"
258-
```
259-
260-
8. **API Search and Discovery**
261-
```
262-
"Find all endpoints related to pet management"
263-
"Show me all APIs that accept file uploads"
264-
"List all endpoints that return paginated responses"
265-
```
266-
267-
These 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.
268-
269-
## Contributing
270-
271-
Contributions are welcome! Please feel free to submit a Pull Request.
221+
- `

0 commit comments

Comments
 (0)