schemabrain doctor
Two modes:
- Config health report (default) — checks the host’s MCP config block, the local store, and optionally probes the source database.
- Mock-agent smoke (
--verify) — runs one end-to-end MCP turn against the substrate, without needing an LLM key or a running MCP host.
Flags
| Flag | Default | Purpose |
|---|---|---|
--source URL | (none — source checks skipped) | Source URL to probe (SELECT 1 + read-only session check). Deprecated when the URL contains a password. |
--url-env VARNAME | (none) | Env var holding the source URL. Preferred over --source. |
--store-path PATH | ./schemabrain.db | Path to the local SQLite store. |
--host {claude-desktop,claude-code,cursor,windsurf,manual} | claude-desktop | Which host config to check. manual skips host-config checks. |
--json | (off) | Emit machine-readable JSON to stdout instead of the human-readable report to stderr. Useful for CI / monitoring. |
--verify | (off) | Run the mock-agent smoke instead of the config-health report. |
What the config report checks
For--host claude-desktop (and the other supported hosts), doctor walks the host’s config file looking for the schemabrain MCP server entry. It validates:
- The config file exists at the expected platform path.
- A
schemabrainserver block is present. - The
commandresolves to an executable on disk. - The
argsincludeserveand at least one of--source/--url-env. - The
--store-pathargument points to a readable file (when--store-pathis also passed todoctor). - The store contains at least one indexed source.
- When
--source/--url-envis also passed, aSELECT 1probe succeeds and the session is read-only on Postgres.
--verify (mock-agent smoke)
The --verify mode simulates one MCP tool turn end-to-end without an LLM and without a host:
list_entities— confirms the store carries at least one confirmed entity.describe_entityon the first entity — confirms drill-down works.find_relevant_entitieswith a synthetic query — confirms the retriever returns results.get_metricon the first metric (if any are declared) — confirms the SQL compiler and (when configured) the PII policy machinery wires up.
0 if all required stages pass, 2 if any fail. This is the right command to run in CI as a substrate smoke before promoting a build.
Exit codes
| Code | Meaning |
|---|---|
0 | All checks passed. |
2 | At least one check failed. |
Examples
Default — check Claude Desktop wiring
Check including source probe
CI JSON mode
Substrate smoke (no host, no LLM key)
Related
schemabrain init
The wizard that wires the config
doctor then validates.schemabrain check
Drift check between persisted definitions and the live source.
schemabrain serve
The server
doctor --verify smoke-tests the substrate of.Setup troubleshooting
Common config failures and their fixes.