# Warehouse MCP

> Warehouse MCP is an open-source MCP server for databases. Read-only warehouse access for agents with SQL guard, row policies and pseudonymised PII. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted, CLI
- **Repository:** https://github.com/tantn89/warehouse-mcp
- **MCP Registry name:** io.github.tantn89/warehouse-mcp
- **Categories:** [databases](https://ai-powered.com/categories/databases), [analytics and data](https://ai-powered.com/categories/analytics-and-data), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-18

## About

The author's pitch is to give agents your data without giving them your warehouse. A semantic model lets agents ask for named metrics by dimension, a SQL guard allows only single SELECT statements on declared datasets with a function allowlist and a LIMIT cap, and each engine is locked down independently of the guard: DuckDB read-only without file access, Postgres a read-only transaction plus grants, BigQuery a dry run with a byte cap.

Personal columns are replaced by salted hashes inside the warehouse query, so counts and joins stay exact while names never leave. Roles come from the bearer key over HTTP and can carry row filters, and an audit log records calls without values or salt. Results are cell-capped with email and phone redaction.

The README reports 104 bypass attempts with no leaks on DuckDB and Postgres, identical results for 15 queries across three engines, and a 26-case Claude Haiku 5.5 evaluation at 78 of 78 correct. A demo with about 100,000 live Wikipedia edits runs with no keys.

## Features

- **Governed SQL guard:** Single SELECT statements on declared datasets, with function allowlist and capped LIMIT.
- **Pseudonymised PII:** Personal columns become salted hashes inside the warehouse query.
- **Per-role row policies:** Bearer keys map to roles with row filters and dataset access.
- **Metrics-first queries:** Named metrics by dimensions and time buckets, built as a syntax tree.
- **Cost cap:** BigQuery queries are refused before billing when they exceed a byte cap.
- **Audit log:** JSONL log of calls without values or salt.
- **Three backends:** DuckDB, Postgres and BigQuery.

## Good for

- Let an analyst agent answer metric questions without raw table access
- Give an external partner a single-region view of event data
- Try governed analytics on the bundled Wikipedia demo
- Stop an agent from running an expensive BigQuery scan

## Install

### Claude Code (Terminal)

```sh
claude mcp add warehouse-mcp --env WAREHOUSE_MCP_POSTGRES_DSN='<WAREHOUSE_MCP_POSTGRES_DSN>' --env WAREHOUSE_MCP_PII_SALT='<WAREHOUSE_MCP_PII_SALT>' -- uvx warehouse-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "warehouse-mcp": {
      "command": "uvx",
      "args": [
        "warehouse-mcp"
      ],
      "env": {
        "WAREHOUSE_MCP_POSTGRES_DSN": "<WAREHOUSE_MCP_POSTGRES_DSN>",
        "WAREHOUSE_MCP_PII_SALT": "<WAREHOUSE_MCP_PII_SALT>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "warehouse-mcp": {
      "command": "uvx",
      "args": [
        "warehouse-mcp"
      ],
      "env": {
        "WAREHOUSE_MCP_POSTGRES_DSN": "<WAREHOUSE_MCP_POSTGRES_DSN>",
        "WAREHOUSE_MCP_PII_SALT": "<WAREHOUSE_MCP_PII_SALT>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "warehouse-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "warehouse-mcp"
      ],
      "env": {
        "WAREHOUSE_MCP_POSTGRES_DSN": "<WAREHOUSE_MCP_POSTGRES_DSN>",
        "WAREHOUSE_MCP_PII_SALT": "<WAREHOUSE_MCP_PII_SALT>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "warehouse-mcp": {
      "command": "uvx",
      "args": [
        "warehouse-mcp"
      ],
      "env": {
        "WAREHOUSE_MCP_POSTGRES_DSN": "<WAREHOUSE_MCP_POSTGRES_DSN>",
        "WAREHOUSE_MCP_PII_SALT": "<WAREHOUSE_MCP_PII_SALT>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "warehouse-mcp": {
      "command": "uvx",
      "args": [
        "warehouse-mcp"
      ],
      "env": {
        "WAREHOUSE_MCP_POSTGRES_DSN": "<WAREHOUSE_MCP_POSTGRES_DSN>",
        "WAREHOUSE_MCP_PII_SALT": "<WAREHOUSE_MCP_PII_SALT>"
      }
    }
  }
}
```

## Tools

- `warehouse_list_datasets`: What the caller's role may query, with each dataset's grain and metrics
- `warehouse_describe_dataset`: Columns, pseudonymised fields, row policy and three sample rows
- `warehouse_query_metrics`: Named metrics by dimensions and time buckets
- `warehouse_run_sql`: One guarded SELECT for questions metrics cannot express

## FAQ

### Which databases work?

DuckDB, Postgres and BigQuery.

### Can an agent write data?

Writes are refused by the SQL guard and, separately, by the engine's read-only settings.

### How are names protected?

The guard rewrites dataset references so personal columns are salted hashes, keeping counts exact but hiding values.

### How can I try it without keys?

Run uvx warehouse-mcp --demo to use the bundled Wikipedia edits dataset.

### How was it tested?

The README cites a 104-attempt red-team suite with 0 leaks on DuckDB and Postgres.

### Is Warehouse MCP free?

Yes. Warehouse MCP is open source, so you can use and self-host it for free.

### How do I add Warehouse MCP to Claude Code?

Run this command in your terminal: claude mcp add warehouse-mcp --env WAREHOUSE_MCP_POSTGRES_DSN='<WAREHOUSE_MCP_POSTGRES_DSN>' --env WAREHOUSE_MCP_PII_SALT='<WAREHOUSE_MCP_PII_SALT>' -- uvx warehouse-mcp

### What are the best alternatives to Warehouse MCP?

The closest alternatives to Warehouse MCP are REA, Agent-Native Analytics, Google Ads + Meta Ads + SEO/GEO MCP, dashboard-icons and AiSOC.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Google Ads + Meta Ads + SEO/GEO MCP](https://ai-powered.com/mcp/google-ads-meta-ads-seo-geo-mcp): Google Ads + Meta Ads + SEO/GEO MCP is a freemium MCP server for marketing and seo.
- [dashboard-icons](https://ai-powered.com/mcp/dashboard-icons): dashboard-icons is an open-source MCP server for analytics and data.
- [AiSOC](https://ai-powered.com/mcp/aisoc): AiSOC is an open-source MCP server for ai models and llm tooling.
- [redamon](https://ai-powered.com/mcp/redamon): redamon is an open-source MCP server for ai models and llm tooling.
- [x64dbg-mcp-server](https://ai-powered.com/mcp/x64dbg-mcp-server): x64dbg-mcp-server is an open-source MCP server for ai models and llm tooling.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/warehouse-mcp-2
