MCP Server (AI Agents)

POST/api/mcp

Model Context Protocol server over Streamable HTTP (JSON-RPC 2.0). Exposes 148 permission-filtered CRM tools (list/get/search/create/update/delete across 22 resources, plus lookups and utilities) to Claude Desktop, ChatGPT, Cursor, n8n AI Agent and any MCP client. Supported methods: initialize, ping, tools/list (single page), tools/call. Batches and notifications follow the JSON-RPC spec. Tool errors are returned as isError results so agents can react. Disabled by default - enable it under Setup > API > Settings. Configure your MCP client with this URL and the authtoken header.

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area.
Authorization String optional Accepted as an alternative to authtoken, as Bearer YOUR_API_TOKEN or as the bare token. Use this with MCP clients whose connector UI cannot set an arbitrary custom header. On a self-hosted server, Apache running PHP as CGI/FastCGI/PHP-FPM strips the Authorization header before PHP sees it unless the vhost or .htaccess forwards it - add CGIPassAuth On or RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] . The authtoken header always works and needs no server configuration, so prefer it where the client allows it.
curl -X POST "https://yoursite.com/api/mcp" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "field": "value" }'

tools/list:

HTTP/1.1 200 OK
{
  "jsonrpc": "2.0",
  "result": {
    "tools": [
      {
        "name": "customers_list",
        "description": "List customers. Supports limit/offset and optional date range.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "limit": { "type": "integer", "description": "Max rows (default 25, max 100)" },
            "offset": { "type": "integer", "description": "Rows to skip" },
            "created_after": { "type": "string", "description": "ISO date lower bound" },
            "created_before": { "type": "string", "description": "ISO date upper bound" }
          }
        }
      },
      {
        "name": "customers_search",
        "description": "Search customers by keyword (matches company, vat, phonenumber).",
        "inputSchema": {
          "type": "object",
          "properties": {
            "q": { "type": "string", "description": "Search keyword" },
            "limit": { "type": "integer", "description": "Max rows (default 25, max 100)" }
          },
          "required": ["q"]
        }
      },
      {
        "name": "invoices_create",
        "description": "Create a invoice. Pass the record fields as the \"data\" object (same field names as the REST API).",
        "inputSchema": {
          "type": "object",
          "properties": {
            "data": { "type": "object", "description": "Field map for the new record" }
          },
          "required": ["data"]
        }
      }
    ]
  },
  "id": 1
}

tools/call:

HTTP/1.1 200 OK
{
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "[\n    {\n        \"userid\": \"12\",\n        \"company\": \"Acme Corporation\",\n        \"vat\": \"GB123456789\",\n        \"phonenumber\": \"+1 415 555 0132\",\n        \"city\": \"San Francisco\",\n        \"zip\": \"94103\",\n        \"state\": \"California\",\n        \"country\": \"231\",\n        \"datecreated\": \"2026-02-14 09:21:45\",\n        \"active\": \"1\"\n    }\n]"
      }
    ],
    "isError": false
  },
  "id": 2
}

Unknown method:

HTTP/1.1 200 OK
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32601,
    "message": "Method not found: tools/get"
  },
  "id": 3
}
MethodPOST
Path/api/mcp
GroupMCP
Sincev3.0.0
Defined inmodules/api/controllers/Mcp.php