Claude Code
Use faz with Anthropic's Claude Code CLI so terminal sessions can query your databases through the safety pipeline.
Claude Code is Anthropic's terminal CLI. It supports MCP servers via a per-user config file at ~/.claude.json. faz works the same as it does in Claude Desktop — same four MCP tools, same safety pipeline — but the install location is different.
For the prerequisites and the conceptual "what's MCP" answer, see Integrations overview.
Prerequisites
- faz installed (
pip install faz-core— see Install). - A
faz.yamlwith at least one database connection and a permissions block. - Claude Code installed (
npm install -g @anthropic-ai/claude-code).
Command form: examples use faz <cmd>. If faz isn't on your PATH (common on Windows), run as python -m faz <cmd>. If you installed with uv pip install, run as uv run faz <cmd>. See Install for details.
Install the MCP config
Option 1 — Use faz mcp install (recommended)
faz mcp install --target claude-codeuv run faz mcp install --target claude-codepython -m faz mcp install --target claude-codeThis writes the mcpServers.faz entry directly to ~/.claude.json. The entry looks like:
{
"mcpServers": {
"faz": {
"command": "/usr/local/bin/faz",
"args": ["mcp"],
"env": {
"FAZ_CONFIG": "/Users/you/projects/myapp/faz.yaml"
}
}
}
}Confirm:
claude mcp listYou should see faz in the list.
Option 2 — Use Claude Code's mcp add
If you prefer to wire it up through Claude Code's own CLI:
claude mcp add faz -e "FAZ_CONFIG=$(pwd)/faz.yaml" -- "$(which faz)" "mcp"This appends the same entry to ~/.claude.json under mcpServers.faz.
Restart Claude Code
Exit any active Claude Code session and start a new one. MCP servers are spawned on session start and not re-discovered mid-session.
Verify
In a new Claude Code session, ask:
What databases do you have access to?
Claude Code calls list_databases and replies with your configured databases. The shape of the reply is the same as in Claude Desktop — the underlying MCP tools are identical.
You can also confirm directly:
claude mcp list # should include "faz"
claude mcp get faz # prints the registered configCommon patterns
Claude Code is shell-context aware, so combining faz with terminal workflows works well:
- Inline schema lookup: "What columns does this table have?" mid-debugging.
- Generate and run a cross-source check: "Are there any rows in
<table-1>without a matching row in<table-2>?" — Claude generates a federated query and runs it. - Audit review: pipe
faz logs --followin another terminal alongside your Claude Code session to watch every query as it runs.
Troubleshooting
If claude mcp list doesn't show faz, or faz is listed but Claude Code can't call it:
- Confirm
~/.claude.jsonparses:jq . ~/.claude.json. JSON syntax errors break MCP discovery. - Confirm the
commandpath is the actualfazbinary:which fazshould match. - Confirm
FAZ_CONFIGpoints at a validfaz.yaml:faz policy --helpfrom any directory followed by running with that env var. - Restart the Claude Code session — MCP servers don't reload mid-session.
Full diagnostic flow on MCP not loading.
Related
- Integrations overview — the cross-client comparison.
- Claude Desktop — the desktop-app variant of the same wiring.
- Verifying the connection — diagnostic checks.
- MCP tools — the tools Claude Code calls.