Retrieving MCP server details in Codex confirms how a configured server is expected to connect and what it exposes. Checking the stored configuration early helps prevent confusing failures caused by wrong endpoints, disabled entries, or mismatched transports.
Codex stores each MCP server entry by name in /~/.codex/config.toml with an enabled flag, transport settings (such as an http URL), and optional tool allow/deny lists and timeouts. The codex mcp get command prints the current configuration for one server, and --json returns a structured object suitable for review, diffing, or documentation.
Output may include internal URLs, command arguments, or environment variables depending on the server transport, so treat it as sensitive when copying into tickets or chat. If the server name is wrong or missing, the command prints no configuration, so confirm the configured server name before retrying. Re-run the command after server changes to confirm updates were saved as intended.
Related: How to list Codex MCP servers
Related: How to add an MCP server URL in Codex
Steps to get Codex MCP server details:
- Retrieve MCP server details in JSON format.
$ codex mcp get playwright-mcp --json { "name": "playwright-mcp", "enabled": true, "disabled_reason": null, "transport": { "type": "streamable_http", "url": "http://127.0.0.1:8931", "bearer_token_env_var": null, "http_headers": null, "env_http_headers": null }, "enabled_tools": null, "disabled_tools": null, "startup_timeout_sec": null, "tool_timeout_sec": null }Inspect transport, enabled_tools, and timeout fields to confirm the expected transport and runtime limits.
- Save the JSON output to a file for troubleshooting.
$ codex mcp get playwright-mcp --json > playwright-mcp.json
Configuration output may include internal URLs, command arguments, or environment variables; scrub secrets before sharing.
- Extract the transport type and URL from the saved JSON.
$ jq -r '.transport.type, .transport.url' playwright-mcp.json streamable_http http://127.0.0.1:8931
- Confirm the MCP server entry is enabled.
$ grep -n '"enabled":' playwright-mcp.json 3: "enabled": true,
Review transport.type and transport.url to confirm the expected endpoint.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
