Skip to main content
Connect OpenAI Codex to Control Plane to manage your infrastructure through AI-assisted development.

Prerequisites

OpenAI Codex

Install Codex CLI

Service Account Token

Create a service account with appropriate permissions
For the latest MCP configuration options, refer to the official OpenAI Codex documentation.

Configuration

Step 1: Set the Environment Variable

Add your service account token as an environment variable:
export CPLN_TOKEN="<your-service-account-token>"
Add this line to ~/.bashrc, ~/.zshrc, or your shell configuration file, then reload your shell or run source ~/.zshrc.
Replace <your-service-account-token> with your actual service account token.

Step 2: Add the MCP Server

Use the codex mcp add command to register the Control Plane MCP Server:
codex mcp add cpln --url https://mcp.cpln.io/mcp --bearer-token-env-var CPLN_TOKEN

Step 3: Verify the Connection

List your configured MCP servers to confirm the setup:
codex mcp list
You should see cpln in the list of configured servers.

Managing MCP Servers

# List all MCP servers
codex mcp list

# Show details for a server
codex mcp get cpln

# Remove an MCP server
codex mcp remove cpln

# Get help on MCP commands
codex mcp --help

Example Usage

1

Set Context

Use org "my-org" and gvc "my-gvc" for context.
2

Deploy a Workload

Create a publicly accessible workload called "my-api" using nginx:latest on port 80.
3

Get the Endpoint

Monitor the readiness of my-api and give me the public endpoint once it's ready.

Troubleshooting

  • Ensure the CPLN_TOKEN environment variable is set in your shell.
  • Check that your service account token is valid.
  • Ensure the token is entered without extra spaces or quotes.
  • Verify the token has appropriate permissions (see Service Account Permissions).
  • Check for typos in the org name you’re using for context, this is a common cause of authentication failures.

Next Steps