Skip to main content
OpenAI Codex is OpenAI’s CLI agent for software development. You can connect it to SendKit’s MCP server to manage your email infrastructure with natural language.

Prerequisites

  • Codex CLI installed (npm install -g @openai/codex)
  • A SendKit API key with Full permission

Setup

1

Set your API key as an environment variable

Add your SendKit API key to your shell profile (~/.zshrc, ~/.bashrc, etc.):
export SENDKIT_API_KEY="sk_your_api_key_here"
Replace sk_your_api_key_here with your actual API key from the SendKit dashboard.
2

Open the configuration file

Edit ~/.codex/config.toml and add the SendKit server:
[mcp_servers.sendkit]
url = "https://mcp.sendkit.dev/sendkit"
bearer_token_env_var = "SENDKIT_API_KEY"
3

Restart Codex

Close and reopen Codex to load the new configuration.
4

Verify the connection

Ask Codex to interact with your SendKit account:
List all my SendKit domains
Codex uses TOML for configuration (not JSON). It provides bearer_token_env_var to securely reference API keys from environment variables instead of hardcoding them in the config file.

Example prompts

Send a test email from support@mydomain.com to test@example.com
Create a segment called "Active Users" filtering emails containing @company.com
Show me all contacts on the "Newsletter" list