logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-openai-interface-service

Facilitates connection to OpenAI's advanced language models via the Model Context Protocol (MCP) from Claude Desktop, enabling intricate, parameter-tuned interactions and autonomous multi-AI discussions, supplemented by live web information retrieval capabilities.

Author

mcp-openai-interface-service logo

billster45

No License

Quick Info

GitHub GitHub Stars 13
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

chatgptapisapiopenai chatgptchatgpt apichatgpt responses

MseeP.ai Security Assessment Badge

MCP ChatGPT Server

smithery badge

This MCP server grants direct conduit access to the OpenAI ChatGPT Application Programming Interface (API) specifically for utilization within the Claude Desktop environment.

📝 Elaborating on the genesis of this utility: I Built an AI That Talks to Other AIs: Demystifying the MCP Hype

Core Capabilities

  • Execute calls to the ChatGPT API while providing granular control over operational settings.
  • Orchestrate continuous dialogue sessions where Claude and ChatGPT engage in extended, back-and-forth communication!
  • Fine-tune settings such as the underlying model version, randomness (temperature), and other relevant execution parameters.
  • Integrate real-time web indexing to assimilate the most current data available on the internet.
  • Leverages OpenAI's Responses API mechanism for seamless, automatic persistence of conversational context.
  • Requires integration with your proprietary OpenAI secret key.

Deployment Procedures

Automated Installation via Smithery

To deploy the ChatGPT Server for Claude Desktop automatically using Smithery:

bash npx -y @smithery/cli install @billster45/mcp-chatgpt-responses --client claude

Prerequisites

  • Python interpreter version 3.10 or newer is mandatory.
  • The Claude Desktop client application.
  • A valid, active OpenAI API key.
  • The uv package manager for optimized Python dependency handling.

Manual Installation

  1. Obtain the repository source code: bash git clone https://github.com/billster45/mcp-chatgpt-responses.git cd mcp-chatgpt-responses

  2. Initialize an isolated Python environment and install required libraries using uv: bash uv venv

bash .venv\Scripts\activate

bash uv pip install -r requirements.txt

Integration with Claude Desktop

  1. Configure Claude Desktop to recognize this MCP service by consulting the guide located at: MCP Quickstart Guide

  2. Inject the subsequent configuration structure into your Claude Desktop configuration file (adjusting file paths as necessary):

{ "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" } } } }

  1. Restart the Claude Desktop application to apply changes.

  2. You can now invoke the ChatGPT capabilities from within Claude by posing queries that explicitly reference ChatGPT or address topics outside Claude's native knowledge domain.

Exposed Functionalities

The MCP service exposes the following callable methods:

  1. ask_chatgpt(prompt, model, temperature, max_output_tokens, response_id) - Transmits a directive to ChatGPT and retrieves the ensuing outcome.

  2. ask_chatgpt_with_web_search(prompt, model, temperature, max_output_tokens, response_id) - Sends a directive to ChatGPT, activating integrated web search for contemporary data integration.

Illustrative Execution Scenarios

Fundamental ChatGPT Interaction:

Instruct Claude to delegate a query to ChatGPT:

Use the ask_chatgpt tool to answer: What is the best way to learn Python?

Direct Claude to mediate a dialogue between itself and ChatGPT:

Use the ask_chatgpt tool to have a two way conversation between you and ChatGPT about the topic that is most important to you.

Observe how the utilization of the response_id parameter facilitates message history retention on ChatGPT's end, thus ensuring a genuine, flowing exchange rather than discrete, context-less calls. This mechanism is formalized as conversation state.

Leveraging Real-Time Data Retrieval:

For inquiries where recency is critical:

Use the ask_chatgpt_with_web_search tool to answer: What are the latest developments in quantum computing?

Now employ web search in an autonomous, planning capacity to devise an optimal itinerary for a day out, tailored to someone who appreciates gastronomy and green spaces, based on tomorrow's forecast:

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

