Connect OpenAI Agents SDK tools to MCP servers
Answer: The OpenAI Agents Python SDK can attach Model Context Protocol servers so an agent can call those tools. Hosted MCP is also one of the SDK tool categories, alongside FunctionTool and other local or hosted tools. Connect only to servers you trust.
MCP in the SDK
The Model Context Protocol standardizes how applications provide context to LLMs. The Agents Python SDK understands multiple MCP transports. You can reuse existing MCP servers, or build one that exposes filesystem, HTTP, or connector tools. Trust a server before you connect. Those tools may expose data from the model context, and they can perform actions once you supply credentials. Only connect to servers you trust. Use least-privilege credentials. Put access tokens in authorization fields or headers, not URLs, and require approval for sensitive operations. Choose an MCP integration first: decide where tool calls should execute and which transports you can reach.
Tools catalog
Tools let agents take actions such as fetching data, running code, and calling external APIs. The SDK supports hosted OpenAI tools that execute on OpenAI servers; local or runtime tools such as ComputerTool and ShellTool; FunctionTool instances that wrap any Python function; agents as tools; and an experimental Codex tool. Hosted OpenAI tools include web search, file search, code interpreter, hosted MCP, and image generation. Use a connected MCP server or FunctionTool when the tool should run in your own process or against your own server.
| MCP | FunctionTool | |---|---| | Hosted MCP | OpenAI-managed hosted tools | | MCP transports | connected MCP servers in the SDK | | FunctionTool | a wrapped Python function | | ComputerTool / ShellTool | local or runtime execution |
See also
Claims
- id: C1 claim: The Agents SDK understands multiple MCP transports so you can reuse or build MCP servers. source: S1 evidence: "The Agents Python SDK understands multiple MCP transports"
- id: C2 claim: Connect only to MCP servers you trust and use least-privilege credentials. source: S1 evidence: "Connect only to servers you trust"
- id: C3 claim: Hosted MCP is listed among the SDK hosted OpenAI tools, alongside FunctionTool and local runtime tools. source: S2 evidence: "web search, file search, code interpreter, hosted MCP"
Sources
- [S1] MCP. OpenAI Agents SDK. https://openai.github.io/openai-agents-python/mcp/ . License: MIT. Accessed 2026-11-19.
- [S2] Tools. openai/openai-agents-python (GitHub). https://github.com/openai/openai-agents-python/blob/main/docs/tools.md . License: MIT. Accessed 2026-11-19.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK, MCP; openai/openai-agents-python (GitHub), Tools. MIT; MIT. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK, MCP; openai/openai-agents-python (GitHub), Tools. MIT; MIT.
Cite this
iinventedlight. 2026. "Connect OpenAI Agents SDK tools to MCP servers." iinventedlight Library, iil:note:dr2h99nx, version of 2026-11-19. https://iinventedlight.com/library/notes/openai-agents-mcp/. License: CC-BY-4.0.
@misc{iil_note_dr2h99nx,
author = {{iinventedlight}},
title = {{Connect OpenAI Agents SDK tools to MCP servers}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-19},
url = {https://iinventedlight.com/library/notes/openai-agents-mcp/},
note = {Permanent ID iil:note:dr2h99nx. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- openai-agents-mcp.table.json (table; CC-BY-4.0)
- openai-agents-mcp.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/openai-agents-mcp.md.