Connect a remote HTTP MCP server

mcp & extensions

// what it does

For a remote server, add a [mcp_servers.NAME] table to config.toml with url = "https://…/mcp" and, for auth, bearer_token_env_var = "MY_TOKEN" so Codex reads the token from that env var. For OAuth-enabled servers, run codex mcp login NAME to authenticate; codex mcp get NAME prints the resolved config.

// shell

$ codex mcp login figma
$ codex mcp get figma

// gotcha

Do not put raw tokens in config.toml — bearer_token_env_var names an environment variable so the secret stays out of the committed file.

// resources