MCP

The Model Context Protocol (MCP) endpoint exposes Directus data and tools to AI assistants via JSON-RPC 2.0 over HTTP. Requires both `MCP_ENABLED=true` and `mcp_enabled: true` in project settings.

MCP Endpoint (GET)

Model Context Protocol (MCP) endpoint accepting JSON-RPC 2.0 messages via GET. Requires `MCP_ENABLED=true` and `mcp_enabled: true` in project settings. Only `application/json` is supported; SSE transport is not available.

Request Body

jsonrpc
string

JSON-RPC protocol version. Must be "2.0".

id

Request identifier. May be a string, integer, or null; omit for notifications.

method
string

MCP method name (e.g. tools/list, tools/call, prompts/list, prompts/get, notifications/initialized).

params
object

Method-specific parameters.

Responses

Successful JSON-RPC response.
jsonrpc
string

JSON-RPC protocol version. Always "2.0".

id

Echoes the id from the corresponding request.

result
object

Method-specific result. Present on success.

error
object

Error details. Present on failure.

// Not supported in Directus SDK
Response Example
{
  "result": {},
  "error": {
    "data": {}
  }
}

MCP Endpoint (POST)

Model Context Protocol (MCP) endpoint accepting JSON-RPC 2.0 messages via POST. Requires `MCP_ENABLED=true` and `mcp_enabled: true` in project settings. Supported methods are `tools/list`, `tools/call`, `prompts/list`, `prompts/get`, and `notifications/initialized`.

Request Body

jsonrpc
string

JSON-RPC protocol version. Must be "2.0".

id

Request identifier. May be a string, integer, or null; omit for notifications.

method
string

MCP method name (e.g. tools/list, tools/call, prompts/list, prompts/get, notifications/initialized).

params
object

Method-specific parameters.

Responses

Successful JSON-RPC response.
jsonrpc
string

JSON-RPC protocol version. Always "2.0".

id

Echoes the id from the corresponding request.

result
object

Method-specific result. Present on success.

error
object

Error details. Present on failure.

// Not supported in Directus SDK
Response Example
{
  "result": {},
  "error": {
    "data": {}
  }
}