Skip to main content
MCP server CX Codex

SchemaBrain — Claude Code MCP server: what it does, install

SchemaBrain gives AI agents controlled, read-only access to a Postgres schema with PII checks and an audit trail. Use it for governed data queries.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add schemabrain -e DATABASE_URL=<DATABASE_URL> -- uvx schemabrain
Open on GitHub

What SchemaBrain does

SchemaBrain places a controlled layer between an AI agent and a Postgres database. It exposes twelve MCP tools built around defined entities, joins, and metrics. None of them writes to the database or offers arbitrary SQL execution, so a prompt cannot directly turn into a database write.

PII labels flow from the physical schema through joins and metrics. When a request reaches a blocked category, the server refuses it before querying the database. Calls, refusals, and recovery events go into an append-only SHA256-hashed audit log; audit verify reports rewritten rows. Postgres is supported, while the local store uses SQLite. Set DATABASE_URL before connecting, or the server will not start.

What it helps with

  • inspect the entities available to an agent
  • calculate metrics through approved joins
  • block PII access before a query runs
  • record calls and refusals in an audit log
  • detect rewritten audit records

Example prompts for the agent

  • List the entities SchemaBrain knows about in the connected database.
  • Calculate revenue by plan tier using only approved joins.
  • Check this customer-data request and refuse it if it touches PII.

How to install SchemaBrain

Platform CLI

claude mcp add schemabrain -e DATABASE_URL=<DATABASE_URL> -- uvx schemabrain

Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from schemabrain <command>

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about SchemaBrain

How do I install SchemaBrain in Claude Code?

Run claude mcp add schemabrain -e DATABASE_URL=<DATABASE_URL> -- uvx schemabrain. Set DATABASE_URL to the Postgres connection URL.

What does SchemaBrain do?

It gives an agent access to defined Postgres entities, joins, and metrics. PII requests are refused before the database is queried, and activity is written to an audit log.

Which databases does SchemaBrain support?

The server supports Postgres. Its local store is SQLite.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor