Skip to main content

Connect Codex

Connect Codex (CLI and IDE extension — they share one config) to your team's MCP servers through Bloque in about five minutes.

1. Create a Bloque account

Sign up at bloque.run with GitHub or email. A Hub is created for you automatically.

2. Add an MCP server

Go to MCP Servers → Add Server and pick a server from the registry, paste a GitHub URL or npm package name, or enter connection details manually. See Add an MCP Server.

3. Generate an API key

Open API Keys in the sidebar and create a key. Codex reads environment variables from the process that starts it, and there are three common ways to make BLOQUE_API_KEY available.

Option 1: Export the key in your shell

Add this to your shell profile, such as ~/.zshrc or ~/.bashrc:

export BLOQUE_API_KEY="your Bloque API key"

Open a new terminal, then start Codex from that terminal.

Option 2: Use a .env wrapper

If you keep the key in a project .env file:

BLOQUE_API_KEY="your Bloque API key"

Create a wrapper script such as bin/codex-with-env:

#!/usr/bin/env bash
set -euo pipefail

set -a
source .env
set +a

exec codex "$@"

Option 3: Read the key from an OS secret store

Store the key in your operating system's managed keychain, then read it at launch time. For example, with cross-keychain:

#!/usr/bin/env bash
set -euo pipefail

export BLOQUE_API_KEY="$(cross-keychain get bloque BLOQUE_API_KEY)"
exec codex "$@"

4. Connect Codex

Codex CLI and the IDE extension share the same MCP configuration. You can configure Bloque in config.toml or with the codex mcp add command.

Option 1: config.toml

Add this to ~/.codex/config.toml, or to .codex/config.toml in a trusted project:

[mcp_servers.bloque]
url = "https://mcp.bloque.run/mcp"
bearer_token_env_var = "BLOQUE_API_KEY"

Then launch Codex from a shell where BLOQUE_API_KEY is set.

Option 2: codex mcp add

Add the same server from the CLI:

codex mcp add bloque --url https://mcp.bloque.run/mcp --bearer-token-env-var BLOQUE_API_KEY

Verify:

codex mcp list

bloque should appear.

See the Codex MCP documentation for more options.

5. Try it

Start codex from a shell where BLOQUE_API_KEY is set, and ask:

What tools do you have available from bloque?

Codex should list the tools from the servers you added in step 2.

What's next