Loading...

MCP server enabling Claude to use OpenAI models via API calls, supporting multiple models and basic error handling.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
MCP server enabling Claude to use OpenAI models via API calls, supporting multiple models and basic error handling.
This server is relatively safe for read operations, but the ability to send messages to OpenAI's API introduces moderate risk. The primary risk stems from potential API key exposure and prompt injection vulnerabilities. It's safer when used in controlled environments with trusted users.
Performance depends on the OpenAI API response times. Network latency and API load can impact the overall performance. Consider using smaller models for faster responses.
Using this server incurs costs associated with OpenAI API usage, based on token consumption. Costs vary depending on the model used and the length of the prompts and responses.
{
"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)"
}
}
}
}OPENAI_API_KEYopenai_chatSends messages to OpenAI's chat completion API and returns the response.
Allows sending arbitrary messages to OpenAI, potentially triggering unintended actions or exposing sensitive data.
Environment Variable
This server is relatively safe for read operations, but the ability to send messages to OpenAI's API introduces moderate risk. The primary risk stems from potential API key exposure and prompt injection vulnerabilities. It's safer when used in controlled environments with trusted users.
Autonomy is limited by the capabilities exposed through the OpenAI API and the configuration of the MCP server. User input to Claude directly influences the prompts sent to OpenAI.
Production Tip
Monitor OpenAI API usage and costs to prevent unexpected charges. Implement rate limiting if necessary.
The server supports gpt-4o, gpt-4o-mini, o1-preview, and o1-mini.
Add the OPENAI_API_KEY environment variable to the mcpServers configuration in claude_desktop_config.json.
You can specify the model in the 'model' argument of the openai_chat tool. If not specified, it defaults to gpt-4o.
The MCP logs are located in ~/Library/Logs/Claude/mcp*.log on macOS.
The main risks are API key exposure and prompt injection. Ensure the API key is securely stored and sanitize user inputs.
While designed for Claude Desktop, it might be adaptable to other MCP-compatible clients with some modifications.
The server is installed via `npx @mzxrai/mcp-openai@latest`, so re-running that command will update it to the latest version.