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

    Open Codex configuration

    Open ~/.codex/config.toml. For a trusted project, you can instead use .codex/config.toml.
  2. 2

    Add Dreamstate

    Add the server block below. The server name is dreamstate.
  3. 3

    Sign in

    Run codex mcp login dreamstate. In the Codex TUI, use /mcp to inspect active MCP servers.
[mcp_servers.dreamstate]
url = "https://mcp.trydreamstate.com/mcp"

Authenticate with Dreamstate

A browser window opens after codex mcp login dreamstate. Sign in with your Dreamstate account, choose the workspace, then return to Codex. Use a workspace machine key only for CI and clients without OAuth.

Test the connection

Run whoami and tell me which Dreamstate workspace you are connected to.

If it returns your workspace name, setup is complete.

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 server block in ~/.codex/config.toml, then run /mcp in Codex to confirm that dreamstate is listed.
  • The sign-in window opened but nothing happens. Run codex mcp login dreamstate again and finish sign-in in the browser opened by Codex. A redirect refused error means the flow must start from the local Codex client.
  • Codex cannot find Dreamstate tools. Use /mcp to confirm that dreamstate is active for the current session.
  • It connected to the wrong workspace. Run whoami, then log in again and choose the intended workspace. A 401 Missing Bearer response means login needs to be completed again.

Best practices

  • Test the connection immediately with 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