2Slides Logo
How to Use OpenAI Codex with the 2Slides MCP Server (2026 Guide)
2Slides Team
7 min read

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 ~/.codex/config.toml. Get a key at 2slides.com/api, then add a [mcp_servers.2slides] block running npx -y 2slides-mcp@latest (stdio) or a url = "https://2slides.com/api/mcp?apikey=KEY" block (Streamable HTTP). Or run codex mcp add 2slides --env API_KEY=xxx -- npx -y 2slides-mcp@latest. Then ask Codex to build a deck.

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 .pptx, all from the terminal.

This guide gives you the exact config.toml blocks for both transports (local stdio and remote Streamable HTTP), the one-line codex mcp add shortcut, what each 2Slides tool does, and the version-specific gotcha to watch for with HTTP servers.

Why 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

  1. Codex CLI installed (codex on your PATH).
  2. A 2Slides API key from 2slides.com/api — that page also has the MCP config and the Streamable HTTP endpoint.
  3. Node.js for the stdio transport (it runs npx -y 2slides-mcp@latest). The HTTP transport needs nothing local.

Stdio vs Streamable HTTP: which transport?

The 2Slides MCP server offers both. Same tools either way — the difference is where the connector runs.

Stdio ProtocolStreamable HTTP Protocol
Where it runsLocally via npx -y 2slides-mcp@latestRemotely, hosted by 2Slides
Local Node.jsRequiredNot required
Config stylecommand + args + envurl (optionally bearer_token_env_var)
Best forLocal dev, full controlRemote/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 and add:

[mcp_servers.2slides] command = "npx" args = ["-y", "2slides-mcp@latest"] [mcp_servers.2slides.env] API_KEY = "YOUR_2SLIDES_API_KEY"

Optional fields Codex supports for stdio servers include cwd, startup_timeout_sec (default 10s), and tool_timeout_sec (default 60s). If you'd rather pass an existing environment variable through instead of inlining the key, use env_vars = ["API_KEY"].

Or use the codex mcp add shortcut

No file editing required — this writes the block for you:

codex mcp add 2slides --env API_KEY=YOUR_2SLIDES_API_KEY -- npx -y 2slides-mcp@latest

Everything after -- is the server command. Run codex mcp --help for the full subcommand list on your installed version.

Method 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 until you enable the experimental client. If that happens to you, add:

[features] experimental_use_rmcp_client = true

Check codex --version first — newer releases fold this in, and the flag is being renamed to [features].rmcp_client. Show this block only as a fallback if your version complains.

Verify the connection

codex mcp list # list configured MCP servers codex mcp get 2slides

Or, inside the Codex TUI, run /mcp to see active servers and their tools. (The codex mcp management subcommands are still evolving; codex mcp --help is authoritative for your build.)

Generate 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_search to find a themeId, then slides_generate (Fast PPT), and returns a downloadUrl — a real PowerPoint in roughly 30–60 seconds. Ask for image-designed slides and it switches to slides_create_pdf_slides, polling jobs_get until the file is ready.

The 2Slides MCP tool surface

ToolWhat it doesCredits
themes_searchFind a themeId for Fast PPTFree
slides_generateTheme-based PowerPoint (Fast PPT), sync/async10 / page
slides_create_pdf_slidesCustom image-designed slides from text (Nano Banana)100 / page (1K/2K), 200 (4K)
slides_create_like_thisSlides matching a reference image's style100 / page (1K/2K), 200 (4K)
slides_generate_narrationAdd AI voice narration to a Nano Banana job210 / page
slides_download_slides_pages_voicesExport pages + audio as a ZIPFree
jobs_getPoll an async job to completionFree

Common mistakes and troubleshooting

  • missing field command in mcp_servers on an HTTP server. Your Codex version needs experimental_use_rmcp_client = true under [features]. Upgrade Codex, or add the flag.
  • TOML table headers vs inline tables. [mcp_servers.2slides.env] is a sub-table; if you inline it, write env = { API_KEY = "..." } on the server line — don't mix both styles.
  • Server name must be unique. Each server is keyed by the [mcp_servers.NAME] segment; reusing a name overwrites the earlier block.
  • No .pptx without the tool. Codex alone can draft an outline but cannot emit a PowerPoint. Add 2Slides first.
  • Tool timeouts on big decks. Large or narrated jobs can exceed the 60s default tool_timeout_sec; raise it, or let Codex poll jobs_get for async jobs.

Frequently asked questions

Does OpenAI Codex support MCP servers?

Yes. Codex is an MCP client. You configure servers in ~/.codex/config.toml under [mcp_servers.NAME], or add them with codex mcp add. Both stdio and remote HTTP servers are supported.

Where does Codex store MCP config?

In ~/.codex/config.toml (global). Trusted projects can also use a project-local .codex/config.toml. Each MCP server is a [mcp_servers.NAME] table.

Stdio or Streamable HTTP?

Stdio runs npx -y 2slides-mcp@latest on your machine and is the default for local work. Streamable HTTP points at the hosted https://2slides.com/api/mcp endpoint and needs nothing installed — ideal for CI and remote environments. Same tools, same output.

Does it produce a real PowerPoint?

Yes — slides_generate returns an editable .pptx. The Nano Banana tools return image-designed decks and can add AI narration plus an exportable asset bundle.

Where 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 [mcp_servers.2slides] block to config.toml (or run codex mcp add), and Codex gains a tool that turns any brief into a finished PowerPoint — without leaving your terminal.

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