~/.codex/config.toml. The Codex CLI, the Codex IDE extension, and the ChatGPT desktop app share that file, so one entry gives every Codex session the SocialAPI tools. The server is https://api.social-api.ai/mcp.
Prerequisites
- Codex installed: CLI, IDE extension, or desktop app.
- A SocialAPI account with at least one connected account.
- For a machine without a browser: an API key.
Set up with the CLI
1
Add the server
2
Authorize
Log in and click Authorize. The terminal prints
Successfully logged in to MCP server 'socialapi'.3
Check the server
socialapi is listed as enabled with its auth method. In the Codex TUI, type /mcp to see the connected servers and their tools.codex mcp login socialapi.
Set up with the config file
1
Add the entry
codex mcp add writes this entry to ~/.codex/config.toml. You can also add it by hand, globally or in a trusted project’s .codex/config.toml:2
Authorize
Set up a headless machine with an API key
For CI jobs, containers, and any machine without a browser, skip OAuth and authenticate with an API key. Codex reads the key from an environment variable and sends it asAuthorization: Bearer.
1
Reference the variable
2
Set the variable
Limit the tools
To give Codex fewer tools, list the ones to keep inenabled_tools, or the ones to hide in disabled_tools. Codex applies disabled_tools after enabled_tools:
Try it
Ask Codex:social_api_list_accounts and answers with your connected accounts and their platforms.
Troubleshooting
The browser does not open
The browser does not open
Codex prints the authorization URL (
Authorize socialapi by opening this URL in your browser). Open it on the same machine: the callback goes to a local port that Codex listens on.HTTP 401 with an API key
HTTP 401 with an API key
The variable named in
bearer_token_env_var is not set in the shell that started Codex, or the key is revoked. Check the key in the dashboard.Tools are missing in the IDE extension or desktop app
Tools are missing in the IDE extension or desktop app
They read the same
~/.codex/config.toml. Restart the app after you edit the file.Related
- SocialAPI MCP server: the server URL and the other supported clients.
- MCP tools reference: every tool Codex can call.
- Custom MCP clients: API key setup in detail.
- OAuth for MCP clients: how the sign-in works.