Relith
FreeNot checkedLocal-first context engine for AI-assisted coding. One SQLite index powering MCP-native search, symbols, references, and a knowledge graph... for any AI agent.
About
Local-first context engine for AI-assisted coding. One SQLite index powering MCP-native search, symbols, references, and a knowledge graph... for any AI agent.
README
Relith is a local-first context engine for AI-assisted coding. It indexes your codebases and exposes them through a unified MCP interface - one index, any AI.
Instead of every AI tool building its own isolated context, Relith is a shared intelligence layer: Cursor, Claude Code, OpenCode, and any MCP client query it for code search, symbol lookup, reference tracking, dependency graphs - and now, git history.
Why Relith?
- One index, every AI. Every AI tool asks the same questions of your codebase. Relith builds the context once and serves every MCP client from the same index - no per-tool re-indexing, no duplicated state.
- Local-first by default. One self-contained download, no runtime or cloud account required. Docker is optional - a container image is included for those who want it. Your code never leaves your machine.
- Beyond grep. Search only finds strings. Relith also answers where is this used, what calls this, how do these files relate, and when, why, and who changed this line - via symbols, references, a dependency graph, and git-aware tools.
- Zero glue code. Speak the Model Context Protocol over stdio and your tools show up in any MCP-compatible agent automatically.
How it compares
| ripgrep | ast-grep | Sourcegraph | Relith | |
|---|---|---|---|---|
| Search | Regex over files | Structural (AST) patterns | Regex + keyword + semantic (hosted) | Regex/FTS over a shared index |
| Multi-repo | Per invocation | Per directory | Yes (hosted) | Yes - one index |
| Symbols & references | No | Partial (structural) | Yes (SCIP) | Yes, 17 languages |
| Callers/callees & graph | No | No | Yes (code navigation) | Yes (knowledge graph) |
| Git-aware context | No | No | Yes (hosted) | Yes (commits, history, blame, diffs) |
| MCP-native | No | No | Yes (Enterprise instance) | Yes, local stdio |
| Data locality | Local | Local | SaaS or self-host | Local |
| Setup | One binary | One binary | Instance + account | Tarball + one-liner install |
Features
- MCP-native - 21 tools for AI assistants: search, symbols, references, definitions, callers/callees, file outline, dependency tracing, graph queries, architecture overview, commits, blame, and diffs
- Git-aware context - ask when / why / who: recent commits, per-file history (follows renames), per-line blame, and full patches between any two refs
- Cross-file reasoning - one
trace_contextbundle combining FTS search + symbol matches + references + graph neighbors - Knowledge graph - typed dependency graph (import edges for Go/JS/TS/Python/Rust, reference co-occurrence for all), visualized with an interactive D3.js force-directed graph
- Symbol & reference extraction - functions, types, methods, interfaces, enums, macros across 17 languages
- Multi-repo - index unlimited repos, search across all at once
- Self-healing watcher - auto-reindexes changed files via fsnotify
- Terminal UI - Bubble Tea progress bars, spinners, and a server dashboard
- REST API - HTTP server for scripts, CI pipelines, and programmatic access
- Local-first, zero runtime - static Go binaries in one download, no npm/pip/uv, no runtime, Docker optional, your code never leaves your machine
Performance
Linux kernel, 94,989 files, 1.7M chunks:
| Phase | Time |
|---|---|
| Walk + index | 14m 40s |
| Graph build | 1m 8s |
| Total | 15m 48s |
Reproduce it on your machine with bench/index-kernel.sh - see docs/benchmarks.md.
Quick Start
git clone https://github.com/cryskram/relith.git && cd relith
make build-all
# ...or install the latest release:
curl -fsSL https://raw.githubusercontent.com/cryskram/relith/main/install.sh | sh
# On Windows, run the same command from Git Bash / MSYS2.
# ...and to uninstall (add --purge to also delete the index database and config):
curl -fsSL https://raw.githubusercontent.com/cryskram/relith/main/uninstall.sh | sh
./bin/relith repo add /path/to/your/project
./bin/relith index
./bin/relith search "your query"
# Wire your AI agent (OpenCode, Cursor, Claude Code)
./bin/relith install
# Daemon: REST API + graph UI + file watcher
./bin/relith serve
macOS: If Gatekeeper blocks the downloaded binary, run
xattr -d com.apple.quarantine /path/to/binary.
CLI
Interactive commands (index, remove, serve) render a Bubble Tea TUI automatically; otherwise they print plain text.
| Command | Description |
|---|---|
relith repo add <path> |
Register a repository for indexing |
relith repo list |
List all indexed repositories |
relith repo remove <id-or-name> |
Remove a repository and all its data |
relith index [path] |
Index a repo (or all pending) |
relith search <query> |
Full-text search across all indexed code |
relith status |
Show indexing status with file/chunk counts |
relith serve |
Start the daemon (REST API + graph UI + file watcher) |
relith install |
Auto-configure MCP for OpenCode, Cursor, Claude Code |
relith uninstall |
Remove relith MCP configuration from agents |
relith db vacuum |
Reclaim unused database space |
relith version |
Print the version |
relith search <query> --limit=N |
Limit search results |
MCP Server
Relith speaks the Model Context Protocol over stdio. Point any MCP-compatible assistant at relithmcp, and the tools show up automatically - no glue code.
relith install # auto-detect installed agents
relith install --agent=cursor # or target a specific one
relith install --agent=code # Claude Code
Git-aware tools
On any repo that's a git worktree, the AI can also ask:
| Tool | Answer |
|---|---|
get_recent_commits |
What's been done recently (hash, author, date, message) |
get_file_history |
What has this file been through |
get_blame |
Who owns each line of this file |
get_diff |
Exactly what a commit / PR changed (stat + patch) |
These shell out to your system git, so they always match the repo's real state.
Full tool list
| Category | Tools |
|---|---|
| Search | search_code, find_symbol, find_references, find_callers, find_callees |
| Files | get_file_content, get_file_outline, get_file_tree, get_repo_summary |
| Graph | get_related_files, list_hub_files, query_graph, get_architecture, trace_dependency |
| Git | get_recent_commits, get_file_history, get_blame, get_diff |
| Reasoning | trace_context, get_symbol_definition, list_repositories |
Manual setup
| Agent | Where |
|---|---|
| Cursor | Settings → MCP Servers → Add: command /path/to/relithmcp |
| Claude Code | ~/.config/claude/mcp.json → {"mcpServers": {"relith": {"command": "/path/to/relithmcp"}}} |
REST API
Via the daemon:
curl -s 127.0.0.1:9876/v1/health
curl -s "127.0.0.1:9876/v1/search?q=sqlite"
curl -s 127.0.0.1:9876/v1/graph # interactive graph (browser)
curl -s 127.0.0.1:9876/v1/graph?repo=my-repo # graph data (JSON)
Configuration
~/.config/relith/relith.yaml (or %LOCALAPPDATA%\Relith\relith.yaml). Any key overrides with a RELITH_ env var (RELITH_INDEXER_CONCURRENCY=8).
core:
data_dir: ~/.local/share/relith
daemon: { tcp_host: 127.0.0.1, tcp_port: 9876 }
mcp: { enabled: true, transport: stdio }
indexer: { concurrency: 4, max_file_size: 10485760 }
watcher: { enabled: true, debounce: 1s }
search: { max_results: 100, path_boosting: true }
How it works
Three binaries share one SQLite (FTS5 + WAL) database:
| Binary | Role |
|---|---|
relith |
CLI + TUI |
relithd |
REST API + graph UI + file watcher |
relithmcp |
MCP server over stdio |
Walk → chunk → extract symbols & refs → build dependency graph → serve via MCP, HTTP, or TUI.
See ARCHITECTURE.md for the full picture.
License
MIT - see LICENSE.
Contributing
See CONTRIBUTING.md for the dev setup and contribution workflow. Security issues: see SECURITY.md.
Installing Relith
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/cryskram/relithFAQ
Is Relith MCP free?
Yes, Relith MCP is free — one-click install via Unyly at no cost.
Does Relith need an API key?
No, Relith runs without API keys or environment variables.
Is Relith hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Relith in Claude Desktop, Claude Code or Cursor?
Open Relith on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolRedis
Interact with Redis key-value stores.
by modelcontextprotocolSQLite
Database interaction and business intelligence capabilities.
by modelcontextprotocolmxcp
Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.
by raw-labstadas-github/a2asearch-mcp
MCP server to search 4,800+ MCP servers, AI agents, CLI tools and agent skills. Install: npx -y a2asearch-mcp. Ask Claude: "Find MCP servers for database access
by tadas-githubjulien040/anyquery
Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by desi
by julien040drakonkat/wizzy-mcp-tmdb
A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.
by drakonkatCompare Relith with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
