Before you start
You need Codex CLI and a SocialRouter account. No API key: Codex signs you in itself. Sign up at socialrouter.io if you have not yet. Codex connects straight to the hosted endpoint, so there is nothing to install.1
Add the server
~/.codex/config.toml. Use .codex/config.toml at a repo root to
scope it to one project instead; the block it writes is:2
Sign in
codex mcp logout socialrouter undoes it.Using an API key instead
Using an API key instead
Use a key where a browser flow cannot run, such as CI or a container. Codex
stores the name of an environment variable rather than the key itself:Create the key in the dashboard. It is
shown once, at creation. Put the
export line in your shell profile to make it
stick. With a token configured, no sign-in ever runs.3
Check it is connected
socialrouter should be listed. Inside a session, /mcp shows the servers and the
tools they add.4
Ask for something
Get me Satya Nadella’s LinkedIn profile.Codex finds the right service on its own. If you are not sure what to ask, try “What social media data can you pull with SocialRouter?”
If something goes wrong
The server fails to connect
The server fails to connect
Call the endpoint yourself to see the real answer:A
401 means the credential is wrong or revoked. If you are using a key, it can
also mean SOCIALROUTER_API_KEY is not set in the shell you ran this from, which
is the same shell Codex reads it from.The sign-in fails, or the server stays unauthenticated
The sign-in fails, or the server stays unauthenticated
Run
codex mcp login socialrouter again. If it still fails, remove the server
(codex mcp remove socialrouter) and add it back. A stale entry from an older
config can keep pointing at a credential that no longer works.
Authentication has the rest.Putting the key in the file instead
Putting the key in the file instead
If exporting a variable is awkward, send it as a static header in
Never do this in a committed project config.
~/.codex/config.toml, which lives outside your repos:Next steps
Tools reference
What
list_services, run, get_extraction and get_account do.What you can pull
Every platform and service Codex can call.