OpenAI API Claude Desktop Config
Add the OpenAI API MCP server to Claude Desktop with this ready-to-use configuration.
Setup Instructions
- Open Claude Desktop
- Go to Settings → Developer → Edit Config →
claude_desktop_config.json - Paste the JSON below into the file
- Set your API Key in the
envsection - Restart Claude Desktop
Configuration JSON
Copy the entire block into your claude_desktop_config.json
{
"mcpServers": {
"openai": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-openai"
],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Environment Variables
OPENAI_API_KEYReplace sk-... with your actual openai api key
Endpoints
POST
/v1/chat/completionsCreate chat completion
POST
/v1/images/generationsGenerate image
POST
/v1/embeddingsCreate embeddings