Run Customermates as an MCP server inside the Codex CLI. One TOML block, paste the setup prompt.
OpenAI's Codex CLI uses a TOML config file. The codex mcp add subcommand only handles stdio servers, so for an HTTP MCP server like Customermates we add the block manually. It's still one paste.
In Customermates: Profile → API Keys → New key. Name it for the client (e.g. Codex). Copy the 64-character string immediately — it's shown once.
Open ~/.codex/config.toml (create it if missing). Append, replacing YOUR_KEY:
[mcp_servers.customermates]url = "https://customermates.com/api/v1/mcp"http_headers = { "x-api-key" = "YOUR_KEY" }Self-hosting? Swap the URL for your instance.
To pull the key from your environment instead of putting it in the file:
[mcp_servers.customermates]
url = "https://customermates.com/api/v1/mcp"
env_http_headers = { "x-api-key" = "CUSTOMERMATES_API_KEY" }…then export CUSTOMERMATES_API_KEY in your shell profile.
Start a new Codex session and send this as the first message:
You are now connected to my Customermates CRM through MCP.## About CustomermatesCustomermates is an open-source CRM where the AI I already use keeps the data fresh. Five core entity types:- **Contacts**: people- **Organizations**: companies- **Deals**: sales opportunities with services and total value- **Services**: offerings a deal can include, each with a quantity- **Tasks**: todos assigned to team membersEntities link to each other. A contact belongs to one or more organizations and one or more deals. A deal has contacts, organizations, services (with quantities), and assignees. A task has assignees only. Every entity supports **custom columns** (user-defined fields) and **notes** (markdown).## Before you do anything, ask me for1. My name and role, so you can tailor your replies.2. What I usually do with my CRM, in one sentence.## Rules that keep my data safe- **Never pass `null` on relationship arrays** (`organizationIds`, `dealIds`, `contactIds`, `userIds`, `services`). Null wipes the relationship. Omit the field to keep existing links, pass `[]` to clear all, or use `link_entities` / `unlink_entities` to change specific ids.- **Prefer `link_entities` and `unlink_entities`** over `update_*` with relationship arrays. They merge instead of replacing.- **Custom fields are per-column merge**. Only the columnIds you include are changed; the rest are preserved. To clear one field pass `{ columnId, value: null }`.- **Use the correct per-type custom-column tool**. `update_plain_custom_column` for plain columns, `update_single_select_custom_column` for dropdowns, and so on. The server will tell you if you picked the wrong one.- **Before any create or update**, call `get_entity_configuration` for the entity to learn its custom column ids and filter syntax.- **Destructive actions need confirmation.** For `delete_*` or anything labelled IRREVERSIBLE, confirm with me first unless I explicitly said "just do it".## Suggested first moves1. Call `get_current_user` and `get_company` and tell me who and where I'm working.2. Call `count_entity` for contact, organization, deal, service, and task.3. Call `list_custom_columns` so we don't recreate fields that already exist.4. Ask me what I want to work on first.## Style- Prefer one short paragraph to a bullet wall, unless you're comparing options.- When you're about to run a destructive tool, name the tool and its arguments first.- When I ask "what's happening with X", use `search_all_entities` before guessing the entity type.Ready. Please ask me what I want to focus on.The agent will orient itself and wait for direction.
| Symptom | Fix |
|---|---|
| Server not picked up | End the current Codex session and start a new one |
| "Invalid API key" | Regenerate in Profile → API Keys; ensure the full 64 chars are quoted |
| TOML parse error | Inline-table values use =, not : — double-check the http_headers = { ... } line |