#MCP arch

1 messages · Page 1 of 1 (latest)

white spade
#

Hey all - would appreciate some help on a technical question.
For both Claude and ChatGPT, who is the actual MCP client in the web app and the desktop app? Do those clients connect directly to an MCP server, or is there some proxy/bridge layer in between?
If they don’t connect directly, why, and what’s the way to connect to a private MCP server?

north hillBOT
#

Hi @white spade. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources only describe OpenAI’s side of MCP (ChatGPT, API, Agents SDK) and do not cover Anthropic/Claude at all, so I can’t answer anything specific about Claude’s architecture.

From the OpenAI docs, here’s what is clear about ChatGPT / OpenAI:

Who is the MCP “client”?

Conceptually, MCP has three roles:

  • Host – the application that embeds the model (e.g., ChatGPT, Codex, your own agent).
  • Client – the MCP connection inside that host, which speaks the MCP transport.
  • Server – the external tool / data provider you run. [MCP in Codex]

In OpenAI’s ecosystem:

  • In ChatGPT (web or desktop), ChatGPT itself is the host, and it runs an internal MCP client that connects to your MCP server when you configure an app/connector.
  • In API-based agents (using openai-agents-python), your Python process is the host, and classes like MCPServerStreamableHttp, MCPServerSse, or MCPServerStdio act as the MCP client. [Agents MCP overview]

Is there a proxy/bridge, or does it connect “directly”?

For API usage (Responses API + hosted MCP tool):

  • You declare an MCP tool with "type": "mcp" and a server_url (or connector_id for OpenAI-maintained connectors).
  • The OpenAI runtime (Responses API backend) then:
#

So the model does not talk to your MCP server directly; the OpenAI backend is effectively the MCP client/proxy on the model’s behalf.

For ChatGPT apps:

  • You register your MCP server URL in ChatGPT settings / Apps & Connectors.
  • ChatGPT then connects to that remote MCP server when you use the app in chat or deep research. [Build MCP server; Test & connect MCP server]

The docs don’t spell out every internal hop, but they do emphasize that:

  • Remote MCP servers are “any server on the public Internet that implements a remote MCP server,” and
  • OpenAI discards header values and most of the server_url after each request, implying that the OpenAI service is the one making those HTTP/SSE calls, not the browser directly. [MCP & connectors; MCP tool guide]

Why not connect directly from the client?

The docs don’t explicitly give design reasons, but they do stress:

  • Security / trust: You should only connect to MCP servers you trust, and OpenAI warns that a malicious MCP server can exfiltrate anything in the model’s context. [Risks and safety]
  • Centralized control: The OpenAI runtime manages:
#

That all points to a deliberate design where the OpenAI backend is the MCP client, not the end-user browser/desktop app.

How to connect to a private MCP server?

You have two main paths:

  1. From ChatGPT (apps / connectors)

    • Host your MCP server somewhere reachable by ChatGPT (typically HTTPS on the public Internet).
    • In ChatGPT:
      1. Import your remote MCP server in Settings.
      2. Create an app in Apps & Connectors using your server_url.
      3. Optionally configure OAuth. [Test & connect MCP server; Build MCP server]

    This is the supported way to use a “private” MCP server with ChatGPT, as long as ChatGPT can reach it over the network (e.g., via a secure public endpoint or VPN arrangement).

  2. From your own backend / agents via API

    • Use the Responses API with an MCP tool:

      curl <https://api.openai.com/v1/responses> \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $OPENAI_API_KEY" \
        -d '{
          "model": "gpt-5",
          "tools": [
            {
              "type": "mcp",
              "server_label": "my_mcp",
              "server_url": "<https://your-private-mcp.example.com/sse",>
              "require_approval": "never"
            }
          ],
          "input": "Do something using my MCP server."
        }'
      

      [MCP & connectors quickstart]

    • Or, if you want your own process to be the MCP client (e.g., to talk to an MCP server only reachable inside your VPC), use the Agents Python SDK with MCPServerStreamableHttp, MCPServerSse, or MCPServerStdio:

#
     from agents import Agent, Runner
     from agents.mcp import MCPServerStreamableHttp
     from agents.model_settings import ModelSettings

     async with MCPServerStreamableHttp(
         name="Private MCP",
         params={"url": "<http://internal-mcp:8000/mcp"},>
         cache_tools_list=True,
     ) as server:
         agent = Agent(
             name="Assistant",
             instructions="Use the MCP tools to answer the questions.",
             mcp_servers=[server],
             model_settings=ModelSettings(tool_choice="required"),
         )
         result = await Runner.run(agent, "Add 7 and 22.")
         print(result.final_output)
     ```
     [[Streamable HTTP MCP](<https://openai.github.io/openai-agents-python/mcp/#2-streamable-http-mcp-servers>)]

In summary: for ChatGPT and the OpenAI API, the MCP “client” is the OpenAI-side runtime (or your own agent process), which talks to your MCP server over HTTP/SSE/Streamable HTTP; the browser/desktop app does not connect to the MCP server directly. For Claude, the knowledge sources don’t contain any information, so I can’t say how they implement this.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------