A codebase intelligence tool that builds an in-memory RDF knowledge graph and exposes it through CLI commands, MCP tools, and SPARQL queries. It parses 17 programming languages using structural AST analysis, extracts metadata from config files and documents, indexes git history for human activity analysis, detects engineering practices, and generates architecture diagrams.
Installation
MCP server that builds an in-memory RDF knowledge graph of your codebase and exposes it via SPARQL queries
स्टार
7
टूल
—
अपटाइम
—
Method
Command
Requirements
npx
npx @chapeaux/beret
Node.js
npx (JSR)
npx jsr:@chapeaux/beret
Node.js
Cargo
cargo install chapeaux-beret
Rust 1.85+
Source
cargo build --release
Rust 1.85+
The release profile enables LTO and single codegen unit for maximum binary performance.
Usage
Beret operates in three modes: CLI for direct analysis, stdio MCP for AI tool integration, and HTTP MCP for remote access.
CLI mode
Run analysis commands directly from the terminal. Each command indexes the target directory and prints JSON to stdout.
beret describe # consolidated project analysis
beret activity # git contributors, active files, recent commits
beret testing # test frameworks, test ratio
beret architecture # layers, structure counts
beret dependencies # package managers, dep count
beret practices # all detected engineering practices
beret stats # counts by structure type
beret find main # find symbols named "main"
beret diagram # generate LikeC4 architecture diagram
beret query 'SELECT ?f WHERE { ?f <http://repo.example.org/a> <http://repo.example.org/Function> }'
All commands accept an optional [PATH] argument (defaults to current directory):
The server starts with an empty knowledge graph and indexes on demand. Call refresh_index with a directory path to populate the graph, then use the other tools to explore. This lets you launch one server and re-target it at different projects or subdirectories as you work.
Mode
Command
Transport
index_repo tool
Local
beret
stdio
No
Remote
beret --serve 8080
HTTP/SSE
Yes
Remote (bind all)
beret --serve 0.0.0.0:9090
HTTP/SSE
Yes
An optional [PATH] argument (e.g., beret /path/to/project) sets the default directory for refresh_index when called without a path. If omitted, defaults to the current working directory.
In stdio mode, --exclude patterns passed on the command line are applied as defaults to every refresh_index call. Additional patterns can be passed via the exclude tool parameter.
in your client config (e.g., mcp.json, claude_desktop_config.json).
After connecting, ask the agent to index a directory (e.g., "index the current project") or for remote HTTP, a repository (e.g., "index https://github.com/user/repo").
Tools
All list-returning tools support limit, offset, and exclude parameters. exclude takes a comma-separated list of directory names to filter out (e.g., "docs,stories,dist"). When results exceed the limit, the response includes has_more: true and next_offset for pagination.
Exploration tools
Tool
Parameters
Default limit
What it does
file_stats
exclude?
—
Count of functions, classes, configs, documents, binaries, commits, etc. Start here for a project overview.
find_entry_points
exclude?, limit?, offset?
100
Find main functions, index files, app/server/cli modules. Answers: "Where does this app start?"
list_structures
path?, kind?, exclude?, limit?, offset?
200
List all indexed structures. Filter by path substring and/or kind (Function, Class, Config, Document, Binary, Stylesheet, Section, Style, Element, Commit).
find_symbol
name, exclude?, limit?, offset?
100
Find where a function, class, struct, or module is defined. Partial name match.
Call graph tools
Tool
Parameters
Default limit
What it does
find_callers
name?, exclude?, limit?, offset?
100
Who calls this function? Omit name to get all call edges.
find_callees
name?, exclude?, limit?, offset?
100
What does this function call? Omit name to get all call edges.
find_dead_code
exclude?, limit?, offset?
100
Functions defined but never called anywhere. Find unused code and refactoring candidates.
Dependency & config tools
Tool
Parameters
Default limit
What it does
find_dependencies
exclude?, limit?, offset?
200
List all external package dependencies from build files (package.json, Cargo.toml, pom.xml, go.mod, requirements.txt, and 15+ more).
Code search tools
Tool
Parameters
Default limit
What it does
search_pattern
pattern, language, exclude?, limit?, offset?
200
Structural AST search using ast-grep syntax. Unlike text search, matches code structure. Use $NAME for wildcards, $$$ARGS for variadic.
query_codebase
sparql, limit?, offset?
500
Raw SPARQL SELECT/ASK against the knowledge graph for advanced queries.
Visualization tools
Tool
Parameters
Default limit
What it does
generate_diagram
path?, depth?, code_only?, exclude?, limit?
500 elements
Generate a LikeC4 architecture diagram. Auto-adjusts depth based on codebase size.
Git activity: top contributors with commit counts, most active files, recent commits.
Index management tools
Tool
Parameters
What it does
refresh_index
path?, exclude?
Index a directory and build the knowledge graph. Call this first before using other tools. exclude takes comma-separated gitignore-style patterns to skip during indexing.
index_repo(HTTP only)
url
Clone a git repo (or pull if already cloned) and index it.
Pagination
When results are paginated, the response wraps results with metadata:
{
"results": [...],
"total": 1847,
"returned": 200,
"offset": 0,
"has_more": true,
"next_offset": 200,
"message": "Showing 1–200 of 1847 results. Use offset: 200 to see the next page."
}
A class, struct, interface, trait, or module definition
<caller> repo:calls <callee>
A function call relationship
<file/name> repo:isTestFunction repo:true
A test function (detected via annotation or path)
Subjects are qualified with the file path (e.g., src/main.rs/handle_request). Call targets are the unqualified callee name. For method calls like obj.method(), only method is recorded. For namespaced calls like mod::func(), only func is recorded.
Test detection: Functions are marked as tests via @Test/@ParameterizedTest/@RepeatedTest annotations (Java), [TestMethod]/[Fact]/[Theory]/[Test] attributes (C#), or when located in test directories (/test/, /tests/, /__tests__/, /spec/).
Config files (JSON, YAML)
Triple
Meaning
<file> repo:a repo:Config
A configuration file
<file> repo:declares <key>
A top-level key in the file
<file> repo:dependsOn <pkg>
A dependency (from 20+ build file formats)
Documents (Markdown, HTML, AsciiDoc, reStructuredText, man pages)
Triple
Meaning
<file> repo:a repo:Document
A document file
<file/heading> repo:a repo:Section
A heading or section
<file/#id> repo:a repo:Element
An HTML element with an id
<file/.class> repo:a repo:Element
An HTML element with a class
Stylesheets (CSS)
Triple
Meaning
<file> repo:a repo:Stylesheet
A CSS file
<file/selector> repo:a repo:Style
A CSS selector rule
Binary files
Triple
Meaning
<file> repo:a repo:Binary
A binary file
<file> repo:hasMimeType <mime>
The file's MIME type
<file> repo:hasSize <bytes>
The file size in bytes
Git activity
Indexed from git log output (last 500 commits). Gracefully skipped if not a git repo.
Triple
Meaning
repo:project repo:hasCommit <hash>
A commit in the repository
<hash> repo:a repo:Commit
A commit object
<hash> repo:commitAuthor <name>
The commit author
<hash> repo:commitDate <iso-date>
The commit date
<hash> repo:commitMessage <text>
The commit message (first line)
<hash> repo:commitTouches <file>
A file changed by the commit
<file> repo:lastModifiedBy <name>
Author of the most recent commit touching this file
The ingestor uses parallel file walking (via the ignore crate) and direct tree-sitter node kind matching for speed. Benchmarked at 5,000 files / 60,000 triples in under 1 second in debug mode. Git history indexing adds a single git log call after the file walk.
Publishing
Crates.io
cargo publish
Publishes as chapeaux-beret. Users install with cargo install chapeaux-beret.
npm
cd npm && npm publish --access public
Publishes as @chapeaux/beret. Requires pre-built binaries uploaded to GitHub releases.
JSR
cd npm && npx jsr publish
Publishes as @chapeaux/beret on JSR. Users run with npx jsr:@chapeaux/beret.
Testing
cargo test
License
MIT
B
Beret
chapeaux·7 स्टार·
MCP server that builds an in-memory RDF knowledge graph of your codebase and exposes it via SPARQL queries
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
सवाल
Beret कैसे इंस्टॉल करें?
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
क्या Beret के लिए API key चाहिए?
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Beret कौन सा ट्रांसपोर्ट इस्तेमाल करता है?
Beret stdio पर लोकल चलता है।
Beret की पिछली जाँच कब हुई थी?
पिछली जाँच 2026-10-28 को हुई। MCP server that builds an in-memory RDF knowledge graph of your codebase and exposes it via SPARQL queries