Skip to main content

schemabrain serve

Boots the MCP server. Speaks stdio (the protocol Claude Desktop, Cursor, Windsurf, Claude Code, and the Anthropic SDK demo all use). Reads the local SQLite store; never writes back to the source Postgres.
Every tool call writes exactly one row to the mcp_audit table — see Audit chain. When --pii-block is configured, calls that would touch a blocked category return a refused envelope (see Structured recovery).

Source

One of these is required:

Storage

Events

Audit

PII policy

The default — three catastrophic-leak categories — is the floor every production deployment should keep. Broaden it (contact,health,financial,...) for stricter postures. See PII taxonomy for the full category list.

Query safety


How hosts invoke this

You almost never run serve directly in a terminal. Instead, your MCP host (Claude Desktop, Cursor, Windsurf, Claude Code) spawns it as a subprocess and speaks stdio across the pipe. The host’s config file carries the exact argv. The Setup page covers the per-host config blocks. For verifying the install end-to-end without a host, run examples/anthropic_demo.py (see Manual flow — Anthropic SDK demo).

Logging

serve cannot accept -v flags from a host config — there is no command line you control. Use the env-var form instead:
Valid SCHEMABRAIN_LOG_LEVEL values: DEBUG, INFO, WARNING, ERROR, CRITICAL (case-insensitive). Unknown values fall back to WARNING and emit a one-line warning to stderr. Output lands in:
  • macOS: ~/Library/Logs/Claude/mcp-server-schemabrain.log
  • Linux: the equivalent Claude Desktop log path on your platform.

Examples

The three catastrophic-leak categories block automatically.

Strict policy

Tighter runtime budget than the default

Defaults are already safe (30s timeout, 10k row cap). Tighten further for interactive use, where you’d rather see a fast refusal than wait out a slow query:

Clear the operator policy for a debug session

This clears any operator-added categories (e.g. contact, health) so those columns are queryable again. The always-on catastrophic-leak floor (credential / payment_card / government_id) still refuses and cannot be turned off; tags still flow into audit rows regardless.

CI smoke


MCP tool reference

The 12 typed tools serve exposes.

PII taxonomy

The 12 categories --pii-block accepts.

schemabrain tail

Stream events from a running serve process.

schemabrain audit

Inspect the mcp_audit table serve writes to.