Connect Codex
Add the remote MCP server to Codex.
Set up with your AI assistant
Paste the prompt into Codex. It includes setup steps and a read-only connection check.
Codex — Terminal (CLI): sign in with LeadsAgent (recommended)
The codex command in a terminal.
- Add the server.Terminal
codex mcp add leadsagent --url https://leadsagent.io/mcp/v1 - Start sign-in.Terminal
codex mcp login leadsagent - A browser opens. Sign in with your LeadsAgent account and approve access.
- Check it is connected. Inside the Codex TUI, /mcp shows the same list.Terminal
codex mcp list
Codex — Terminal (CLI): use an API key
- On the LeadsAgent setup page, select “Create an API key”. Name it for this app and set its expiry and limits. Copy it once; it starts with la_.
- Set LEADSAGENT_API_KEY in the environment used by this app. Restart the app so it reads the variable. Keep the value out of chats and shared files.Terminal
LEADSAGENT_API_KEY - Open ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml; create it if needed) and add this block. Codex sends the variable’s value as a bearer token.~/.codex/config.toml
[mcp_servers.leadsagent] url = "https://leadsagent.io/mcp/v1" bearer_token_env_var = "LEADSAGENT_API_KEY" - Restart Codex and check it is connected.Terminal
codex mcp list
Codex — Desktop app: sign in with LeadsAgent (recommended)
The Codex desktop app for Windows and macOS. It writes the same ~/.codex/config.toml as the CLI.
- Open Settings → MCP servers → Add server.
- Choose Streamable HTTP. Enter the name leadsagent and this URL. Click Save, then Restart.Server URL
https://leadsagent.io/mcp/v1 - Click Authenticate next to leadsagent.
- A browser opens. Sign in with your LeadsAgent account and approve access.
- Type /mcp in the composer to check leadsagent is connected.In Codex
/mcp
Codex — Desktop app: use an API key
- On the LeadsAgent setup page, select “Create an API key”. Name it for this app and set its expiry and limits. Copy it once; it starts with la_.
- Set LEADSAGENT_API_KEY in the environment used by this app. Restart the app so it reads the variable. Keep the value out of chats and shared files.System environment
LEADSAGENT_API_KEY - Open ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml) and add this block.~/.codex/config.toml
[mcp_servers.leadsagent] url = "https://leadsagent.io/mcp/v1" bearer_token_env_var = "LEADSAGENT_API_KEY" - Restart the app. Type /mcp in the composer to check leadsagent is listed.In Codex
/mcp
Codex — IDE extension: sign in with LeadsAgent (recommended)
The Codex extension in VS Code, Cursor or another editor. It reads the same ~/.codex/config.toml.
- Open the gear menu in the Codex panel → MCP servers → Add server. Or run the CLI command in the editor’s terminal.Terminal
codex mcp add leadsagent --url https://leadsagent.io/mcp/v1 - Click Restart extension. Then start sign-in from the MCP servers list, or run the command below.Terminal
codex mcp login leadsagent - A browser opens. Sign in with your LeadsAgent account and approve access.
Codex — IDE extension: use an API key
- On the LeadsAgent setup page, select “Create an API key”. Name it for this app and set its expiry and limits. Copy it once; it starts with la_.
- Set LEADSAGENT_API_KEY in the environment used by this app. Restart the app so it reads the variable. Keep the value out of chats and shared files.Editor environment
LEADSAGENT_API_KEY - Add this block to ~/.codex/config.toml.~/.codex/config.toml
[mcp_servers.leadsagent] url = "https://leadsagent.io/mcp/v1" bearer_token_env_var = "LEADSAGENT_API_KEY" - Restart the editor so the extension reads the variable.
Source: Codex docs: MCP · Open in Connectors