

How to Use OpenAI Codex with the 2Slides MCP Server (2026 Guide)
Quick answer (≤60 words): OpenAI Codex can produce real PowerPoint files by adding the 2Slides MCP server to
. Get a key at 2slides.com/api, then add a~/.codex/config.tomlblock running[mcp_servers.2slides](stdio) or anpx 2slides-mcpblock (Streamable HTTP). Or runurl = "https://2slides.com/api/mcp?apikey=KEY". Then ask Codex to build a deck.codex mcp add 2slides --env API_KEY=xxx -- npx 2slides-mcp
OpenAI Codex is OpenAI's open-source CLI coding agent, and it is a Model Context Protocol (MCP) client. Connect it to the 2Slides MCP server and Codex can turn a brief — or a file in your repo — into a finished, editable
.pptxThis guide gives you the exact
config.tomlcodex mcp addWhy pair Codex with 2Slides?
Codex reasons over code and content; it does not emit binary slide files on its own. The 2Slides MCP server fills that gap. The division of labor:
- Codex reads your source (spec, README, data file), plans the slides, and decides the narrative.
- The 2Slides MCP server renders the actual PowerPoint — theme-based Fast PPT, or image-designed slides with optional AI narration and an exportable asset bundle.
You ask in plain English; Codex calls the tools; a download link comes back.
What you need first
- Codex CLI installed (on your PATH).
codex - A 2Slides API key from 2slides.com/api — that page also has the MCP config and the Streamable HTTP endpoint.
- Node.js for the stdio transport (it runs ). The HTTP transport needs nothing local.
npx 2slides-mcp
Stdio vs Streamable HTTP: which transport?
The 2Slides MCP server offers both. Same tools either way — the difference is where the connector runs.
| Stdio Protocol | Streamable HTTP Protocol | |
|---|---|---|
| Where it runs | Locally via npx 2slides-mcp | Remotely, hosted by 2Slides |
| Local Node.js | Required | Not required |
| Config style | commandargsenv | urlbearer_token_env_var |
| Best for | Local dev, full control | Remote/CI boxes, thin setups |
Use stdio on your workstation; use Streamable HTTP when Codex runs where you can't install Node.
Method 1: stdio in config.toml
Edit
~/.codex/config.toml[mcp_servers.2slides] command = "npx" args = ["2slides-mcp"] [mcp_servers.2slides.env] API_KEY = "YOUR_2SLIDES_API_KEY"
Optional fields Codex supports for stdio servers include
cwdstartup_timeout_sectool_timeout_secenv_vars = ["API_KEY"]Or use the codex mcp add shortcut
codex mcp addNo file editing required — this writes the block for you:
codex mcp add 2slides --env API_KEY=YOUR_2SLIDES_API_KEY -- npx 2slides-mcp
Everything after
--codex mcp --helpMethod 2: Streamable HTTP in config.toml
Point Codex at the hosted endpoint:
[mcp_servers.2slides_remote] url = "https://2slides.com/api/mcp?apikey=YOUR_2SLIDES_API_KEY"
If you prefer header auth over a query-string key, Codex supports a bearer-token env var and static headers:
[mcp_servers.2slides_remote] url = "https://2slides.com/api/mcp" bearer_token_env_var = "TWOSLIDES_TOKEN"
Version gotcha (important): Codex routes HTTP MCP servers through its Rust MCP client. Recent versions wire this up automatically, but some older builds error with
missing field command in mcp_servers[features] experimental_use_rmcp_client = true
Check
codex --version[features].rmcp_clientVerify the connection
codex mcp list # list configured MCP servers codex mcp get 2slides
Or, inside the Codex TUI, run
/mcpcodex mcpcodex mcp --helpGenerate your first deck
You don't invoke tools manually — you ask:
Read ./docs/launch-plan.md and generate a 10-slide launch deck. Use a modern, dark business theme from 2slides. Return the download link when it's done.
Codex runs
themes_searchthemeIdslides_generatedownloadUrlslides_create_pdf_slidesjobs_getThe 2Slides MCP tool surface
| Tool | What it does | Credits |
|---|---|---|
themes_search | Find a themeId | Free |
slides_generate | Theme-based PowerPoint (Fast PPT), sync/async | 10 / page |
slides_create_pdf_slides | Custom image-designed slides from text (Nano Banana) | 100 / page (1K/2K), 200 (4K) |
slides_create_like_this | Slides matching a reference image's style | 100 / page (1K/2K), 200 (4K) |
slides_generate_narration | Add AI voice narration to a Nano Banana job | 210 / page |
slides_download_pages_voices | Export pages + audio as a ZIP | Free |
jobs_get | Poll an async job to completion | Free |
Common mistakes and troubleshooting
- on an HTTP server. Your Codex version needs
missing field command in mcp_serversunderexperimental_use_rmcp_client = true. Upgrade Codex, or add the flag.[features] - TOML table headers vs inline tables. is a sub-table; if you inline it, write
[mcp_servers.2slides.env]on the server line — don't mix both styles.env = { API_KEY = "..." } - Server name must be unique. Each server is keyed by the segment; reusing a name overwrites the earlier block.
[mcp_servers.NAME] - No without the tool. Codex alone can draft an outline but cannot emit a PowerPoint. Add 2Slides first.
.pptx - Tool timeouts on big decks. Large or narrated jobs can exceed the 60s default ; raise it, or let Codex poll
tool_timeout_secfor async jobs.jobs_get
Frequently asked questions
Does OpenAI Codex support MCP servers?
Yes. Codex is an MCP client. You configure servers in
~/.codex/config.toml[mcp_servers.NAME]codex mcp addWhere does Codex store MCP config?
In
~/.codex/config.toml.codex/config.toml[mcp_servers.NAME]Stdio or Streamable HTTP?
Stdio runs
npx 2slides-mcphttps://2slides.com/api/mcpDoes it produce a real PowerPoint?
Yes —
slides_generate.pptxWhere do I get the key and config?
At 2slides.com/api?tab=mcp: your API key, a copy-paste config, and the Streamable HTTP endpoint URL.
The takeaway
Add one
block to[mcp_servers.2slides](or runconfig.toml), and Codex gains a tool that turns any brief into a finished PowerPoint — without leaving your terminal.codex mcp add
Codex is a strong reasoning agent; 2Slides is the file generator it was missing. For the bigger picture, see how MCP is changing presentation workflows and the PowerPoint MCP server ecosystem map. Prefer Anthropic's agent? See how to use Claude Code with the 2Slides MCP server.
Get your key and the exact config at 2slides.com/api?tab=mcp and ship your first Codex-generated deck today.
Sources:
About 2Slides
Create stunning AI-powered presentations in seconds. Transform your ideas into professional slides with 2slides AI Agent.
Try For Free