MetorialDocs

Fix Codex MCP problems when connecting to Metorial

Fix a Metorial MCP server in Codex that lists no tools, times out at startup, or fails to sign in, with codex mcp login, /mcp verbose, and config.toml.

If Codex lists Metorial with no tools, run codex mcp login metorial. Codex can connect to an MCP server without credentials, and Metorial serves tools only after you sign in. Type /mcp verbose in Codex to see the server's status. The CLI, the IDE extension, and the ChatGPT desktop app share one config.toml, so each fix below applies to all three.

What you'll learn

  • How to fix sign-in, startup, and timeout problems
  • Which config.toml settings hide tools or disable the server
  • Where Codex writes its logs

Before you start

Sign-in

Metorial is listed but has no tools

Codex connected without a sign-in.

codex mcp login metorial

Inside a session, /mcp login metorial does the same. On Metorial's consent screen, select the integrations Codex may use.

The browser does not open

Print the URL, open it on any machine, and sign in:

codex mcp login metorial --no-browser

Paste the full redirect URL back into the terminal, even if the browser could not load the callback page.

redirect_uri is not allowed for this portal

Codex returns from the sign-in to a local address such as http://127.0.0.1:<port>/callback/<callback_id>, and the portal does not allow it. Metorial treats 127.0.0.1 as localhost. A portal admin opens Settings, Client Settings, and enables Localhost apps (http://localhost:*/*) under Allowed OAuth Redirects. From the CLI:

metorial-admin portals list
metorial-admin portals get <portal-id>
metorial-admin portals update <portal-id> \
  --allowed-redirect-url-filters '[{"url":"http://localhost:*/*"}]'

The command replaces the portal's whole list. Run portals get first and add the patterns your other clients still need. Then run codex mcp login metorial again.

The callback port is blocked or taken

Codex picks a local port for the callback. Set a fixed one in ~/.codex/config.toml. The portal's Localhost apps pattern accepts any port.

mcp_oauth_callback_port = 5555

Codex asks you to sign in again

A Metorial sign-in lasts 30 days from the last refresh, and it ends when the token is revoked. Run codex mcp login metorial.

Server and tools

Metorial is missing when Codex starts

Codex gives a server 10 seconds to start, and it waits only 1,000 milliseconds for optional servers before it builds the first tool list. Raise the startup limit and make Codex wait for it:

mcp_optional_startup_grace_ms = 0

[mcp_servers.metorial]
url = "<your-magic-mcp-url>"
startup_timeout_sec = 30

A project .codex/config.toml is ignored

Codex reads a project-scoped .codex/config.toml only in trusted projects. Trust the project in Codex, or add the server to ~/.codex/config.toml.

The server is disabled or blocked

enabled = false under [mcp_servers.metorial] disables the server. Remove the line.

An admin's managed requirements can also hold an approved list of MCP servers. A server that does not match cannot be enabled, and an empty list disables every MCP server. The admin adds an entry whose identity matches your Magic MCP URL:

[mcp_servers.metorial]
identity = { url = "<your-magic-mcp-url>" }

Some tools are missing

Look for enabled_tools and disabled_tools under [mcp_servers.metorial] in config.toml. enabled_tools is an allow list, and disabled_tools is applied after it. If neither is set, compare with what Metorial serves:

metorial list
metorial tools <integration-id>

If metorial tools prints the tool and Codex does not, the tool was left out when you connected Codex. Run codex mcp login metorial again and allow it on the consent screen. If metorial tools does not print it either, an admin's tool filter removes it.

Tool calls fail after a minute

Codex stops a tool call after 60 seconds by default. Raise the limit for the server:

[mcp_servers.metorial]
url = "<your-magic-mcp-url>"
tool_timeout_sec = 180

If the error text is The request exceeded the configured tenant timeout of <N>ms., the limit is Metorial's. An admin raises Message processing timeout in the project's Tool Calling settings.

Tool output is cut off

Codex truncates tool output to the model's default budget. Set a budget for one tool:

[mcp_servers.metorial.tools.<tool>]
output_token_limit = 20000

See the MCP logs

  • /mcp verbose in a session prints server diagnostics and the tool list.
  • codex mcp list in a shell prints every configured server.
  • Log files are in ~/.codex/log. Set log_dir in config.toml to also get the plaintext codex-tui.log.

Start over

codex mcp logout metorial
codex mcp login metorial

Start a new Codex session and type /mcp. Metorial appears with its tools.

To connect one integration without the browser sign-in, install it with the Metorial CLI. It creates a long-lived MCP token for that integration:

metorial list
metorial install codex <integration-id>

Next steps