Reddit and X data in Codex
Add four lines to ~/.codex/config.toml and the Codex CLI can search Reddit and X, read threads and look up accounts through ChatterAPI's hosted MCP server. Codex reads the key from an environment variable, so the file holds no secret.
https://api.chatterapi.com/mcpWhat you get
- Every live Reddit and X tool is available as an MCP tool: search, threads, subreddits, users, followers, timelines, leads and brand mentions.
- Each result includes
credits.chargedandcredits.remaining, so the agent can see what it spent. - Every key gets two free tools:
chatterapi_accountfor your balance andchatterapi_list_toolsfor every tool and its cost. - You don't need a Reddit or X developer account. The key works for REST calls too, from the same credit balance.
Set it up
Create an API key
Sign in at chatterapi.com/signup with Google and create a key on the Keys page. You get 100 free credits. A
ca_test_key returns recorded samples for 0 credits, which helps while you set things up.Add the server
Put this in
~/.codex/config.toml, or in a project's.codex/config.toml. Codex sends the value ofCHATTERAPI_KEYas a Bearer token.~/.codex/config.toml[mcp_servers.chatterapi] url = "https://api.chatterapi.com/mcp" bearer_token_env_var = "CHATTERAPI_KEY" tool_timeout_sec = 90Or add it from the terminal
The CLI writes the same entry for you.
terminalcodex mcp add chatterapi --url https://api.chatterapi.com/mcp --bearer-token-env-var CHATTERAPI_KEYCheck it
Run
codex mcp listand check that chatterapi is listed.
Try a profile lookup
Ask about an account and Codex calls x_user. The response below is a real recorded call.
Look up the X account levelsio and tell me the follower count and bio.
{
"method": "tools/call",
"params": {
"name": "x_user",
"arguments": {
"handle": "levelsio"
}
}
}{
"data": {
"id": "1577241403",
"handle": "levelsio",
"name": "@levelsio",
"bio": "💸http://levels.vc\n📸http://PhotoAI.com $86K/m\n🎮http://VibeJam.com $44K/m\n🏡http://InteriorAI.com $23K/m\n👙@X $13K/m\n🌍http://Nomads.com $7K/m\n🏩http://Hotelist.com $5K/m",
"followers": 974707,
"following": 3276,
"tweets": 181450,
"verified": false,
"blueVerified": true,
"canDm": false,
"protected": false,
"location": "📕My book $5K/m 👉",
"url": "https://readMAKE.com",
"avatarUrl": "https://pbs.twimg.com/profile_images/2077111020305162240/PwddgOau_400x400.jpg",
"createdAt": "2013-07-08T09:31:59.000Z"
}
}Recorded from a live call on . Long text is shortened and the cursor is cut. A live key is charged 3 credits for this call. A test key returns this same sample for 0 credits.
Limits worth knowing
tool_timeout_secdefaults to 60 seconds andstartup_timeout_secto 10. The example raises the tool timeout because some Reddit reads are slower. source- Codex loads a project's
.codex/config.tomlonly for trusted projects. source enabled_toolsanddisabled_toolslimit which tools Codex sees from a server. source
Last checked . Sources: Codex MCP docs, Codex config reference.
Questions
Does it cost more through Codex than through REST?
Can I try it without spending credits?
ca_test_ key. Every tool returns a recorded sample for 0 credits, whatever you ask.