You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/user/content/integrations/mcp.md
+97-17Lines changed: 97 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,10 @@ server is required — the MCP interface is served directly by the database.
15
15
16
16
Two endpoints are available:
17
17
18
-
| Endpoint | Path |Purpose|
19
-
|----------|------|---------|
20
-
|**Agents**|`/api/mcp/agents`| Discover and read data products (indexed views with comments). Designed for customer-facing AI agents. |
21
-
|**Observatory**|`/api/mcp/observatory`| Query `mz_*` system catalog tables for troubleshooting and observability. |
18
+
| Endpoint | Path |Description|
19
+
|----------|------|-------------|
20
+
|**Agents**|`/api/mcp/agents`| Discover and read data products (indexed views with comments). Designed for customer-facing AI agents. Available on the HTTP port (default `6876`). |
21
+
|**Observatory**|`/api/mcp/observatory`| Query `mz_*` system catalog tables for troubleshooting and observability. Available on the HTTP port (default `6876`). |
22
22
23
23
Both endpoints speak [JSON-RPC 2.0](https://www.jsonrpc.org/specification) over
24
24
HTTP POST and support the MCP `initialize`, `tools/list`, and `tools/call`
@@ -40,28 +40,23 @@ Use the credentials of a Materialize user or
40
40
***User ID:** Your email address or service account name.
41
41
***Password:** An [app password](/security/cloud/users-service-accounts/create-service-accounts/).
42
42
43
-
```
44
-
https://<region-host>/api/mcp/agents
45
-
```
46
-
47
43
For production use, we recommend creating a dedicated service account and
48
44
granting it a role with [limited privileges](#rbac).
49
45
50
46
{{< /tab >}}
51
47
52
48
{{< tab "Self-Managed" >}}
53
49
54
-
Use the credentials of a Materialize role with `LOGIN`:
50
+
Create a functional role for MCP privileges, then assign it to a login role:
55
51
56
52
```mzsql
57
-
CREATE ROLE mcp_agent LOGIN PASSWORD 'secret';
53
+
CREATE ROLE mcp_agent;
54
+
CREATE ROLE my_agent LOGIN PASSWORD 'secret';
55
+
GRANT mcp_agent TO my_agent;
58
56
```
59
57
60
-
The MCP endpoints are available on the HTTP listener port (default `6876`):
61
-
62
-
```
63
-
http://<host>:6876/api/mcp/agents
64
-
```
58
+
Authenticate using the login role credentials (`my_agent`). You can create
59
+
additional login roles and grant them the same `mcp_agent` role as needed.
65
60
66
61
{{< /tab >}}
67
62
@@ -118,7 +113,7 @@ COMMENT ON COLUMN mcp_schema.payment_status.order_id IS
118
113
'The unique identifier for the order';
119
114
```
120
115
121
-
### 4. Create a role and permissions for your agent {#rbac}
116
+
## Create a role and permissions for your agent {#rbac}
122
117
123
118
The role used to authenticate with the MCP endpoint must have:
124
119
@@ -194,6 +189,23 @@ Discover all available data products. Returns a list of names and descriptions.
194
189
195
190
**Parameters:** None.
196
191
192
+
**Example response:**
193
+
194
+
```json
195
+
{
196
+
"jsonrpc": "2.0",
197
+
"id": 1,
198
+
"result": {
199
+
"content": [
200
+
{
201
+
"type": "text",
202
+
"text": "[\n [\n\"\\\"materialize\\\".\\\"mcp_schema\\\".\\\"payment_status\\\"\",\n\"Given an order ID, return the current payment status.\",\n\"mcp_cluster\"\n ]\n]"
203
+
}
204
+
]
205
+
}
206
+
}
207
+
```
208
+
197
209
### `get_data_product_details`
198
210
199
211
Get the full schema (columns, types, index keys) for a specific data product.
@@ -202,6 +214,23 @@ Get the full schema (columns, types, index keys) for a specific data product.
202
214
|-----------|------|----------|-------------|
203
215
|`name`| string | Yes | Exact name from the `get_data_products` list. |
0 commit comments