Schemabrain logo

Schemabrain

by Arun-kc

Governed, read-only Postgres access through definition-based queries, PII refusal, and tamper-evident audit logging.

Install Schemabrain

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "arun-kc-schemabrain": {
      "command": "uvx",
      "args": [
        "schemabrain",
        "serve",
        "--url-env",
        "DATABASE_URL",
        "--store-path",
        "./schemabrain.db"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio arun-kc-schemabrain -- uvx schemabrain serve --url-env DATABASE_URL --store-path ./schemabrain.db

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

uvx schemabrain serve --url-env DATABASE_URL --store-path ./schemabrain.db

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Arun-kc/schemabrain MCP server gives AI agents read-only access to Postgres through twelve MCP tools that compile queries from definitions you control. It refuses requests involving blocked PII or secret categories before querying the database and records calls, refusals, and recoveries in a SHA-256 audit chain. Use it when an agent needs governed access to database metrics without receiving raw SQL execution capability or unrestricted connection access. Postgres is supported as the source database, while the local store uses SQLite.

Use cases

  • Query governed Postgres metrics from an AI agent
  • Refuse retrieval of tagged PII or secret categories
  • Prevent agents from inventing unsupported joins
  • Audit MCP database calls and refusals
  • Expose curated entities and metrics to an MCP client

Key features

  • Read-only Postgres access
  • Definition-based query compilation
  • PII and secret-category refusal
  • Unreachable-join detection
  • SHA-256 audit chain
  • MCP host configuration wizard

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · schemabrain (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars13Stargazers on the source repository.
Last commit3mo agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Schemabrain works

What Arun-kc/schemabrain MCP server does

Arun-kc/schemabrain MCP server places a controlled semantic layer between an MCP client and a Postgres database. The agent works with curated entities, joins, and metrics rather than submitting arbitrary SQL. The server compiles database queries from those definitions, so there is no exposed write or general-purpose query tool described in the project material.

The design is intended for read-only analytical access. It can reject a request when the requested relationship is not represented in the configured schema instead of inventing a join. It also applies PII and secret-category restrictions at retrieval time. Tags from the physical schema can propagate through joins and metrics, allowing the server to refuse a metric before the database is contacted when it crosses a blocked category.

Each tool call, refusal, and recovery is added to an append-only audit log using SHA-256 hashes. The audit verify command can detect whether an earlier log row was rewritten.

How it works

A live Postgres schema is indexed into SchemaBrain, then a semantic layer describes the entities, metrics, and canonical joins that agents may use. The bundled demo includes a pre-curated YAML layer; for another database, entity curation can be performed with the project’s command-line workflow and an optional Anthropic API key.

At runtime, an MCP host invokes the available tools. A metric request is checked against the configured definitions and policy tags before the resulting query is run. If the requested relationship is unreachable, the response can identify the problem and suggest recovery through a join-resolution operation.

The audit chain is best-effort. If the disk is full or no audit writer is configured, the server logs a warning and continues rather than failing the database query.

Setup and configuration

Arun-kc/schemabrain MCP server can be started through the schemabrain Python package. The documented zero-install entry point is uvx schemabrain init; persistent installation is also documented with pipx install schemabrain or pip install schemabrain.

The init wizard asks for a Postgres connection URL, or can start a local demo Postgres container with the bundled fixture. It indexes the source, applies available entities, metrics, and joins, and writes an MCP host configuration. Claude Desktop is the default host in the wizard, with options for Claude Code, Cursor, Windsurf, or manual configuration. The host must be restarted after configuration changes.

An Anthropic API key is optional. The demo path can use its bundled semantic definitions without one.

Tools and capabilities

  • Exposes twelve read-only MCP tools.
  • Compiles queries from controlled semantic definitions.
  • Represents entities, metrics, and canonical joins.
  • Refuses blocked PII and secret categories before retrieval.
  • Detects unreachable relationships instead of fabricating joins.
  • Records calls, refusals, and recoveries in a SHA-256 audit chain.
  • Provides inspection, audit verification, and operational command-line workflows.

Limitations and notes

Postgres is the supported source connector. SQLite is used for the local store, while SQLite, Snowflake, BigQuery, and MySQL source connectors are listed as roadmap items rather than current support.

Audit recording is not fail-closed: disk or writer problems produce a warning and allow the query to continue. A fresh schema may require semantic curation, and LLM-based indexing can incur a cost; the bundled demo and unchanged-schema re-indexing are described as having no cost.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Schemabrain

Yes. The `init` wizard can write the Claude Desktop configuration, and the host must be fully restarted afterward.

Yes. The local store uses SQLite.

No. The bundled demo works without one. The key is optional for the wizard, while entity suggestions on a user database can use it later.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSchemabrain AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/arun-kc-schemabrain?style=directory)](https://allmcps.com/mcp/arun-kc-schemabrain)
HTML Embed
<a href="https://allmcps.com/mcp/arun-kc-schemabrain"><img src="https://allmcps.com/api/badge/arun-kc-schemabrain?style=directory" alt="Schemabrain on AllMCPs" /></a>