mcp-materialize


Namemcp-materialize JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryA server that exposes Materialize indexes as tools over the Model Context Protocol (MCP)
upload_time2025-07-23 19:27:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.13
licenseNone
keywords api database materialize mcp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
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

1. **Write a view** that captures your business logic.
2. **Create an index** on its primary lookup key.
3. **Document it** with `COMMENT` statements.

```sql
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`:

```json
{
  "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"
      }
    }
  }
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-materialize",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.13",
    "maintainer_email": null,
    "keywords": "api, database, materialize, mcp",
    "author": null,
    "author_email": "Materialize Inc <support@materialize.com>",
    "download_url": "https://files.pythonhosted.org/packages/e4/d3/52c9e5f6a9d0fa1c016754c9eae74e169ac8ad8bea4ffe96a83485c6ebdb/mcp_materialize-0.3.1.tar.gz",
    "platform": null,
    "description": "# Materialize MCP Server\n\n**Instantly turn indexed views in Materialize into real-time context tools for LLM-powered applications.**\n\nMaterialize MCP Server exposes your Materialize views\u2014when indexed and documented\u2014as live, typed, callable tools. These tools behave like stable APIs for structured data, enabling models to act on fresh, consistent, and trustworthy information.\nNo pipelines, no glue code, no stale caches.\n\n---\n\n## \u2728 What Are Operational Data Products?\n\nViews + indexes + comments = **Operational Data Products**:\nSelf-contained, versioned services that model real-world concepts and provide **fast, reliable, and testable** access to dynamic data.\n\n| Feature        | Benefit                                                               |\n| -------------- | --------------------------------------------------------------------- |\n| **Stable**     | Define once, use repeatedly across use cases.                         |\n| **Typed**      | Input/output schemas inferred directly from indexes.                  |\n| **Observable** | Tool usage is logged per client, revealing real cost and performance. |\n| **Secure**     | If it\u2019s not indexed and documented, it\u2019s not exposed.                 |\n\n---\n\n## \ud83d\ude80 Quickstart\n\n```bash\nuv run mcp-materialize\n```\n\nThis launches the server with default settings and immediately exposes any indexed views as tools.\n\n---\n\n## \u2699\ufe0f Configuration\n\nThe server can be configured via CLI flags or environment variables:\n\n| Argument          | Env Var             | Default                                               | Description                                |\n| ----------------- | ------------------- | ----------------------------------------------------- | ------------------------------------------ |\n| `--mz-dsn`        | `MZ_DSN`            | `postgresql://materialize@localhost:6875/materialize` | Materialize connection string              |\n| `--transport`     | `MCP_TRANSPORT`     | `stdio`                                               | Communication transport (`stdio` or `sse`) |\n| `--host`          | `MCP_HOST`          | `0.0.0.0`                                             | Host address                               |\n| `--port`          | `MCP_PORT`          | `3001`                                                | Port number                                |\n| `--pool-min-size` | `MCP_POOL_MIN_SIZE` | `1`                                                   | Minimum DB pool size                       |\n| `--pool-max-size` | `MCP_POOL_MAX_SIZE` | `10`                                                  | Maximum DB pool size                       |\n| `--log-level`     | `MCP_LOG_LEVEL`     | `INFO`                                                | Log verbosity                              |\n\n---\n\n## \ud83d\udee0 Defining a Tool\n\n1. **Write a view** that captures your business logic.\n2. **Create an index** on its primary lookup key.\n3. **Document it** with `COMMENT` statements.\n\n```sql\nCREATE VIEW order_status_summary AS\nSELECT o.order_id, o.status, s.carrier, c.estimated_delivery, e.delay_reason\nFROM orders o\nLEFT JOIN shipments s            ON o.order_id = s.order_id\nLEFT JOIN carrier_tracking c     ON s.shipment_id = c.shipment_id\nLEFT JOIN delivery_exceptions e ON c.tracking_id = e.tracking_id;\n\nCREATE INDEX ON order_status_summary (order_id);\n\nCOMMENT ON VIEW order_status_summary IS\n  '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.';\n\nCOMMENT ON COLUMN order_status_summary.order_id IS\n  'The unique id for an order';\n```\n\nNow, this tool appears in `/tools/list`:\n\n```json\n{\n  \"name\": \"order_status_summary\",\n  \"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.\",\n  \"inputSchema\": {\n    \"type\": \"object\",\n    \"required\": [\"order_id\"],\n    \"properties\": {\n      \"order_id\": {\n        \"type\": \"text\",\n        \"description\": \"The unique id for an order\"\n      }\n    }\n  }\n}\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A server that exposes Materialize indexes as tools over the Model Context Protocol (MCP)",
    "version": "0.3.1",
    "project_urls": null,
    "split_keywords": [
        "api",
        " database",
        " materialize",
        " mcp"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0bffc93a0ea7ff3ddfbf1f90b734f10528fdf01c83266e71515bda4a00ff3aba",
                "md5": "a07b285ef73cd2eceeb51112ed02dc4d",
                "sha256": "0fde6ced78e9d17b09c33f3352341932b77e64c5b777e021c0f1994389227a97"
            },
            "downloads": -1,
            "filename": "mcp_materialize-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a07b285ef73cd2eceeb51112ed02dc4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.13",
            "size": 13127,
            "upload_time": "2025-07-23T19:27:10",
            "upload_time_iso_8601": "2025-07-23T19:27:10.922566Z",
            "url": "https://files.pythonhosted.org/packages/0b/ff/c93a0ea7ff3ddfbf1f90b734f10528fdf01c83266e71515bda4a00ff3aba/mcp_materialize-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e4d352c9e5f6a9d0fa1c016754c9eae74e169ac8ad8bea4ffe96a83485c6ebdb",
                "md5": "291c07048a81549217c5e5d3dfc0257d",
                "sha256": "0d226db84484966c9c04c42ecd153437f9ce9228d994ff20c75db7f04c133ca8"
            },
            "downloads": -1,
            "filename": "mcp_materialize-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "291c07048a81549217c5e5d3dfc0257d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.13",
            "size": 61122,
            "upload_time": "2025-07-23T19:27:12",
            "upload_time_iso_8601": "2025-07-23T19:27:12.071030Z",
            "url": "https://files.pythonhosted.org/packages/e4/d3/52c9e5f6a9d0fa1c016754c9eae74e169ac8ad8bea4ffe96a83485c6ebdb/mcp_materialize-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-23 19:27:12",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "mcp-materialize"
}
        
Elapsed time: 0.44335s