MCP · Codex CLI
Codex CLI
Codex CLI reads MCP servers from
~/.codex/config.toml. The bearer_token_env_var field names the variable that holds the key, so the file itself never contains a secret. The same entry also powers the ChatGPT desktop app.Included with paid plans60 tools · 8 groups · Draft-first by default
What the agent gets
60 tools in 8 groups
60 tools, one workspaceAccounts, presets, schedules, posts, generation, content, insights and billing — all reachable from the agent.
Same key, same creditsUse the API key and plan you already have. There is no separate MCP subscription or balance.
Drafts firstAnything the agent writes lands in XBeast as a draft. Review it, edit it, or let it fill the next scheduled slot.
Safe by defaultRead-only keys for observers. Full-access keys can publish, but create_post defaults to a draft.
Connect
Connect Codex CLI
Create an API key on the Developer page, then add the server. The key comes from your environment, so the snippet below is safe to keep in a config file.
- Create an API key under Developer API in your XBeast account.
- Add the entry below to
~/.codex/config.toml. - Export the raw key, open a new terminal, then confirm with
codex mcp list.
The value is the raw key. Codex adds the Bearer prefix when it calls the server.
Open a new terminal after exporting so the variable is visible to Codex.
Add to ~/.codex/config.toml
Export the key, then confirm
The loop
Find, inspect, write, schedule
Four messages do the whole job. The tool names below are the ones the agent calls for you.
01
Find
Find what already exists
Ask for an account, preset or post in plain language. Read tools return real IDs, statuses and dates, and cost nothing.list_accountslist_presetslist_scheduleslist_posts
02
Inspect
Read before you spend
Check credits, audience growth and post performance before the agent writes anything.get_workspaceget_account_analytics_overviewlist_account_postsget_post
03
Write
Write in your voice
Generate from a preset, rewrite a hook, add media or save a draft.create_post defaults to a draft, so nothing ships by accident.generate_textbeast_mode_generateedit_post_with_aicreate_post
04
Schedule
Put it on the calendar
Move a slot, drop the post into the next queue slot or publish now — with the same rules as the dashboard.create_scheduleupdate_schedulequeue_postpublish_post
A real session
What it looks like when it runs
Real tool names; the values are illustrative.
Three prompts to try
Start with one of these
Show my workspace credits and the next three open queue slots.
Draft a week of posts from the Build in public preset.
Schedule the drafts into the open slots and list every change.
FAQ
Common questions
Also works with
Every tool, protocol version and header rule: MCP server docs. The REST API behind those tools: API overview.