Connect Codex

Connect Codex to Dreamstate MCP with config.toml and OAuth.

Connect Codex to Dreamstate so Codex can work with the selected Dreamstate workspace. Use OAuth first, so there is no key to copy.

Once connected, you can ask Codex to:

  • Build a scored lead list in a workbook.
  • Enrich workbook rows with work emails.
  • Draft and launch a sequence.
  • Schedule a LinkedIn post.
  • Check AI visibility or read why a run failed.

Before you start

You need a Dreamstate workspace and Codex with remote MCP server support.

Step-by-step setup

  1. 1

    Check existing setup

    Use /mcp in Codex to inspect active MCP servers, including those provided by the Dreamstate plugin. Skip steps already completed. If the plugin is missing, install it with dreamstate install --agents codex after installing or updating the Dreamstate CLI with Node.js 22 or newer and npm install -g @trydreamstate/cli@latest.
  2. 2

    Add Dreamstate only if missing

    If Dreamstate is still absent after checking the plugin, run codex mcp add dreamstate --url https://mcp.trydreamstate.com/mcp, or add the server block below to ~/.codex/config.toml. For a trusted project, you can instead use .codex/config.toml. Do not add a standalone duplicate of the plugin's MCP server.
  3. 3

    Sign in to MCP

    If Dreamstate MCP whoami already succeeds, skip login. Otherwise inspect codex mcp list --json and run codex mcp login <server-name> using the exact configured Dreamstate server name it reports. For the standalone entry named dreamstate, run codex mcp login dreamstate. If the plugin server appears only in /mcp, use its sign-in action instead of inventing a CLI server name. Keep login running while you approve in the browser.
[mcp_servers.dreamstate]
url = "https://mcp.trydreamstate.com/mcp"

Authenticate with Dreamstate

A browser window opens when you start MCP login in Codex. Sign in with your Dreamstate account, choose the workspace, and approve. The browser then returns to Codex's local sign-in page, which says authentication is complete. Keep login running and wait for Codex to report success, then verify with Dreamstate MCP whoami.

dreamstate login signs in to the Dreamstate CLI; it does not authenticate Codex's MCP connection. Likewise, dreamstate whoami --json only verifies CLI access. Never paste a token into chat.

Test the connection

Call the Dreamstate MCP whoami tool from Codex and tell me which account and workspace you are connected to. Do not use the Dreamstate CLI for this check.

Setup is complete only after that MCP call succeeds and returns the intended account and workspace. If the plugin or tools require a new Codex session, open one and run this check there.

What to do next

Read Quickstart, MCP reference, or Your first session.

When it goes wrong

  • I do not see Dreamstate in MCP controls. Check the installed plugin and /mcp first. Only add a standalone server if Dreamstate is missing. Start a new Codex session if required to load the plugin or tools.
  • The browser shows a connection error after approval. Codex MCP login stopped before you approved. If login has stopped or failed, start it again for the same configured server and approve in the browser it opens.
  • Codex cannot find Dreamstate tools. Use /mcp to confirm that the Dreamstate server is active for the current session.
  • It connected to the wrong workspace. Call Dreamstate MCP whoami, then repeat MCP login for the exact configured server name and choose the intended workspace. A 401 Missing Bearer response means MCP login needs to be completed again.

Best practices

  • Test the connection immediately with Dreamstate MCP whoami.
  • Use /mcp to confirm Dreamstate is active before a new task.
  • Read tools do not need confirmation because MCP tools declare readOnlyHint.

Dreamstate documentation

Start

Guides

Surfaces

Workspace

Knowledge

Data

Execution

Providers

Plays and templates

Safety and cost

API reference