This MCP server provides a bridge between Claude Desktop and OpenAI's ChatGPT API, enabling conversations between different AI models and access to the latest information through web search capabilities. It allows Claude to directly utilize ChatGPT's responses in seamless interactions.
The fastest way to install the ChatGPT Server for Claude Desktop is through Smithery:
npx -y @smithery/cli install @billster45/mcp-chatgpt-responses --client claude
Before installing manually, ensure you have:
Clone the repository:
git clone https://github.com/billster45/mcp-chatgpt-responses.git
cd mcp-chatgpt-responses
Set up a virtual environment and install dependencies:
uv venv
.venv\Scripts\activate
uv pip install -r requirements.txt
To configure Claude Desktop to use this MCP server:
Locate your Claude Desktop configuration file by following the MCP Quickstart Guide
Add the following configuration to your Claude Desktop config file (adjust paths as needed):
{
"mcpServers": {
"chatgpt": {
"command": "uv",
"args": [
"--directory",
"\\path\\to\\mcp-chatgpt-responses",
"run",
"chatgpt_server.py"
],
"env": {
"OPENAI_API_KEY": "your-api-key-here",
"DEFAULT_MODEL": "gpt-4o",
"DEFAULT_TEMPERATURE": "0.7",
"MAX_TOKENS": "1000"
}
}
}
}
Replace "your-api-key-here"
with your actual OpenAI API key
Restart Claude Desktop
The MCP server provides two main tools:
To ask ChatGPT a simple question through Claude:
Use the ask_chatgpt tool to answer: What is the best way to learn Python?
For questions requiring up-to-date information:
Use the ask_chatgpt_with_web_search tool to answer: What are the latest developments in quantum computing?
For a two-way conversation between both AI models:
Use the ask_chatgpt tool to have a two way conversation between you and ChatGPT about the topic that is most important to you.
Use ChatGPT's web search capabilities in an agentic way:
Use the ask_chatgpt_with_web_search tool to find the weather tomorrow in New York, then based on that weather and what it returns, keep using the tool to build up a great day out for someone who loves food and parks
Both tools accept the following parameters:
prompt
: The text to send to ChatGPTmodel
: ChatGPT model to use (defaults to value in config)temperature
: Controls randomness (0.0-2.0, defaults to value in config)max_output_tokens
: Maximum response length (defaults to value in config)response_id
: Used to maintain conversation state across messagesTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "chatgpt" '{"command":"uv","args":["--directory","\\path\\to\\mcp-chatgpt-responses","run","chatgpt_server.py"],"env":{"OPENAI_API_KEY":"your-api-key-here","DEFAULT_MODEL":"gpt-4o","DEFAULT_TEMPERATURE":"0.7","MAX_TOKENS":"1000"}}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"chatgpt": {
"command": "uv",
"args": [
"--directory",
"\\path\\to\\mcp-chatgpt-responses",
"run",
"chatgpt_server.py"
],
"env": {
"OPENAI_API_KEY": "your-api-key-here",
"DEFAULT_MODEL": "gpt-4o",
"DEFAULT_TEMPERATURE": "0.7",
"MAX_TOKENS": "1000"
}
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"chatgpt": {
"command": "uv",
"args": [
"--directory",
"\\path\\to\\mcp-chatgpt-responses",
"run",
"chatgpt_server.py"
],
"env": {
"OPENAI_API_KEY": "your-api-key-here",
"DEFAULT_MODEL": "gpt-4o",
"DEFAULT_TEMPERATURE": "0.7",
"MAX_TOKENS": "1000"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect