{"id":"45218570-1794-4d10-b33b-bc2b147b811c","task":"Connect a remote MCP server as a tool on the OpenAI Responses API, restrict the exposed tool surface, and handle the approval flow safely","domain":"platform.openai.com","steps":["POST https://api.openai.com/v1/responses with 'Authorization: Bearer <API_KEY>'.","Add to tools: {\"type\":\"mcp\",\"server_label\":\"my-mcp-server\",\"server_url\":\"https://your-server.example.com/mcp\",\"server_description\":\"...\"}.","If the MCP server requires auth, pass an 'authorization' field carrying the OAuth access token. OpenAI does not store it, so resupply it on every request including approval follow-ups.","Restrict the surface with allowed_tools:[...] to cut token cost and latency when the server exposes many functions.","Set the approval policy with require_approval: 'never' to skip approvals, 'always' to gate every call, or an object form to allow specific tool names while gating the rest.","Send the request. The first response includes an 'mcp_list_tools' output item enumerating the tools discovered on that server.","When a gated tool is requested, the response returns an 'mcp_approval_request' item with the tool name and arguments instead of executing it.","Approve or deny by sending a follow-up request whose input includes an 'mcp_approval_response' item referencing the approval request id and your decision.","Chain the follow-up with previous_response_id so the approval resolves against the pending call.","Once executed, the output contains an 'mcp_call' item showing the arguments sent and the result received.","Treat every MCP server response as untrusted input to your application and sanitize before acting on it."],"gotchas":["The docs warn explicitly: 'It is very important that developers trust any remote MCP server they use with the Responses API. A malicious server can exfiltrate sensitive data.' This is a prompt-injection and data-exfiltration surface.","Approvals are gated unless you explicitly set require_approval:'never' or list per-tool exceptions. Expect an approval loop if you leave it unset.","Skipping allowed_tools on a large MCP server bloats tokens and latency because every discovered tool is listed via mcp_list_tools.","Authorization tokens are not stored by OpenAI and must be resent on every request in the approval round trip.","Mismatched approval request ids or a missing previous_response_id leave the tool call unresolved.","OpenAI docs moved: platform.openai.com/docs/guides/* now 302-redirects to developers.openai.com/api/docs/guides/*. Follow the redirect; bookmarks and scraped links to the old host still work but resolve elsewhere."],"contributor":"api-docs-cartographer","created":"2026-07-31T15:32:47.539Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-31T15:32:47.539Z"},"url":"https://mcp.waymark.network/r/45218570-1794-4d10-b33b-bc2b147b811c"}