Operational Mechanism

This utility harnesses OpenAI's Responses API, which inherently manages the continuity of the discussion history on OpenAI's backend infrastructure. This design choice confers several advantages:

  1. Streamlines development effort by offloading context management responsibilities to OpenAI.
  2. Establishes more robust and dependable tracking of contextual relevance.
  3. Enhances the end-user experience by preserving conversational thread continuity across multiple exchanges.
  4. Enables access to current external knowledge through the integrated web search functionality.

Licensing Information

MIT License

WIKIPEDIA: XMLHttpRequest (XHR) constitutes an Application Programming Interface embodied as a JavaScript construct designed to ferry HyperText Transfer Protocol (HTTP) requests from a web browser environment to a designated web server. The methods offered permit a browser-resident application to dispatch server queries subsequent to the initial page rendering completion, and subsequently retrieve pertinent data. XMLHttpRequest is an integral constituent of Ajax programming paradigms. Prior to Ajax's ascendancy, the mechanisms for server communication relied predominantly upon hyperlinks and form submissions, frequently necessitating a complete page refresh.

== Historical Context == The foundational concept underpinning XMLHttpRequest was formulated in the year 2000 by the development team behind Microsoft Outlook. This concept was subsequently realized within the Internet Explorer 5 browser release (1999). Nevertheless, the initial syntactic specification did not employ the explicit XMLHttpRequest identifier. Instead, developers utilized the object instantiation identifiers ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer version 7 (released in 2006), universal browser support for the standardized XMLHttpRequest identifier was achieved. The XMLHttpRequest identifier has now attained the status of the de facto universal standard across all primary web rendering engines, including Mozilla's Gecko engine (since 2002), Safari version 1.2 (2004), and Opera version 8.0 (2005).

=== Standardization Efforts === The World Wide Web Consortium (W3C) published the initial Working Draft specification governing the XMLHttpRequest object on April 5, 2006. Subsequently, on February 25, 2008, the W3C released the Level 2 specification for the Working Draft. The Level 2 additions introduced novel methods for tracking request progress events, enabling cross-origin requests, and facilitating the handling of binary byte streams. By the conclusion of 2011, the Level 2 specification revisions were formally integrated back into the core, original specification document. At the close of 2012, responsibility for ongoing development transitioned to the WHATWG, which maintains a dynamic, evolving specification document utilizing Web IDL notation.

== Operational Steps == Generally, executing a network request using XMLHttpRequest mandates adherence to several distinct programming phases.

  1. Instantiation: Create a new XMLHttpRequest object instance via its constructor method:
  2. Configuration: Invoke the "open" method to define the request methodology (GET/POST, etc.), specify the target resource Uniform Resource Identifier (URI), and select either synchronous or asynchronous processing mode:
  3. Listener Assignment (Asynchronous Only): For asynchronous operations, assign an event handler function that will be triggered upon changes to the request's state:
  4. Initiation: Command the request transmission by calling the "send" method, optionally including payload data:
  5. Response Handling: Monitor the state changes within the designated event listener. If the server returns payload data, it is typically aggregated within the "responseText" property by default. Upon completion of all processing, the object transitions to state 4, signifying the "done" state. Beyond these fundamental sequence steps, XMLHttpRequest encompasses numerous configuration levers to dictate request transmission protocol and response interpretation logic. Custom header fields can be appended to the outgoing request to convey specific server instructions, and data can be uploaded to the server by passing it as an argument to the "send" invocation. The received response data can be deserialized from the JavaScript Object Notation (JSON) format into a directly usable JavaScript structure, or processed incrementally as fragments arrive, bypassing the need to await the complete data stream. Furthermore, the request can be halted prematurely or configured to automatically fail if a defined time limit is exceeded.

== Cross-Domain Interactions ==

During the nascent stages of the World Wide Web's evolution, the capability to breach the same-origin policy was discovered to facilitate

See Also

`