# Materialize MCP

> Materialize (Streaming SQL DB) lets your AI agent manage real-time database pipelines. You execute streaming SQL, provision compute clusters (xs through xl), and monitor data health using standard SQL—all from a chat interface. It turns complex infrastructure operations into simple conversation.

## Overview
- **Category:** databases
- **Price:** Free
- **Tags:** streaming-sql, real-time-data, materialized-views, data-engineering, cloud-database

## Description

**Materialize Streaming SQL DB MCP Server – Manage Real-Time Data**

Forget writing complex, multi-step infrastructure scripts just to run a query on live data. This server lets your AI agent talk directly to Materialize, turning complicated database operations into simple chat commands. You manage everything—from verifying the system's health to spinning up massive compute clusters and running streaming SQL queries—all through natural language conversation. It’s about making complex backend maintenance feel as easy as sending a Slack message.

When you connect your agent, you gain instant control over your entire Materialize environment. You don't need to jump between dashboards or run command-line interfaces just to get data. Your AI client handles the plumbing for you.

### Checking and Building Your Infrastructure

You gotta know if the lights are on before you start pulling reports. Use `check_health` whenever you want a quick diagnostic check of your entire Materialize instance. It immediately confirms the operational status, so you never have to wonder if your data pipeline is stuck or down. 

If things look good, but you need more muscle, you can scale up using `create_cluster`. You tell your agent exactly what size compute cluster you need—you can specify anywhere from an `xs` footprint all the way up to an `xl` powerhouse. This tool provisions and initializes a brand new resource tailored for your workload.

Need to know what clusters are already running? Just run `list_clusters`. It pulls a complete, detailed inventory of every single compute cluster configured in your environment, giving you the metadata you need at a glance.

### Handling Your Data Sources and Queries

The real power here is managing the data itself. You control how Materialize ingests and processes live feeds. To start pulling data from external topics or streams, you use DDL commands like `CREATE SOURCE`. This tells your system exactly where to find the raw material it needs to model.

Once the source is defined, running queries is simple. The agent executes standard SQL statements against that constantly changing stream of data using `execute_sql`. You can run one or more complex SQL statements in a single go. Because this server operates on streaming data, these aren't static reports; they reflect what's happening right now.

If you need to define new relationships or modify the way your data is structured *after* it’s been ingested, `execute_sql` handles those Materialize-specific commands too. You don't write separate scripts for every single stream; you just tell your agent what you want modeled, and it runs the necessary SQL.

### How It Works in Practice

It’s straightforward: First, subscribe to the server and drop in your Materialize API Key. Then, connect your preferred AI client—whether that's Claude or Cursor—to the Vinkius Marketplace. From there, you just talk to it. You can ask things like, 'Hey, check the health of the primary instance,' which triggers `check_health`. Or you might say, 'I need a new cluster for the billing data; make it medium size,' running `create_cluster` with the appropriate parameters.

If your job is to continuously track market movements, you can tell it, 'Start ingesting data from the NASDAQ topic and model it using this SQL.' That combination of DDL commands and querying happens without you lifting a finger. You manage infrastructure health, resource scaling, and complex real-time queries—all through conversation with your agent.

## Tools

### create_cluster
Provisions and initializes a brand new compute cluster, allowing you to specify the size (xs through xl).

### execute_sql
Executes one or more standard SQL statements against your streaming database.

### check_health
Runs a diagnostic check to confirm the operational status of your Materialize instance.

### list_clusters
Retrieves a full inventory and metadata list of all existing compute clusters in the environment.

## Prompt Examples

**Prompt:** 
```
Check the health status of my Materialize instance.
```

**Response:** 
```
I've checked the instance health. The Materialize instance is currently healthy and operational.
```

**Prompt:** 
```
List all the compute clusters I have configured.
```

**Response:** 
```
I found 2 compute clusters: 'analytics-cluster' (size: m) and 'default' (size: xs).
```

**Prompt:** 
```
Execute SQL to create a new source from my Kafka topic 'orders'.
```

**Response:** 
```
The SQL statement to create the source 'orders' has been executed successfully. Materialize is now ingesting data from that Kafka topic.
```

## Capabilities

### Execute Streaming Queries
You run standard or Materialize-specific SQL statements against live data feeds.

### Provision Compute Clusters
Your agent creates new compute clusters, selecting the necessary size (xs through xl) for your workload.

### Validate Instance Status
You instantly check the operational health and status of the entire Materialize database instance using `check_health`.

