Connect an AI client (MCP)

The CRM is also an MCP server (Model Context Protocol). Connect an AI client such as Claude, and it can set up and manage your organisation with its own model: create segments, templates, automations and flows, change the data model, look records up and more. It uses the same tools as the built-in assistant, so no AI usage is billed in the CRM.

URLhttps://crm.codefab.dev/api/v1/mcp
TransportStreamable HTTP
AuthenticationSign-in (OAuth) for Claude.ai and ChatGPT, or an X-API-Key header

Claude.ai or ChatGPT in the browser: sign in without a key

Apps in the browser connect by signing in with your CRM login:

  • Claude.ai: Settings → Connectors → Add custom connector. Paste https://crm.codefab.dev/api/v1/mcp, leave the advanced settings empty, choose Connect, sign in and agree.
  • ChatGPT: Settings → Apps & Connectors → Advanced settings → turn on developer mode, then create a connector with https://crm.codefab.dev/api/v1/mcp as the MCP server URL and OAuth as its authentication. Sign in and agree.

The app then works as you: with your permissions, in your organisation, recorded under your name. Its sign-in works for the MCP server only. It can't call the rest of the API with it. Settings → AI tools (MCP) lists your connected apps; Revoke signs an app out for good (connect it again to use it).

Sign in with a user of the organisation you want the app to work in. An account that isn't a member of any organisation, such as a Code F operator account, gets the error no_organisation and can't use the MCP server.

For developers: the server publishes protected resource metadata at /.well-known/oauth-protected-resource/api/v1/mcp and answers 401 with a WWW-Authenticate header pointing there. Apps register themselves with the sign-in server (dynamic client registration; only Claude.ai's and ChatGPT's own callback addresses are accepted) and use the authorization code flow with PKCE.

Quick setup in the app (API key)

Go to Settings → AI tools (MCP). Create a key there with one click (full access, or read only) and copy the ready-made setup for Claude Code, Claude Desktop, Cursor or VS Code: the key is already filled in.

Manual setup

1. Create an API key

Under Settings → API keys, create a key for the client. The key decides what the client may do: give it the scopes for the work you want it to do, or every scope you have to let it manage everything you can. A key can't get scopes you don't have. See Authentication for the scopes.

2. Add the server to your client

Claude Code:

Terminal
claude mcp add --transport http --scope user codefab-crm https://crm.codefab.dev/api/v1/mcp --header "X-API-Key: cfk_…"

Claude Desktop (Settings → Developer → Edit Config, needs Node.js):

JSON
{
"mcpServers": {
"codefab-crm": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://crm.codefab.dev/api/v1/mcp", "--header", "X-API-Key:${CRM_API_KEY}"],
"env": { "CRM_API_KEY": "cfk_…" }
}
}
}

Cursor (~/.cursor/mcp.json) and VS Code (.vscode/mcp.json) take the URL and an X-API-Key header directly; the in-app tab shows the exact JSON.

Other clients that support remote MCP servers over HTTP take the same URL and header in their configuration.

What the client can do

  • The client sees the tools the key's scopes (or, signed in, your permissions) allow, nothing more.
  • Besides the dedicated tools there are api_reference and api_call, which reach the rest of the REST API.
  • Everything happens in the key's organisation and is recorded as done by the key (api-key:<name>) in history and the audit log.
  • Tools that delete data, send messages or change settings are marked as destructive. Your client asks you before running them; keep that approval on.
  • API keys, passwords and other secrets can't be read or changed through MCP.

Treat the key like a password. Your client stores it in its configuration. Revoke it under Settings → API keys when you no longer use the client.