Codex

Codex connects to Sajto with an API key passed from an environment variable. The configuration is shared by the Codex CLI, the IDE extension and the ChatGPT desktop app.

Requirements

  • Codex installed (the CLI, the IDE extension or the ChatGPT desktop app),
  • a Sajto account and an API key (see Account and API key).

ChatGPT in the browser does not read the local Codex configuration, so this guide does not apply to it.

Setup

  1. In the Sajto panel create an API key (for example codex) and copy it.

  2. Save the key in an environment variable, for example in your shell profile (~/.bashrc, ~/.zshrc):

    export SAJTO_API_KEY="sjt_…"
    
  3. Open ~/.codex/config.toml and add the server:

    [mcp_servers.sajto]
    url = "https://app.sajto.pl/mcp"
    bearer_token_env_var = "SAJTO_API_KEY"
    
  4. Restart Codex so that it sees the environment variable.

In the configuration file we store the name of the variable, not the key itself. That way the key does not end up in files you might publish by accident.

Project configuration lives in .codex/config.toml in the project directory (for trusted projects only). There too, store only the variable name, never the key itself.

Checking the connection

In a terminal run:

codex mcp list

In a Codex session (TUI) type /mcp to see the active servers. In the ChatGPT desktop app type /mcp in the message field.

First use

You

Use the sajto server: build a business-card site for the “Pod Lipą” bakery in Bobowa, slug podlipa, and publish it.

Alternative: OAuth sign-in

Codex uses OAuth sign-in by default (auth = "oauth"). If you prefer to sign in with your account instead of using a key, add the server without bearer_token_env_var and sign in:

codex mcp add sajto --url https://app.sajto.pl/mcp
codex mcp login sajto

Without a local browser use codex mcp login sajto --no-browser, open the printed address and paste the redirect address back into the terminal. Sajto supports the OAuth 2.1 standard with automatic client registration, but this path has not yet been checked with Codex.

Settings you can adjust

  • Name
    startup_timeout_sec
    Type
    default 10
    Description

    How long to wait for the server connection to start.

  • Name
    tool_timeout_sec
    Type
    default 60
    Description

    The maximum time of a single tool call. Increase it if long operations, such as analysing a reference site, exceed the limit.

  • Name
    enabled
    Description

    Lets you turn the server off without deleting its configuration.

More in the chapter Troubleshooting.

Was this page helpful?