A server that exposes Materialize indexes as tools over the Model Context Protocol (MCP)
Project description
Materialize MCP Server
Instantly turn indexed views in Materialize into real-time context tools for LLM-powered applications.
Materialize MCP Server exposes your Materialize views—when indexed and documented—as live, typed, callable tools. These tools behave like stable APIs for structured data, enabling models to act on fresh, consistent, and trustworthy information. No pipelines, no glue code, no stale caches.
✨ What Are Operational Data Products?
Views + indexes + comments = Operational Data Products: Self-contained, versioned services that model real-world concepts and provide fast, reliable, and testable access to dynamic data.
| Feature | Benefit |
|---|---|
| Stable | Define once, use repeatedly across use cases. |
| Typed | Input/output schemas inferred directly from indexes. |
| Observable | Tool usage is logged per client, revealing real cost and performance. |
| Secure | If it’s not indexed and documented, it’s not exposed. |
🚀 Quickstart
uv run mcp-materialize
This launches the server with default settings and immediately exposes any indexed views as tools.
⚙️ Configuration
The server can be configured via CLI flags or environment variables:
| Argument | Env Var | Default | Description |
|---|---|---|---|
--mz-dsn |
MZ_DSN |
postgresql://materialize@localhost:6875/materialize |
Materialize connection string |
--transport |
MCP_TRANSPORT |
stdio |
Communication transport (stdio or sse) |
--host |
MCP_HOST |
0.0.0.0 |
Host address |
--port |
MCP_PORT |
3001 |
Port number |
--pool-min-size |
MCP_POOL_MIN_SIZE |
1 |
Minimum DB pool size |
--pool-max-size |
MCP_POOL_MAX_SIZE |
10 |
Maximum DB pool size |
--log-level |
MCP_LOG_LEVEL |
INFO |
Log verbosity |
🛠 Defining a Tool
- Write a view that captures your business logic.
- Create an index on its primary lookup key.
- Document it with
COMMENTstatements.
CREATE VIEW order_status_summary AS
SELECT o.order_id, o.status, s.carrier, c.estimated_delivery, e.delay_reason
FROM orders o
LEFT JOIN shipments s ON o.order_id = s.order_id
LEFT JOIN carrier_tracking c ON s.shipment_id = c.shipment_id
LEFT JOIN delivery_exceptions e ON c.tracking_id = e.tracking_id;
CREATE INDEX ON order_status_summary (order_id);
COMMENT ON VIEW order_status_summary IS
'Given an order ID, retrieve the current status, shipping carrier, estimated delivery date, and any delivery exceptions. Use this tool to show real-time order tracking information to users.';
COMMENT ON COLUMN order_status_summary.order_id IS
'The unique id for an order';
Now, this tool appears in /tools/list:
{
"name": "order_status_summary",
"description": "Given an order ID, retrieve the current status, shipping carrier, estimated delivery date, and any delivery exceptions. Use this tool to show real-time order tracking information to users.",
"inputSchema": {
"type": "object",
"required": ["order_id"],
"properties": {
"order_id": {
"type": "text",
"description": "The unique id for an order"
}
}
}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_materialize-0.2.0.tar.gz.
File metadata
- Download URL: mcp_materialize-0.2.0.tar.gz
- Upload date:
- Size: 52.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
044f3bb29457ebd43eb202bc5de239acc158bc981a38f9cccf84803d6bbccf3b
|
|
| MD5 |
77150b25feb9be1474389f0ed1ab68a9
|
|
| BLAKE2b-256 |
fcd8249bcb87becaecd36cfa152813823b578f71139cf11f7b59918029c96971
|
File details
Details for the file mcp_materialize-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_materialize-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04d7736f99e6e2eebdb3d1ad4c4cc9345405e493ca6e862f9ba86350f38f8fc9
|
|
| MD5 |
7b3d8f89e5aa6e3866311c4c87b0bb24
|
|
| BLAKE2b-256 |
eded318528fce6a6b64c6ff7793cbad8dc5135236f6a925c6a3babda979a9cda
|