Can I Use MCP With OpenAI? The API Level Answer Most Guides Skip Over
Almost every guide on this topic actually means ChatGPT the app. I tested MCP at the OpenAI API level specifically, building an agent that calls MCP tools directly through code rather than through the chat interface.
Alex Chen
July 11, 2026
1. Introduction
Yes, and this is a genuinely different question than asking whether ChatGPT the app supports MCP. At the API level, OpenAI lets developers connect remote MCP servers directly inside code, without touching the ChatGPT chat interface at all, and I built a small working agent this way specifically to understand how it differs from the Developer Mode approach most guides focus on.
2. The Problem: API Support And ChatGPT App Support Are Not The Same Thing
Most content about OpenAI and MCP is really about ChatGPT's Developer Mode, which is a consumer facing chat feature. The API level integration is a separate surface entirely, aimed at developers building their own applications and agents, with its own documentation, its own authentication patterns, and its own quirks that have nothing to do with the chat app's settings menu.
3. Causes And Fixes: Every Common API Integration Issue
- Confusing the Responses API with the older Chat Completions API when looking for MCP tool support, MCP integration is built around the newer Responses API and the Agents SDK, not the legacy completions endpoint
- MCP server URL rejected during a request: confirm you are passing a fully qualified HTTPS URL in the tool configuration, and that the server implements the remote MCP transport correctly, local stdio servers are not directly callable from the hosted API
- Authentication errors calling a protected MCP server: the API expects you to handle OAuth or API key exchange yourself before or during the request, unlike ChatGPT's Developer Mode, which manages some of this through its own UI flow
- Tool call succeeds but response formatting looks wrong in your application: check you are correctly parsing the mixed content blocks in the API response rather than assuming a single plain text field, MCP responses can include multiple content types in one result
- Rate limit errors appearing faster than expected: remember MCP tool calls consume tokens and count against your standard API rate limits just like any other request, high frequency tool use adds up quickly at scale
4. Examples: Complete Working MCP Integration Through The API
# Minimal example calling a remote MCP server through the OpenAI API
# Requires the openai Python package
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4o",
input="What is the current status of ticket ENG-482?",
tools=[
{
"type": "mcp",
"server_label": "linear",
"server_url": "https://mcp.linear.app/sse",
"require_approval": "never"
}
]
)
for item in response.output:
if item.type == "message":
for block in item.content:
if block.type == "output_text":
print(block.text)This example points the API directly at a remote MCP server without any ChatGPT interface involved at all. The require_approval setting controls whether the model needs explicit confirmation before calling a tool, which matters a lot more in a programmatic context than in a chat, since there is no human sitting there to approve each individual call unless you build that step into your own application.
5. Common Mistakes
- Setting require_approval to never on a write capable server without building your own safety checks first, this removes the human in the loop protection entirely
- Assuming ChatGPT's Developer Mode connector list automatically applies to API calls, it does not, these are entirely separate configurations
- Not handling partial or failed tool calls gracefully in application code, since a production agent needs to handle a tool error without crashing the whole response flow
- Forgetting to monitor token usage from tool results specifically, since large MCP tool responses can silently consume a significant portion of your context budget
6. Best Practices
Keep require_approval set to a manual review mode for any tool capable of writing or deleting data until you have enough production confidence to automate it. Log every tool call and its result for debugging and auditing, since a silent tool failure in a production agent is much harder to catch than a failure in an interactive chat session where a person notices immediately. Test with a read only MCP server first, exactly like the chat app approach, before wiring in anything that changes real data.
7. FAQ
- Is this the same feature as ChatGPT Developer Mode: no, this is a separate API level integration for developers building their own applications, not the consumer chat interface
- Do I need the Agents SDK specifically, or does the raw API work: the raw Responses API supports MCP tools directly as shown above, the Agents SDK is a higher level convenience layer on top of the same underlying capability
- Does this work with older OpenAI models: MCP tool support is tied to models compatible with the Responses API, check current model documentation before assuming older models support this the same way
- Is API level MCP usage billed differently than normal API calls: no, tool calls and their responses are billed as part of standard token usage rather than as a separate line item
8. Conclusion
OpenAI's API level MCP support is real, well documented for developers, and completely independent of whatever ChatGPT the consumer app is doing with Developer Mode. If your actual goal is building your own agent or application rather than using the chat interface, this is the path to look at, and it is arguably more flexible than the chat app version since you control every part of the approval and error handling flow yourself.