MCP with OpenAI Agents SDK
The current Agents SDK supports three main modern MCP paths: hosted remote MCP through the Responses API, application-managed Streamable HTTP, and local stdio. Legacy SSE remains for compatibility but is deprecated by MCP for new work.
Choose by execution boundary
| Need | Option |
|---|---|
| OpenAI-hosted call to public remote MCP | HostedMCPTool |
| Your app owns HTTP connection | MCPServerStreamableHttp |
| Local subprocess | MCPServerStdio |
Production features
The SDK includes tool filtering, approval policies, tool-list caching, per-call metadata, pagination, multiple-server management, and tracing.
Security
Connect only trusted servers, use least-privilege credentials, keep tokens in headers/auth fields, and require approval for sensitive actions.