Skip to content
Conduit

mcp server

Brf.it

Instant code briefing for AI comprehension.

indigo-net/Brf.itcommunitylistedunreviewed

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, 2026

Brf.it

🌐 English | 한국어 | 日本語 | हिन्दी | Deutsch

Release Downloads Go Report Card Coverage Languages License: MIT

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"]
StagePackageResponsibility
Scannerpkg/scannerSelects which files to read (.gitignore, glob, size filters)
Extractorpkg/extractorRuns files through the right parser concurrently (worker pool)
Parserpkg/parserParses one file via Tree-sitter, extracts signatures (19 languages)
Securitypkg/securityDetects and redacts secrets
Formatterpkg/formatterRenders output as XML / Markdown / JSON
Tokenizerpkg/tokenizerCounts output tokens

Design principles

  • Interface-first. Scanner, Extractor, Parser, and Formatter are 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) and cmd/brfit-mcp (MCP server) share the same pkg/ 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

SAMPLE.md | SAMPLE.xml

This project, packaged by brfit itself. Auto-generated on every commit.


Features

FeatureDescription
Tree-sitter BasedAccurate AST parsing for language structure analysis
Multiple FormatsXML and Markdown output support
Token CountingAutomatic output token calculation
Gitignore AwareAutomatically excludes unnecessary files
Cross-PlatformLinux, macOS, and Windows support
Security CheckDetects and redacts secrets (AWS keys, GitHub tokens, API keys, etc.) in extracted code
Call GraphExtracts function/method call relationships using Tree-sitter queries (Go, TS, Python, Java, Rust, C)

Supported Languages

LanguageExtensionsDocumentation
Go.goGo Guide
TypeScript.ts, .tsxTypeScript Guide
JavaScript.js, .jsxTypeScript Guide
Python.pyPython Guide
C.cC Guide
C++.cpp, .hpp, .hC++ Guide
Java.javaJava Guide
Rust.rsRust Guide
Swift.swiftSwift Guide
Kotlin.kt, .ktsKotlin Guide
C#.csC# Guide
Lua.luaLua Guide
PHP.phpPHP Guide
Ruby.rbRuby Guide
Scala.scala, .scScala Guide
Elixir.ex, .exsElixir Guide
SQL.sqlSQL Guide
YAML.yaml, .ymlYAML Guide
TOML.tomlTOML Guide

CLI Reference

brfit [path] [options]

Options

OptionShortDescriptionDefault
--format-fOutput format (xml, md)xml
--output-oOutput file pathstdout
--include-bodyInclude function bodiesfalse
--include-importsInclude import statementsfalse
--include-privateInclude non-exported/private symbolsfalse
--ignore-iIgnore file path (can be specified multiple times).gitignore
--includeGlob pattern(s) to include (can be specified multiple times)
--excludeGlob pattern(s) to exclude (can be specified multiple times)
--include-hiddenInclude hidden filesfalse
--no-treeSkip directory treefalse
--no-tokensDisable token countingfalse
--max-sizeMax file size (bytes)512000
--changedOnly scan git-modified filesfalse
--sinceOnly scan files changed since commit/tag
--token-treeShow per-file token count treefalse
--security-check / --no-security-checkDetect and redact secrets (API keys, tokens, etc.)true
--call-graphExtract function call relationships per filefalse
--version-vShow 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

ToolDescription
summarize_projectExtract signatures from a project directory. Options: path, format, include_body, include_imports, call_graph
summarize_fileExtract 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.

↑↓ navigate openesc close