Skip to main content
Connect SocialAPI to Codex and ask it to list your connected accounts, reply to comments, send direct messages (DMs), and publish posts. Codex reads MCP servers from ~/.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

Codex saves the server, detects that it uses OAuth 2.1 with PKCE, and opens your browser on the SocialAPI authorization page. Codex stores no API key and refreshes the token itself.
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.
To sign in again on a new machine or after a revoked session, run 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 as Authorization: Bearer.
1

Reference the variable

2

Set the variable

Keep the key in the environment or a secret manager. Never paste it into config.toml or commit it. To limit what the agent can do, create a scoped API key.

Limit the tools

To give Codex fewer tools, list the ones to keep in enabled_tools, or the ones to hide in disabled_tools. Codex applies disabled_tools after enabled_tools:
See MCP tools reference for every tool name.

Try it

Ask Codex:
Codex calls social_api_list_accounts and answers with your connected accounts and their platforms.

Troubleshooting

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.
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.
They read the same ~/.codex/config.toml. Restart the app after you edit the file.
Last modified on October 13, 2026