Skip to main content

MCP Server

braito exposes your generated notes as tools for AI assistants via the Model Context Protocol (JSON-RPC 2.0 over stdio).

Start the server

bun src/cli/index.ts mcp --root /path/to/your/project

# Generate notes if missing, then start
bun src/cli/index.ts mcp --root /path/to/your/project --auto-generate

# Serve notes from multiple repos in a single MCP server (e.g. polyrepo workflows)
bun src/cli/index.ts mcp --roots "api=/path/to/api,web=/path/to/web,infra=/path/to/infra"

When --roots is used, each tool call must include a repo argument to disambiguate (call list_repos first to enumerate aliases). With a single repo registered (either via --root or a single entry in --roots), repo is optional.

Connect to an AI assistant

Add braito to your MCP client config. The format varies by client.

Cursor (~/.cursor/mcp.json):

{
"mcpServers": {
"braito": {
"command": "bun",
"args": [
"/path/to/braito/src/cli/index.ts",
"mcp",
"--root",
"/path/to/your/project"
]
}
}
}

Claude Code (~/.claude/config.json):

{
"mcpServers": {
"braito": {
"command": "bun",
"args": [
"/path/to/braito/src/cli/index.ts",
"mcp",
"--root",
"/path/to/your/project"
]
}
}
}

The MCP server can run outside an IDE too — any client that speaks JSON-RPC 2.0 over stdio can connect to it.

Available tools

ToolDescription
list_reposList repositories registered with this MCP server (multi-repo mode only)
get_file_noteFull note for a specific file path
search_by_criticalityFiles above a criticality threshold, sorted descending
get_indexComplete ranked index of all notes
get_architecture_contextSynthesized overview — top critical files, domain breakdown, invariants
get_impactBlast-radius of a file — which files depend on it (BFS, configurable depth)
searchBM25 ranked full-text search across all note fields (fuzzy + prefix)
get_domainAll files in a specific domain, sorted by criticality
get_business_rulesExtract business rules, domain constraints, and policy enforcement patterns from a source file
get_governance_contextDetected governance docs (Docs/, Workflows/, Quality/), style, domain mappings, and constraints
get_divergencesStructural mismatches between governance docs and the codebase — missing files, forbidden deps, undeclared domains, undocumented hotspots

Tool details

get_file_note

{ "tool": "get_file_note", "arguments": { "path": "src/core/llm/synthesizeFileNote.ts" } }

Returns the full AiFileNote JSON for the specified file.

get_impact

{ "tool": "get_impact", "arguments": { "path": "src/core/types/ai-note.ts", "depth": 3 } }

Returns { file, totalAffected, dependents: [{ relativePath, criticalityScore, domain, level }] } via BFS traversal of the reverse dependency graph.

{ "tool": "search", "arguments": { "query": "LLM timeout" } }

Searches all observed[], inferred[], and evidence[].detail arrays across every note. Returns ranked matches.

get_domain

{ "tool": "get_domain", "arguments": { "domain": "llm" } }

Returns { domain, fileCount, avgCriticality, files } — all files whose path contains the domain name, sorted by score descending.