Use with Cursor
Two minutes from zip file to working tools. The snippet below uses the Petstore sample.
Config lives at ~/.cursor/mcp.json. The shape is the same mcpServers map.
- Unzip the project and run
npm installinside it. - Create
~/.cursor/mcp.jsonwith the JSON below. - Replace the path with your project's absolute path and add your key.
- Open Cursor's agent panel — your endpoints are now callable tools.
For your own API, the generated zip also contains clients/cursor-mcp.json — copy that block in instead, replacing __ABS_PATH__ with the absolute path of the unzipped project.
{
"mcpServers": {
"petstore": {
"command": "npx",
"args": [
"tsx",
"/absolute/path/to/openapi2mcp-petstore/server.ts"
],
"env": {
"API_BASE_URL": "https://petstore3.swagger.io/api/v3",
"API_KEY": "your-api-key"
}
}
}
}