# POST /api/mcp > MCP - MCP Server (AI Agents) Model Context Protocol server over Streamable HTTP (JSON-RPC 2.0). Exposes the whole RISE CRM REST surface - list, get, search, create, update and delete tools across 41 resources plus lookup catalogues and utilities - to Claude Desktop, ChatGPT, Cursor, n8n AI Agent and any other MCP client. Three capabilities are advertised by initialize : tools ( tools/list , tools/call ), resources ( resources/list , resources/templates/list , resources/read ) and prompts ( prompts/list , prompts/get ). ping is supported too. Line items. The six line item tables are ordinary resources (invoice_items, estimate_items, proposal_items, order_items, contract_items, subscription_items), and each document type also has a composite tool - invoices_create_with_items , estimates_create_with_items , proposals_create_with_items , orders_create_with_items , contracts_create_with_items , subscriptions_create_with_items - that validates the lines, writes the header, then its lines, then recalculates the document totals in one call. The whole composite call runs in a single database transaction, so a rejected line rolls the header back with it and never leaves a document with missing lines. Context resources. resources/read returns a per-record document under a rise:// URI, for example rise://clients/12 or rise://invoices/48 , with the record and the collections that belong to it (contacts, projects, line items, payments, tasks, comments). rise://catalogue/lookups resolves every RISE picker in one read, and rise://server/info describes the server. Prompts. prompts/list returns canned prompts - summarise a client, draft a follow-up for a lead, explain an invoice, report on a project, triage open tickets, review the pipeline - and prompts/get renders one with the record it is about already attached as an embedded resource. Payload size. tools/list answers with the whole catalogue in one page when no cursor is sent, which is what MCP clients expect. A client that wants pages opts in by sending cursor ("0" starts at the beginning) and then follows nextCursor . An administrator can shrink the catalogue with the api_mcp_resources setting: a comma separated list, or a JSON array, of the resource keys to expose. Absent or empty exposes everything, so nothing changes by default. The setting fails closed everywhere: a resource left out of the list has no tools, cannot be read through a rise:// URI, and is not returned as a related collection of another record's document either. Lookup and utility tools are always available. Responses are compact JSON, not pretty printed. Batch arrays and notifications follow the JSON-RPC 2.0 spec: any method starting with notifications/ produces no response, and a payload made only of notifications returns HTTP 202 with an empty body. Tool failures come back as isError: true results rather than protocol errors so the agent can read and react to the message: validation failures carry the reason, while unexpected internal failures return a generic message and the detail is written to the RISE error log instead of being sent to the client. Resource and prompt failures are protocol errors instead, per the MCP spec: code -32002 for a resource that cannot be read, -32602 for a bad prompt name or a missing prompt argument. The server is disabled by default - set the api_mcp_enabled setting to 1 to turn it on. Point your MCP client at this URL and send the authtoken header. - **Endpoint:** `POST /api/mcp` - **Group:** MCP - **Since:** v1.0.0 - **Defined in:** `RestApi/Controllers/McpController.php` ## Headers | Field | Type | Description | | --- | --- | --- | | `authtoken` | String | Authentication token, generated from admin area | ## Parameters | Field | Type | Required | Description | | --- | --- | --- | --- | | `jsonrpc` | String | yes | Mandatory Must be "2.0" | | `method` | String | yes | Mandatory One of initialize, ping, tools/list, tools/call, resources/list, resources/templates/list, resources/read, prompts/list, prompts/get, notifications/* | | `id` | Number | no | Optional Request id (number or string). Omit it to send a notification, which returns no response | | `params` | Object | no | Optional Method parameters. For tools/call: name and arguments . For tools/list: an optional cursor . For resources/read: uri . For prompts/get: name and arguments | ## Request example ```bash curl -X POST "https://yoursite.com/index.php/api/mcp" \ -H "authtoken: YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "...", "method": "..." }' ``` ## Responses ### Success - initialize: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": { "listChanged": false }, "resources": { "subscribe": false, "listChanged": false }, "prompts": { "listChanged": false } }, "serverInfo": { "name": "rise-crm-rest-api", "version": "2.1.0" } }, "id": 1 } ``` ### Success - tools/list: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "tools": [ { "name": "clients_list", "description": "List RISE CRM clients, newest first, soft-deleted rows excluded. Clients are the converted customer companies that projects, invoices, estimates, tickets and contracts are attached to. Page with limit and offset; narrow the created_date range with created_after and created_before; match exact column values with filters.", "inputSchema": { "type": "object", "properties": { "limit": { "type": "integer", "description": "Max rows, default 25.", "minimum": 1, "maximum": 100 }, "offset": { "type": "integer", "description": "Rows to skip.", "minimum": 0 }, "created_after": { "type": "string", "description": "Lower bound on created_date. YYYY-MM-DD or YYYY-MM-DD HH:MM:SS." }, "created_before": { "type": "string", "description": "Upper bound on created_date, same format." }, "filters": { "type": "object", "description": "Exact-match filters, e.g. {\"client_id\":12}. Useful: owner_id, created_by, type, country. Unknown columns ignored.", "additionalProperties": true } } } }, { "name": "clients_search", "description": "Find RISE CRM clients by keyword, matched as a substring of company_name, address, city, state, zip, country, phone, vat_number. Use it to turn a name or title into a record id.", "inputSchema": { "type": "object", "properties": { "q": { "type": "string", "description": "Keyword. Case-insensitive substring match." }, "limit": { "type": "integer", "description": "Max rows, default 25.", "minimum": 1, "maximum": 100 } }, "required": ["q"] } } ] }, "id": 2 } ``` ### Success - tools/list paged (opt in with a cursor): ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "tools": [], "nextCursor": "dG9vbHM6NTA" }, "id": 2 } ``` ### Success - resources/list: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "resources": [ { "uri": "rise://server/info", "name": "RISE server info", "mimeType": "application/json" }, { "uri": "rise://catalogue/resources", "name": "RISE record catalogue", "mimeType": "application/json" }, { "uri": "rise://catalogue/lookups", "name": "RISE lookup values", "mimeType": "application/json" } ] }, "id": 6 } ``` ### Success - resources/read of rise://invoices/48: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "contents": [ { "uri": "rise://invoices/48", "mimeType": "application/json", "text": "{\"resource\":\"invoices\",\"id\":48,\"record\":{...},\"items\":[...],\"payments\":[...]}" } ] }, "id": 7 } ``` ### Success - prompts/list: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "prompts": [ { "name": "summarise_client", "description": "Summarise a client: who they are, their contacts, active work, invoicing position and what to do next.", "arguments": [ { "name": "client_id", "description": "Numeric client id. Use clients_search to find it from a company name.", "required": true } ] } ] }, "id": 8 } ``` ### Success - prompts/get summarise_client: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "description": "Summarise a client: who they are, their contacts, active work, invoicing position and what to do next.", "messages": [ { "role": "user", "content": { "type": "text", "text": "Summarise RISE CRM client 12 for an account review. ..." } }, { "role": "user", "content": { "type": "resource", "resource": { "uri": "rise://clients/12", "mimeType": "application/json", "text": "{...}" } } } ] }, "id": 9 } ``` ### Success - tools/call: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "content": [ { "type": "text", "text": "{\n \"count\": 1,\n \"records\": [\n {\n \"id\": \"12\",\n \"company_name\": \"Acme Corporation\",\n \"city\": \"San Francisco\",\n \"created_date\": \"2026-02-14 09:21:45\"\n }\n ]\n}" } ], "isError": false }, "id": 1 } ``` ### Success - Notification only payload: ```json HTTP/1.1 202 Accepted ``` ### Error - MCP server disabled: ```json HTTP/1.1 403 Forbidden { "jsonrpc": "2.0", "error": { "code": -32000, "message": "MCP server is disabled." }, "id": null } ``` ### Error - Parse error: ```json HTTP/1.1 400 Bad Request { "jsonrpc": "2.0", "error": { "code": -32700, "message": "Parse error: the request body must be a JSON-RPC 2.0 object or array." }, "id": null } ``` ### Error - Unknown method: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "error": { "code": -32601, "message": "Method not found: tools/get" }, "id": 3 } ``` ### Error - Tool failure (isError result, not a protocol error): ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "result": { "content": [{ "type": "text", "text": "Error: Client 999 was not found." }], "isError": true }, "id": 4 } ``` ### Error - Resource that cannot be read: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "error": { "code": -32002, "message": "Invoice 999 was not found." }, "id": 7 } ``` ### Error - Missing prompt argument: ```json HTTP/1.1 200 OK { "jsonrpc": "2.0", "error": { "code": -32602, "message": "The \"summarise_client\" prompt requires the \"client_id\" argument." }, "id": 9 } ``` --- Part of the [REST API for RISE CRM](https://risecrm.themesic.com/apiguide/) documentation. Full page: https://risecrm.themesic.com/apiguide/mcp/mcp-server/