OpenAI Agents API returns 424 mcp_server_startup_failed. Fix the MCP connection
HTTP 424 mcp_server_startup_failed means a required MCP server did not initialize. Fix connection_origin, URL/credentials, or stdio command/cwd, then retry. Short answer: 5 steps. 1) Confirm it is mcp_server_startup_failed, not a turn failure; 2) Match connection_origin to where the server is reachable; 3) Fix credentials and vault matching for HTTP servers; 4) For stdio, prove the command and absolute cwd in the environment; 5) Decide whether the server must be required, then retry.
Last updated: · This page is the decision checklist; the tools list for “Fix OpenAI Agents API mcp_server_startup_failed” is a separate URL.
How do I fix connection_origin, credentials, or stdio when Agents API returns 424?
Confirm it is mcp_server_startup_failed, not a turn failure
On the HTTP response, read `error.code`. `mcp_server_startup_failed` is a 424 request error: an MCP server failed to start. For failures after a turn began, inspect `agent.session.turn.failed` instead. Use `error.code` in logic and `error.message` for humans. Errors guide: https://developers.openai.com/api/docs/guides/agents-api/errors
Match connection_origin to where the server is reachable
HTTP with `connection_origin: "service"` (default) is dialed from OpenAI—no session environment required. Use `connection_origin: "environment"` for private URLs or localhost inside the session environment (`self_hosted` or `openai_hosted`). Stdio always runs as a process in the environment. A localhost URL with the wrong origin fails to connect. MCP guide: https://developers.openai.com/api/docs/guides/agents-api/tools/mcp
Fix credentials and vault matching for HTTP servers
Anonymous servers omit auth. Otherwise set `transport.authorization` / `transport.headers` on the session, or attach vault credentials via `vault_ids` for OpenAI-origin HTTP (vault credentials match the server URL; pick `credential_id` when several match). Environment-origin HTTP does not use vault credentials—use inline auth or a trusted proxy. Keep secrets out of reusable agent definitions and logs.
For stdio, prove the command and absolute cwd in the environment
`command` and an absolute existing `cwd` are required; `args` is optional. Install the server and dependencies in the environment first, then run the same command manually in that environment. Supply secrets through `transport.env_vars` (names of env vars present in the environment). Check MCP process logs when a required server still fails. Docs: https://developers.openai.com/api/docs/guides/agents-api/tools/mcp
Decide whether the server must be required, then retry
`required: true` fails the turn if the server cannot initialize; initialization is optional by default. After fixing URL, origin, credentials, or stdio setup, create a new session (or retry the create) with the corrected tool config. Narrow discovery with `allowed_tools` once the server starts cleanly.
Which tools are best to fix OpenAI Agents API mcp_server_startup_failed?
Agents API MCP connections
service vs environment origin, stdio setup, auth, and Troubleshoot connections.
Agents API errors
Documents HTTP 424 mcp_server_startup_failed and recovery flow.
Create session reference
MCP tool fields including required and allowed_tools (linked from the MCP guide).
OpenAI Platform
Inspect API keys, vault credentials, and recent Agents API requests.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Fix OpenAI Agents API mcp_server_startup_failed” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.