Home / MCP / MCP OpenAI Server
Provides an MCP-backed bridge to OpenAI models for Claude, enabling direct model usage via simple chat interactions.
Configuration
View docs{
"mcpServers": {
"mcp_openai": {
"command": "npx",
"args": [
"-y",
"@mzxrai/mcp-openai@latest"
],
"env": {
"OPENAI_API_KEY": "YOUR_API_KEY"
}
}
}
}You can run a dedicated MCP server that lets Claude seamlessly access OpenAI’s chat models. This server translates your requests into OpenAI API calls and returns the responses, so you can chat with models like gpt-4o or o1-* directly from Claude.
When you want to use OpenAI models from Claude, enable the OpenAI MCP server in your Claude Desktop setup. Start a chat, and ask Claude to route conversations through the OpenAI models. You can reference a specific model by name, for example asking about o1 or gpt-4o to see how it responds. The server supports models including gpt-4o, gpt-4o-mini, o1-preview, and o1-mini, with gpt-4o as the default.
Prerequisites: Node.js >= 18, Claude Desktop app, OpenAI API key.
Install the MCP server entry in Claude Desktop by configuring the MCP server settings as shown:
{
"mcpServers": {
"mcp-openai": {
"command": "npx",
"args": ["-y", "@mzxrai/mcp-openai@latest"],
"env": {
"OPENAI_API_KEY": "your-api-key-here (get one from https://platform.openai.com/api-keys)"
}
}
}
}1) Ensure you have a valid OpenAI API key and set it in the environment as shown above. 2) Restart Claude Desktop if needed to load the new MCP server. 3) Start a chat and mention a model (for example, "What does gpt-4o think about this?") to route the request through the MCP server.
This MCP integration is in alpha and may have rough edges. If you encounter issues, check the MCP logs for clues and confirm the API key is correctly set.
If you are developing locally, you can run the MCP server in development mode to test changes or build updates. This process is separate from your Claude Desktop usage and is intended for contributors.
Sends messages to OpenAI's chat completion API. Requires a messages array and allows selecting a model (defaults to gpt-4o).