### View Cluster Inventory
The agent retrieves a detailed list of all compute clusters currently configured for your environment.

### Define Data Sources
You issue DDL commands, such as `CREATE SOURCE`, to start ingesting data from external topics or streams.

## Use Cases

### The Data Analyst needs to test a new query against live data.
A data analyst needs to verify if a complex JOIN will fail on a newly streamed dataset. Instead of running the SQL in a separate client, they ask their agent: 'Execute this SELECT statement.' The agent uses `execute_sql`, runs the query, and returns the results immediately for review.

### The DevOps team needs to scale up resources before peak hours.
Knowing a major ETL job is coming, the ops engineer first calls `list_clusters` to see current capacity. Then, they preemptively call `create_cluster`, specifying an 'xl' size. The agent handles the provisioning and confirms when the new compute cluster is ready.

### The Data Engineer needs to add a new data feed.
A new Kafka topic starts generating order data that needs to be modeled. The engineer prompts their agent: 'Create a source from this Kafka topic.' The agent uses `execute_sql` with the necessary DDL, bringing the live stream under Materialize control.

### The SRE checks system stability after an outage.
After a service interruption, the SRE doesn't guess. They ask their agent to run `check_health`. The agent confirms whether the instance is fully operational before allowing any data queries or cluster changes.

## Benefits

- Stop jumping between terminals and dashboards. You run resource provisioning (`create_cluster`) or validation checks (`check_health`) with a single command to your agent.
- You get immediate visibility into your entire system state using `list_clusters`, listing every cluster, size, and metadata point without running complex scripts first.
- Complex data modeling is easier. Instead of writing boiler-plate DDL for sources, you use `execute_sql` to define new materialized views directly from conversation.
- Scale compute power instantly. If your load spikes, you don't wait on a ticket; you call `create_cluster` and the resource appears when needed.
- Validate pipelines quickly. Before running heavy queries, calling `check_health` gives instant confirmation that the whole stack is operational.

## How It Works

The bottom line is that you manage complex database infrastructure by talking directly to your agent.

1. Subscribe to the server and enter your Materialize API Key.
2. Connect your AI client (e.g., Cursor, Claude).
3. Ask your agent to run a command: 'Check the health of the instance,' or 'Run this SELECT statement.'

## Frequently Asked Questions

**How do I check if my Materialize instance is okay using the check_health tool?**
Use `check_health`. This command instantly verifies the operational status, telling you right away if there are any system failures or necessary maintenance on the instance.

**What's the first thing I should run to see what clusters exist? (list_clusters)**
You need to use `list_clusters`. This command pulls up a complete inventory of all your configured compute clusters, allowing you to check metadata and sizes before making any changes.

**I need more processing power. How do I create a new cluster? (create_cluster)**
Use `create_cluster`. You must specify the desired size (e.g., 'm' or 'l') when you ask your agent to run this tool, ensuring you allocate exactly what you need.

**Can I use execute_sql for complex DDL statements?**
Yes. `execute_sql` runs standard SQL and Materialize-specific commands like 'CREATE SOURCE'. This lets you model new live data feeds directly through your agent.

**How do I set up a new real-time data source using `execute_sql`?**
You use the `CREATE SOURCE` command within `execute_sql`. This tells Materialize to start ingesting live data from your specific Kafka topic or stream. Your agent handles the entire setup process in one step.

**What metadata can I pull about my compute clusters using `list_clusters`?**
The tool returns more than just names; it lists key metrics like the cluster size (e.g., 's' or 'l'). This lets you compare current resource allocation against your processing needs.

**How do I manage live data subscriptions using `execute_sql`?**
You use the `SUBSCRIBE` command in `execute_sql`. This actively monitors a specific data feed. Your agent can then process results as soon as new data arrives, rather than waiting for batch runs.

**If I need to optimize resources, how do I inspect my materialized views?**
You query system tables using `execute_sql`. Running these inspection queries helps you see which specific data sets are consuming the most compute power. This points you toward necessary resource adjustments.

**Can I create a new materialized view using this server?**
Yes. You can use the `execute_sql` tool to run any valid Materialize SQL command, including `CREATE MATERIALIZED VIEW` to start processing your data streams in real-time.

**How do I scale my compute resources through the AI?**
You can use the `create_cluster` tool and specify a size (xs, s, m, l, or xl). This allows you to provision new compute capacity directly through the conversation.

**Is there a way to check if my Materialize instance is currently reachable?**
Yes, the `check_health` tool is designed specifically for this. It returns the current status of your instance to confirm it is operational.