Metadata-Version: 2.4
Name: metabase-mcp-pro
Version: 0.1.0
Summary: Agent-first Metabase MCP server with a pluggable, table-scoped query-guardrail layer.
Project-URL: Homepage, https://github.com/Orlik9l/mcps/tree/main/metabase-mcp-pro
Project-URL: Repository, https://github.com/Orlik9l/mcps
Author: Bohdan Orlov
License-Expression: MIT
License-File: LICENSE
Keywords: agent,guardrails,llm,mcp,metabase
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Database
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.2.0
Requires-Dist: pydantic>=2.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: sqlglot>=25.0
Description-Content-Type: text/markdown

# metabase-mcp-pro

An agent-first **Model Context Protocol (MCP) server for Metabase** with a pluggable, table-scoped **query-guardrail layer**.

It combines the lean ergonomics of Metabase's first-party MCP (guided MBQL builder, URI-addressed reads, pagination) with the full reach of the Metabase REST API (models, metrics, dashboards, admin — plus a generic API passthrough so nothing is out of reach), and adds the layer neither has: query guardrails that are **safe-by-default, explicitly overridable, and never silently filter**, plus an output sanitizer that strips connection secrets and trims token bloat.

## White-label

No embedded brand, no environment defaults, no shipped table registry. Everything organization-specific (which tables are CDC, which need crawler exclusion, the vetted-query catalog) is supplied at runtime via env / config.

## Configure

| Env var | Purpose |
|---|---|
| `METABASE_URL` | Metabase base URL (required; no default) |
| `METABASE_API_KEY` | API key, sent as `x-api-key` |
| `METABASE_MCP_GUARDRAILS_CONFIG` | path to a `guardrails.yaml` (see [`examples/`](./examples)) |
| `METABASE_MCP_READONLY` | `1` to hard-disable all writes |

## Run

```bash
uvx metabase-mcp-pro
```

Requires only `uv` — it installs the package from PyPI on demand.

## Use it in another project

It's white-label, so any project reuses it by adding one MCP-server entry and supplying its **own** config. Drop this into a plugin manifest's `mcpServers` (or `~/.claude.json`):

```jsonc
"metabase": {
  "command": "uvx",
  "args": ["metabase-mcp-pro"],
  "env": {
    "METABASE_URL": "https://metabase.your-org.com",
    "METABASE_API_KEY": "...",
    "METABASE_MCP_GUARDRAILS_CONFIG": "/path/to/your-project/guardrails.yaml"
  }
}
```

Each consumer brings its own `METABASE_URL`, API key, and `guardrails.yaml` (start from [`examples/guardrails.example.yaml`](./examples/guardrails.example.yaml)) — nothing project-specific is baked into the package.
