Use with Claude Desktop
Two minutes from zip file to working tools. The snippet below uses the Petstore sample.
Config lives at ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
- Unzip the generated project and note its absolute path.
- Run
npm install, thencp .env.example .envand add your key. - Merge the JSON below into your config file.
- Fully quit and restart Claude Desktop; the server appears under available tools.
For your own API, the generated zip also contains clients/claude-desktop.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"
}
}
}
}