Does Responses API call MCP server from OpenAI cloud or from local?

Does OpenAI Responses API invoke the MCP server from OpenAI’s cloud? Or does it invoke MCP from my local machine that is calling the OpenAI Response API? I suspect it is the former. I want to make my MCP servers available within my company’s network but not to the public internet. What is the best practice?

1 Like

That’s no longer the case. MCP support in Response API was released today: https://openai.com/index/new-tools-and-features-in-the-responses-api/

1 Like

It’s designed to talk to a remote server over https.

So you are going to need to either:

  1. deploy your MCP server onto a cloud server (by far the best approach especially once you are live)
  2. expose your local development server (temporarily) via some service, e.g.:
3 Likes

Wha-!? I wish they let us subscribe for emails like that. Thanks for sharing!

They do!

Select the bell drop down on Announcements and click “Watching First Post”.

You will be notified on every new Topic (if not online this should be via email):

2 Likes

How about creating a local SSE - HTTP endpoint for the MCP server to connect to? I did not try it but you may set up your local MCP as a local server with SSE and HTTP endpoint, and then configure it to start automatically whenever you turn on your computer. I use Windows; in my case, I let the task scheduler open the Python-based local MCP server with an HTTP endpoint. Then, I may connect the MCP server to OpenAI response API when I run my app locally.

When I have some time, I will write the code and see whether it will work and keep you posted.

The basic approach is to implement the MCP server as a tool (previously a function).
When the model determines it needs to use the MCP server, it will return a tool call in the response. Your app can then handle that and trigger the server locally.

Here’s the relevant guide from the docs regarding tools:

https://platform.openai.com/docs/guides/function-calling?api-mode=responses

If your functions are local, what is the point of using an MCP set-up?

Your local functions are known to you, so you can just add them to context as we have always done.

If you set up an MCP server for your local functions, you are then expecting OpenAI to make a call back to your parallel service over a different channel. This makes zero sense to me.

It only makes sense to me to set up an MCP server if you are intending on deploying it remotely for third party consumers.

1 Like

The main point is that one doesn’t need to adapt the MCP clients if the underlying API changes. This is abstracted away by the MCP protocol, via the server.

Otherwise, I agree. MCP can be over engineering if the actual use case is simple.

2 Likes

I tried the HTTP SSE localhost MCP server. It ran into a connection error. This is really meant for local testing. Ultimately, my goal is to have MCP servers running within an organization (not open to the public internet) so various agents can talk with tools/resources in a standardized way.

You have three options:

  1. Develop your MCP client side and rewrite the entire client pipeline using OpenAI’s APIs. This by itself defeat the purpose of using MCP integration in response AI. You need to write the client MCP from low-level. Here is a video course that teaches you to create MCP client: MCP: Build Rich-Context AI Apps with Anthropic - DeepLearning.AI

  2. Use OpenAI’s AgentSDK for MCP connection. Although I did not try it yet, I think they support stdio and very easy to adopt: Model context protocol (MCP) - OpenAI Agents SDK

  3. Create your own online MCP server. I have created multiple HTTP and API servers with Azure and Google Cloud. They involved and are sometimes hard to maintain if you are not familiar with the infrastructure. There are some alternative lightweight solutions such as Render [dot] com. I recently watched a workshop from DeepLearning AI. They described how to deploy an MCP server online with Render. Check this out: MCP: Build Rich-Context AI Apps with Anthropic - DeepLearning.AI

Finally, maybe tunneling might work too but I am not sure about this.

I hope these will be helpful. I am working on this issue myself as well, and I will test these steps and keep you posted if I find a solution.

1 Like

@merefield - You were very right in your suggestions. :folded_hands::clap: If you expose the local server via ngrok, Cloudflare, or LocalTunnel (npm), it connects Response API with ease. (Considering your security and privacy issue though)

I think we will soon get a new package or library that can create a client-server setup acting as an HTTPS server for response APIs. People might have already started working on this.

1 Like

thanks, yeah.

As ever challenging choices for enterprise:

"do we put it in the cloud? but … "

I’m looking forward to seeing some nice deno libraries. I did have a quick look … but nothing generic yet afaics.