How to Set Up the Notion MCP Server with OpenAI Codex

Learn to connect OpenAI Codex to your Notion workspace using MCP. This step-by-step guide covers both CLI and config file setup to empower Codex with access to your documents.

The command you provided is specific to Anthropic's Claude Code CLI. To configure the Notion MCP server for OpenAI's Codex, you need to use Codex's syntax, which handles remote HTTP servers slightly differently.

You have two ways to set this up.

Option 1: The Codex CLI Command (Fastest)

Run this exact command in your terminal:

Bash

codex mcp add notion --url https://mcp.notion.com/mcp

Option 2: Manual Configuration (config.toml)

Codex shares its configuration between the CLI and the IDE extension using a TOML file rather than JSON.

  1. Open (or create) your Codex config file located at ~/.codex/config.toml.
  2. Paste the following block at the bottom of the file:

Ini, TOML

[mcp_servers.notion]
url = "https://mcp.notion.com/mcp"

Step 3: Authenticate with Notion

Because this specific Notion MCP server uses an OAuth flow over an HTTP transport, you will need to grant Codex permission to access your workspace before it can read or write documents.

  1. Open your terminal and start a session by typing codex.
  2. Once the Codex UI is running, type /mcp and hit enter.
  3. Select the notion server from the list. It will give you a URL to open in your browser to complete the standard Notion login process.

(Note: You can also try running codex mcp login notion directly from your regular terminal to trigger the auth prompt).

Subscribe to newsletter
By subscribing you agree to with our Privacy Policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
RSS Feed

The command you provided is specific to Anthropic's Claude Code CLI. To configure the Notion MCP server for OpenAI's Codex, you need to use Codex's syntax, which handles remote HTTP servers slightly differently.

You have two ways to set this up.

Option 1: The Codex CLI Command (Fastest)

Run this exact command in your terminal:

Bash

codex mcp add notion --url https://mcp.notion.com/mcp

Option 2: Manual Configuration (config.toml)

Codex shares its configuration between the CLI and the IDE extension using a TOML file rather than JSON.

  1. Open (or create) your Codex config file located at ~/.codex/config.toml.
  2. Paste the following block at the bottom of the file:

Ini, TOML

[mcp_servers.notion]
url = "https://mcp.notion.com/mcp"

Step 3: Authenticate with Notion

Because this specific Notion MCP server uses an OAuth flow over an HTTP transport, you will need to grant Codex permission to access your workspace before it can read or write documents.

  1. Open your terminal and start a session by typing codex.
  2. Once the Codex UI is running, type /mcp and hit enter.
  3. Select the notion server from the list. It will give you a URL to open in your browser to complete the standard Notion login process.

(Note: You can also try running codex mcp login notion directly from your regular terminal to trigger the auth prompt).

Subscribe to newsletter
By subscribing you agree to with our Privacy Policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
More

Related Blog Posts

No items found.