This MCP server enables direct communication with OpenAI models through Claude using the MCP protocol. It supports o3-mini and gpt-4o-mini models, allowing you to query OpenAI directly from within Claude's interface.
git clone https://github.com/thadius83/mcp-server-openai
cd mcp-server-openai
# Install the package
pip install .
Modify your Claude Desktop MCP settings configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the following to your existing configuration:
{
"mcpServers": {
"github.com/thadius83/mcp-server-openai": {
"command": "python",
"args": [
"-m",
"src.mcp_server_openai.server",
"--openai-api-key",
"your-openai-api-key"
],
"env": {
"PYTHONPATH": "/path/to/mcp-server-openai"
},
"disabled": false,
"autoApprove": []
}
}
}
Insert your OpenAI API key in the configuration where it says "your-openai-api-key"
.
Set the correct PYTHONPATH to point to the full path of your cloned repository.
Restart Claude after saving the configuration changes.
Once installed, you can query OpenAI models directly from Claude using the ask-openai
tool:
<use_mcp_tool>
<server_name>github.com/thadius83/mcp-server-openai</server_name>
<tool_name>ask-openai</tool_name>
<arguments>
{
"query": "What's the difference between Lists and Tuples in Python?",
"model": "o3-mini"
}
</arguments>
</use_mcp_tool>
The server supports two OpenAI models:
You can specify which model to use in your query:
{
"query": "Explain quantum computing in simple terms",
"model": "gpt-4o-mini"
}
If you omit the model
parameter, it defaults to o3-mini
.
Server Not Connecting:
Invalid Configuration:
github.com/thadius83/mcp-server-openai
No Response from Server:
To test if the server is working correctly, try a simple query:
<use_mcp_tool>
<server_name>github.com/thadius83/mcp-server-openai</server_name>
<tool_name>ask-openai</tool_name>
<arguments>
{
"query": "Hello, are you working correctly?"
}
</arguments>
</use_mcp_tool>
If properly configured, you should receive a response from the OpenAI model.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.