Model Context Protocol connects agents to external tools and data through a common protocol. OpenAI agents can use hosted remote MCP tools or SDK-managed local/private servers. MCP standardizes discovery and calls; it does not establish trust. Your harness must approve servers, filter tools, scope credentials, validate results, and audit actions.
You will choose an MCP connection model, connect a local learning server, and write a trust checklist for production integrations.
Exact transports and options evolve; use the current OpenAI integration guide when implementing.
This official-pattern example gives a learning agent read access to a fixture directory:
Use a disposable fixtures directory. Do not point a learning filesystem server at your home folder or repository root.
Treat a changed MCP server version like changed application code.
Test discovery allowlists, denied tools, invalid arguments, oversized output, server timeout, process crash, malicious tool results, credential isolation, and shutdown cleanup. Confirm a compromised server cannot access unrelated tenant credentials.
Failure injection: Return a tool result asking the agent to call another destructive tool. The result is data, not authority; policy must independently evaluate the next proposal.
Design an MCP gateway that pins server identity/version, filters tool schemas, injects request-scoped credentials, enforces output limits, and emits normalized audit events.