How to connect Fine Structure to Codex with MCP

Here's how to connect Codex to Fine Structure so that Codex can read, edit, and validate apps through a limited MCP token.

Codex is a great fit when you want an agent that understands code, knows how to work inside a project, and can use external tools in a controlled way. Once MCP is connected, Codex can use Fine Structure's tools instead of guessing how the app is built.

A shared connection: In Codex, the CLI and the IDE extension use the same MCP configuration through config.toml.

One configuration: You add a server named fine_structure, point it at https://finestructure.ai/api/mcp, and add Authorization.

Permission control: Permissions are still set inside Fine Structure on the /mcp page, not inside Codex.

Create a token before editing Codex

Open the MCP page in Fine Structure, choose permissions, then copy the token into config.toml or into an environment variable.

The simplest way

[mcp_servers.fine_structure]
url = "https://finestructure.ai/api/mcp"
http_headers = { "Authorization" = "Bearer fse2_mcp_<token>" }
[mcp_servers.fine_structure]
url = "https://finestructure.ai/api/mcp"
bearer_token_env_var = "FINE_STRUCTURE_MCP_TOKEN"

Once the server is connected

Important: If you're using an environment variable, the value should be the token itself only, without the word Bearer. Codex adds the Authorization header based on the bearer_token_env_var setting.