docs: initial draft of built-in MCP server integration page#35604
docs: initial draft of built-in MCP server integration page#35604bobbyiliev wants to merge 3 commits intoMaterializeInc:mainfrom
Conversation
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
acc7f50 to
886d305
Compare
|
|
||
| - [MCP Server](/integrations/llm/) | ||
| - [Built-in MCP Server](/integrations/mcp/) | ||
| - [MCP Server (Python)](/integrations/llm/) |
There was a problem hiding this comment.
I'm not seeing the "(Python)" strangely:

Looking at https://preview.materialize.com/materialize/35604/integrations/llm/
There was a problem hiding this comment.
Hmm, that's odd. The link text in _index.md says "MCP Server (Python)", might be a Hugo rendering issue with the sidebar. Let me check the frontmatter on the Python MCP page.
| - [Built-in MCP Server](/integrations/mcp/) | ||
| - [MCP Server (Python)](/integrations/llm/) |
There was a problem hiding this comment.
Seems a bit strange to have both, why do we need both? Is one legacy? Which should you use?
There was a problem hiding this comment.
+1 to this, but maybe if we launch in public preview we don't remove the old one quite yet?
I'm also totally fine with removing it as soon as we default the flag to on.
There was a problem hiding this comment.
The Python one supports stdio and sse transports and also gives users flexibility to either run it or deploy it separately if they don't want to enable it org wide. I'll add a short note clarifying the difference. Agree with Justin that we keep both for now and later on, deprecating the Python one.
There was a problem hiding this comment.
@maheshwarip -- is the built-in mcp server launching as public preview? If yes, we probably should include {{< public-preview >}} on the mcp page.
There was a problem hiding this comment.
Do we, per chance, want to create an AI agents folder under integrations folder and put these there? That way, the left hand side can be
Tools and integrations
...
AI Agents >
...
Doing so ... I think we can later on move the define data products out of the MCP and LLM pages (definitely doesn't need to be done for this PR).
There was a problem hiding this comment.
Added a private preview for now since the feature flags default to false. Shall I flip it to public preview? We can upgrade to public preview when we're ready to flip the defaults?
doc/user/content/integrations/mcp.md
Outdated
| @@ -0,0 +1,469 @@ | |||
| --- | |||
| title: Built-in MCP Server | |||
There was a problem hiding this comment.
I'd recommend splitting up the docs into 1 page for the observatory, and another page for the agentic server!
There was a problem hiding this comment.
Agree! Makes sense for when we flesh out the observatory docs more. For now both sections are pretty short, want me to split now or once the observatory is more complete?
There was a problem hiding this comment.
Short docs are ok! I think it'll be easier to point a customer to the right doc if we have 1 page for each
doc/user/content/integrations/mcp.md
Outdated
|
|
||
| {{< /tabs >}} | ||
|
|
||
| ## Define data products |
There was a problem hiding this comment.
This section would go into the agent server.
Calling it data products is the right idea. But we use the phrase data products quite a bit with customers. I'd recommend being more verbose, and phrasing this as:
Define and document data products for your agents
The MCP server allows agents to discover and query documented data products. In Materialize, you can make the data product discoverable to customers by creating a Materialized View, adding an index, and adding a comment.
There was a problem hiding this comment.
Neat, I like that! Done, rephrased to "Define and document data products for your agents" with the description you suggested.
doc/user/content/integrations/mcp.md
Outdated
|
|
||
| ## Define data products | ||
|
|
||
| A data product is any materialized view that has an |
There was a problem hiding this comment.
This is a note of feedback on the product itself: do we really need things to be indexed? Why not just have it be MVs with a comment?
There was a problem hiding this comment.
Yes good question, this is more of a product decision. The index is what makes the data product appear in mz_mcp_data_products today (the view joins on mz_indexes). If we want MVs with just a comment to be sufficient, we'd need to change the underlying view. Worth a follow-up discussion!
doc/user/content/integrations/mcp.md
Outdated
| 'The unique identifier for the order'; | ||
| ``` | ||
|
|
||
| ### 4. Set RBAC permissions {#rbac} |
There was a problem hiding this comment.
Nit: I'd rephrase as create a role and permissions for your agent
There was a problem hiding this comment.
Done! renamed to "Create a role and permissions for your agent".
doc/user/content/integrations/mcp.md
Outdated
| GRANT SELECT ON ALL TABLES IN SCHEMA mcp_schema TO mcp_agent; | ||
| GRANT USAGE ON CLUSTER mcp_cluster TO mcp_agent; | ||
|
|
||
| -- Lock the role to the dedicated cluster and schema |
There was a problem hiding this comment.
Huh, this is interesting - I didn't realize we can do this. What does this command do? Does it mean that mcp_agent can only operate with mcp_cluster?
ALTER ROLE mcp_agent SET cluster TO mcp_cluster
There was a problem hiding this comment.
Added inline comments explaining it!
It basically allows all queries from that role run on mcp_cluster and only see objects in mcp_schema by default without having to explicitly set the cluster via an options arg.
|
|
||
| ### `query` | ||
|
|
||
| {{< note >}} |
There was a problem hiding this comment.
Hmm are we still shipping with the query tool? I'm glad we are if so, but I thought we weren't shipping this!
There was a problem hiding this comment.
It's behind a separate flag (enable_mcp_agents_query_tool, default false), so it's not exposed by default. Documenting it here so users know it exists if they opt in. Should I remove this section or add a clearer callout that it's opt-in only?
doc/user/content/integrations/mcp.md
Outdated
|
|
||
| {{< /tabs >}} | ||
|
|
||
| ## Feature flags |
There was a problem hiding this comment.
I'd recommend phrasing this as "Enabling / Disabling the MCP endpoints" rather than "Feature Flags"
There was a problem hiding this comment.
Done! Just renamed to "Enabling / Disabling the MCP endpoints".
b3b3028 to
8b29d50
Compare
doc/user/content/integrations/mcp.md
Outdated
| * **User ID:** Your email address or service account name. | ||
| * **Password:** An [app password](/security/cloud/users-service-accounts/create-service-accounts/). | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Why are we listing the agents endpoint here?
doc/user/content/integrations/mcp.md
Outdated
| CREATE ROLE mcp_agent LOGIN PASSWORD 'secret'; | ||
| ``` | ||
|
|
||
| The MCP endpoints are available on the HTTP listener port (default `6876`): |
There was a problem hiding this comment.
This might get a bit hidden.
Wondering if we can put it up where we discuss the end points.
doc/user/content/integrations/mcp.md
Outdated
|
|
||
| Two endpoints are available: | ||
|
|
||
| | Endpoint | Path | Purpose | |
There was a problem hiding this comment.
If we change Purpose -> Description, we could probably include the port info in here.
|
|
||
| {{< tab "Self-Managed" >}} | ||
|
|
||
| ```mzsql |
There was a problem hiding this comment.
Q: for sm, is it that it'll be 1 mcp_agent login for all?
Otherwise, we might want to make it more like Cloud and make mcp_agent a functional role and then assign to a particular login role.
doc/user/content/integrations/mcp.md
Outdated
| 'The unique identifier for the order'; | ||
| ``` | ||
|
|
||
| ### 4. Create a role and permissions for your agent {#rbac} |
There was a problem hiding this comment.
So ... this doesn't quite fall under your heading of "Define and document data products for your agents".
|
Thanks for the review @kay-kim, just addressed all change requests! |
| - [Built-in MCP Server](/integrations/mcp/) | ||
| - [MCP Server (Python)](/integrations/llm/) |
There was a problem hiding this comment.
@maheshwarip -- is the built-in mcp server launching as public preview? If yes, we probably should include {{< public-preview >}} on the mcp page.
| - [Built-in MCP Server](/integrations/mcp/) | ||
| - [MCP Server (Python)](/integrations/llm/) |
There was a problem hiding this comment.
Do we, per chance, want to create an AI agents folder under integrations folder and put these there? That way, the left hand side can be
Tools and integrations
...
AI Agents >
...
Doing so ... I think we can later on move the define data products out of the MCP and LLM pages (definitely doesn't need to be done for this PR).
doc/user/content/integrations/mcp.md
Outdated
| weight: 23 | ||
| --- | ||
|
|
||
| Materialize includes built-in [Model Context Protocol |
There was a problem hiding this comment.
includes -> provides
That way, if we want to go "Starting in v26.blah, Materialize provides ..."
doc/user/content/integrations/mcp.md
Outdated
| Materialize includes built-in [Model Context Protocol | ||
| (MCP)](https://modelcontextprotocol.io/) endpoints that let AI agents discover | ||
| and query your real-time data products over HTTP. No sidecar process or external | ||
| server is required. The MCP interface is served directly by the database. |
There was a problem hiding this comment.
I'd flip the two sentence:
The MCP interface is served directly by the database; no sidecar process or external server is required.
doc/user/content/integrations/mcp.md
Outdated
| | **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`). | | ||
| | **Observatory** | `/api/mcp/observatory` | Query `mz_*` system catalog tables for troubleshooting and observability. Available on the HTTP port (default `6876`). | | ||
|
|
||
| Both endpoints speak [JSON-RPC 2.0](https://www.jsonrpc.org/specification) over |
doc/user/content/integrations/mcp.md
Outdated
| 'The unique identifier for the order'; | ||
| ``` | ||
|
|
||
| ## Create a role and permissions for your agent {#rbac} |
There was a problem hiding this comment.
Should we move this up to Authentication and rename that section Authentication and Access Control (or something).
doc/user/content/integrations/mcp.md
Outdated
| and query your real-time data products over HTTP. No sidecar process or external | ||
| server is required. The MCP interface is served directly by the database. | ||
|
|
||
| Two endpoints are available: |
There was a problem hiding this comment.
Maybe just make this a heading ## MCP endpoints overview or something?
doc/user/content/integrations/mcp.md
Outdated
|
|
||
| {{< /tabs >}} | ||
|
|
||
| ## Enabling / Disabling the MCP endpoints |
There was a problem hiding this comment.
Wondering if this could go under the endpoints overview section as a child section
doc/user/content/integrations/mcp.md
Outdated
| | `cluster` | string | Yes | Exact cluster name from the data product details. | | ||
| | `sql_query` | string | Yes | PostgreSQL-compatible `SELECT` statement. | | ||
|
|
||
| ## Observatory endpoint |
There was a problem hiding this comment.
I'd recommend adding more information here about the skills that we expose, as well as sample questions that the user can ask. For instance:
--
After you've connected to the observatory MCP server, your coding agents can answer questions such as:
- Why is my my materialized view stale?
- Has my source finished snapshotting yet?
- How much memory is my cluster using?
doc/user/content/integrations/mcp.md
Outdated
| @@ -0,0 +1,469 @@ | |||
| --- | |||
| title: Built-in MCP Server | |||
There was a problem hiding this comment.
Minor: I'd title this as MCP Server for Agents and MCP Server for Observability
doc/user/content/integrations/mcp.md
Outdated
| @@ -0,0 +1,469 @@ | |||
| --- | |||
| title: Built-in MCP Server | |||
There was a problem hiding this comment.
Short docs are ok! I think it'll be easier to point a customer to the right doc if we have 1 page for each
| clusters, and limits visibility to only the data products you choose to expose. | ||
|
|
||
| ```mzsql | ||
| CREATE CLUSTER mcp_cluster SIZE 'xsmall'; |
There was a problem hiding this comment.
Let's use cc sizes here, not tshirt!
|
thanks @maheshwarip! those should be all done now! |
Initial draft of the built-in MCP server documentation.
Fixes https://linear.app/materializeinc/issue/DEX-6/mcp-user-documentation