mcp server
Brf.it
Instant code briefing for AI comprehension.
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 26, 2026Brf.it
🌐 English | 한국어 | 日本語 | हिन्दी | Deutsch
Package your codebase for AI comprehension.
50 tokens → 8 tokens— Same information, fewer tokens.
A CLI tool and MCP server that extracts function signatures, type definitions, and documentation from your codebase using Tree-sitter — producing compact XML/Markdown context for LLMs like Claude, GPT, and Gemini. Supports 19 languages including Go, TypeScript, Python, Rust, Java, C/C++, and more.
Installation · Quick Start · Supported Languages
How It Works
Instead of feeding raw code to AI assistants:
export async function fetchUser(
id: string
): Promise<User> {
const response = await fetch(
`${API_URL}/users/${id}`
);
if (!response.ok) {
throw new Error('User not found');
}
const data = await response.json();
return {
id: data.id,
name: data.name,
email: data.email,
createdAt: new Date(data.created_at)
};
}
<function>
export async function fetchUser(
id: string
): Promise<User>
</function>
Architecture
brfit is a five-stage pipeline. One orchestrator — Packager.Package() in internal/context — runs your files through each stage:
flowchart LR
Files --> Scanner --> Extractor --> Security --> Formatter --> Tokenizer --> Output["XML / MD / JSON"]
Extractor -. uses .-> Parser["Parser × 19 languages"]
| Stage | Package | Responsibility |
|---|---|---|
| Scanner | pkg/scanner | Selects which files to read (.gitignore, glob, size filters) |
| Extractor | pkg/extractor | Runs files through the right parser concurrently (worker pool) |
| Parser | pkg/parser | Parses one file via Tree-sitter, extracts signatures (19 languages) |
| Security | pkg/security | Detects and redacts secrets |
| Formatter | pkg/formatter | Renders output as XML / Markdown / JSON |
| Tokenizer | pkg/tokenizer | Counts output tokens |
Design principles
- Interface-first.
Scanner,Extractor,Parser, andFormatterare interfaces. Adding a language, format, or CLI flag means filling a slot — not rewiring the core. - Extractor → Parser boundary. The Extractor handles scale (concurrency, I/O, error aggregation); each Parser handles one language. They connect loosely through a Registry, so a new language never touches the Extractor.
- Two entry points, one core.
cmd/brfit(CLI) andcmd/brfit-mcp(MCP server) share the samepkg/packages.
Quick Start
Installation
macOS (Homebrew)
brew install indigo-net/tap/brfit
Linux / macOS (Script)
curl -fsSL https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/indigo-net/Brf.it/main/install.ps1 | iex
From Source
git clone https://github.com/indigo-net/Brf.it.git
cd Brf.it
go build -o brfit ./cmd/brfit
First Run
brfit . # Analyze current directory
brfit . -f md # Output in Markdown
brfit . -o briefing.xml # Save to file
See It In Action
This project, packaged by brfit itself. Auto-generated on every commit.
Features
| Feature | Description |
|---|---|
| Tree-sitter Based | Accurate AST parsing for language structure analysis |
| Multiple Formats | XML and Markdown output support |
| Token Counting | Automatic output token calculation |
| Gitignore Aware | Automatically excludes unnecessary files |
| Cross-Platform | Linux, macOS, and Windows support |
| Security Check | Detects and redacts secrets (AWS keys, GitHub tokens, API keys, etc.) in extracted code |
| Call Graph | Extracts function/method call relationships using Tree-sitter queries (Go, TS, Python, Java, Rust, C) |
Supported Languages
| Language | Extensions | Documentation |
|---|---|---|
| Go | .go | Go Guide |
| TypeScript | .ts, .tsx | TypeScript Guide |
| JavaScript | .js, .jsx | TypeScript Guide |
| Python | .py | Python Guide |
| C | .c | C Guide |
| C++ | .cpp, .hpp, .h | C++ Guide |
| Java | .java | Java Guide |
| Rust | .rs | Rust Guide |
| Swift | .swift | Swift Guide |
| Kotlin | .kt, .kts | Kotlin Guide |
| C# | .cs | C# Guide |
| Lua | .lua | Lua Guide |
| PHP | .php | PHP Guide |
| Ruby | .rb | Ruby Guide |
| Scala | .scala, .sc | Scala Guide |
| Elixir | .ex, .exs | Elixir Guide |
| SQL | .sql | SQL Guide |
| YAML | .yaml, .yml | YAML Guide |
| TOML | .toml | TOML Guide |
CLI Reference
brfit [path] [options]
Options
| Option | Short | Description | Default |
|---|---|---|---|
--format | -f | Output format (xml, md) | xml |
--output | -o | Output file path | stdout |
--include-body | Include function bodies | false | |
--include-imports | Include import statements | false | |
--include-private | Include non-exported/private symbols | false | |
--ignore | -i | Ignore file path (can be specified multiple times) | .gitignore |
--include | Glob pattern(s) to include (can be specified multiple times) | ||
--exclude | Glob pattern(s) to exclude (can be specified multiple times) | ||
--include-hidden | Include hidden files | false | |
--no-tree | Skip directory tree | false | |
--no-tokens | Disable token counting | false | |
--max-size | Max file size (bytes) | 512000 | |
--changed | Only scan git-modified files | false | |
--since | Only scan files changed since commit/tag | ||
--token-tree | Show per-file token count tree | false | |
--security-check / --no-security-check | Detect and redact secrets (API keys, tokens, etc.) | true | |
--call-graph | Extract function call relationships per file | false | |
--version | -v | Show version |
Examples
# Copy to clipboard for AI assistants
brfit . | pbcopy # macOS
brfit . | xclip # Linux
brfit . | clip # Windows
# Analyze project and save
brfit ./my-project -o briefing.xml
# Include function bodies (full code)
brfit . --include-body
# Skip directory tree output
brfit . --no-tree
# Only scan git-modified files
brfit . --changed
# Only scan files changed since a tag
brfit . --since v1.0.0
# Include imports (verbatim)
brfit . --include-imports
MCP Server
brfit-mcp is a standalone Model Context Protocol server that exposes brfit's code analysis as tools for AI agents. It communicates over stdio (JSON-RPC).
Tools
| Tool | Description |
|---|---|
summarize_project | Extract signatures from a project directory. Options: path, format, include_body, include_imports, call_graph |
summarize_file | Extract signatures from files matching a glob pattern. Options: path, include, format |
Usage
brfit-mcp --root /path/to/project
Claude Desktop Configuration
{
"mcpServers": {
"brfit": {
"command": "brfit-mcp",
"args": ["--root", "/path/to/project"]
}
}
}
License
MIT License — Use freely in personal and commercial projects.
See LICENSE for details.