LeadCeleris
All articles
MCPOpenAI CodexAI agentCRMDeveloper tools

How to Connect OpenAI Codex to LeadCeleris with MCP

A practical setup guide for connecting Codex to a LeadCeleris workspace with a revocable API key, safe tool approvals, verification prompts, and CRM use cases.

LeadCeleris TeamJuly 26, 20269 min read

Connecting Codex to LeadCeleris with MCP turns a general coding agent into a workspace-aware sales operations assistant. It can inspect contacts, summarize recent WhatsApp conversations, review orders and bookings, maintain business knowledge, and help tune your sales agent. You decide which actions it may take and can revoke the connection at any time.

MCP stands for Model Context Protocol. It gives an AI client a standard way to discover and call tools exposed by another product. In this setup, Codex is the client, LeadCeleris is the remote MCP server, and your workspace API key is the credential that limits access to your organization.

What you need before setup

You need an active LeadCeleris workspace, access to its Developers screen, and a current Codex app, CLI, or IDE extension. The LeadCeleris server uses Streamable HTTP at https://app.leadceleris.com/api/mcp. You do not need to install a local bridge or run a server on your laptop.

Create a dedicated key

Sign in to LeadCeleris and open Developers. Under API Keys, enter a descriptive name such as "Codex on my laptop" and create the key. Copy the full lc_live_ value immediately because LeadCeleris shows it only once. Use a different key for every device or AI client so one connection can be revoked without interrupting another.

Never paste the key into a public repository, an AGENTS.md file, a screenshot, or a support message. Store it as an environment variable named LEADCELERIS_API_KEY in the environment that launches Codex. The Codex configuration should reference the variable name, not contain the secret itself.

On Windows, open PowerShell and run [Environment]::SetEnvironmentVariable("LEADCELERIS_API_KEY", "PASTE_YOUR_LEADCELERIS_KEY", "User"). Completely close Codex afterward so the relaunched app receives the new user environment variable. On macOS or Linux, export the same variable from the shell profile that launches Codex.

Configure the remote MCP server

Open your user configuration at ~/.codex/config.toml. On Windows this normally means the config.toml file inside your .codex directory. You can also use a project-level .codex/config.toml for a trusted project when the connection should exist only there.

Add a section named [mcp_servers.leadceleris]. Set url to https://app.leadceleris.com/api/mcp and bearer_token_env_var to LEADCELERIS_API_KEY. Set default_tools_approval_mode to "writes" so read-only queries can run conveniently while actions that modify data still request approval.

Restart Codex after saving the configuration. In the Codex app or IDE, open MCP servers from settings, or use the MCP status command available in your client. In the CLI you can run codex mcp list. The server should appear as leadceleris and report its workspace tools.

Run a read-only verification first

Your first prompt should be narrow: "Use LeadCeleris to show my workspace overview. Read only and do not change data." A successful result should identify the organization and summarize connected channels, contacts, messages, escalations, orders, and bookings. This proves the URL, key, and workspace scope are correct without creating side effects.

Next, ask Codex to list five recent conversations and summarize them. Follow with a contact lookup. Do not begin by sending a customer message. Reading first lets you confirm that Codex is operating on the intended workspace and helps you understand how it presents tool approvals.

Useful daily workflows

A sales manager can ask, "Show qualified leads that have not received a useful reply today, then prepare a prioritized call list." A support lead can ask for unresolved escalations. A founder can compare new orders, bookings, and hot leads in one briefing rather than checking three screens.

Codex can also maintain the knowledge base. Give it an approved service name, description, price range, and FAQ, then ask it to create the entry and read it back. This is helpful when your sales AI needs current product or policy information. For broader CRM habits, see our WhatsApp CRM guide for online stores.

Write actions need more care. LeadCeleris labels tools that update contacts, send messages, change agent configuration, or create knowledge as write tools. Keep approval prompts enabled. Ask Codex to draft a customer reply before sending it, and review recipient, tone, price details, and promises before approval.

If you use the advanced agent prompt, ask Codex to read the current configuration and propose a small diff. Avoid instructions like "improve everything." A focused request such as "add a rule to escalate qualified enterprise buyers without changing the existing tone" is easier to review and safer to reverse.

Common connection mistakes

A 401 response usually means the key is missing, copied incorrectly, revoked, or unavailable to the process that launched Codex. A server that does not appear after editing config.toml usually needs a Codex restart. A 405 response in a browser is expected because the MCP endpoint accepts protocol POST requests, not normal page visits.

If tools are visible but a write fails, verify that the API key includes write scope and that the contact belongs to the connected workspace. If the AI sees no conversations, check whether a WhatsApp channel has been connected and has received messages since the workspace was created.

MCP complements automation rather than replacing it. LeadCeleris continues answering customers and scoring leads. Codex helps an owner investigate, review, and operate the system through explicit tools. The difference between that model and ordinary chatbot automation is also visible in our WhatsApp automation tools comparison.

Disconnecting is simple: remove the LeadCeleris MCP entry from Codex and revoke its API key from Developers. Revocation is the important step because it invalidates the credential even if an old configuration file still exists.

The complete tool list, copyable configuration, Claude guide, and example prompts are available on the LeadCeleris MCP page. When you are ready, create a dedicated key, begin with the read-only workspace overview, and let LeadCeleris ask for approval before Codex changes customer or agent data.

Ready to put WhatsApp on AI autopilot?

Start free with 50 chats/month. Current offers appear inside the app when eligible.

Start free