tilth MCP
A Rust binary for agents and the terminal that uses tree-sitter to find a symbol's definition, its calls and file dependencies
- 357 ★ on the repository
- Last commit
- MIT
Minimal access
Why this level
- In normal mode it reads project files and uses no network
- The --edit mode enables writing files by line hashes, so turn it on deliberately
Install
- Works in
Manual install
cargo install tilthnpx tilth works too, and prebuilt binaries are on the releases page.
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- In normal mode it reads project files and uses no network
- The --edit mode enables writing files by line hashes, so turn it on deliberately
This is third-party code. Review the repository files before installing.
What it does
tilth is a single Rust binary that works as a CLI and as an MCP server. It parses code with tree-sitter and answers questions that text search cannot: where a function is defined, who calls it and which files depend on it. It builds no index and needs no setup. A small file comes back whole, and a large one comes back as an outline with line ranges. The --section flag fetches the part you need, by lines or by a Markdown heading. A name search lists definitions first and usages after, and an expanded definition ends with a list of the functions it calls, with files and signatures. --callers finds call sites on the syntax tree, so comments and strings with the same name do not interfere. grok gathers everything about one symbol, from its signature to its tests, and tilth diff shows changes per function. In MCP mode a definition already shown comes back as a shown-earlier marker, so the agent does not receive the same text twice. The --edit mode adds a tilth_write tool that edits by line hashes: if the file changed after it was read, the edit is rejected. Seventeen languages are parsed, from Rust and TypeScript to Elixir and Bash.
Who it is for. For developers whose agents burn dozens of calls to find one function, and for anyone who wants a quick overview of an unfamiliar codebase in the terminal.
Good fit when
- Before renaming an export you need to see which files use it: tilth recovery.go --deps
- An agent in a large repository looks for who calls a function and goes wrong on matches in comments and strings
- You need an overview of a huge file without reading it whole: an outline with lines and a targeted --section
- After a commit you need a changelist per function: tilth diff HEAD~1
- You run agents on smaller models that keep reaching for Bash and Grep: tilth can be made the only route
Not a fit when
- You must tell apart two same-named functions in different modules: tilth matches calls and dependencies by name
- You need type inference or compiler-grade go-to-definition: tilth parses syntax only
- Your language is outside the seventeen supported: you get text search and plain file reading only
- You need search by meaning: tilth searches by names and syntax
Example request
Use tilth to find who calls isTrustedProxy and show which files recovery.go depends onMCP
- Transport
- stdio
- Authentication
- not required
Limitations
- tilth parses syntax and does not infer types. Calls and dependencies are matched by name, and dynamic dispatch is not followed.
- --map is available in the CLI only and is not offered as an MCP tool: in testing agents called it more often than it helped.
- Search time grows with repository size: on FastAPI with 2,700 files a symbol search takes about 77 ms.
- There are no network calls, so code stays on your machine. The author removed the earlier cost benchmark and has not published a new one.
How to disable. Remove the tilth entry from the client's config file: ~/.claude.json for Claude Code, ~/.cursor/mcp.json for Cursor. The binary is removed with cargo uninstall tilth, or npm uninstall -g tilth if you installed through npm. If you launched claude with --disallowedTools, drop that flag too.
FAQ
How do I connect tilth to Claude Code?
Install the binary with cargo install tilth or npx tilth, then run tilth install claude-code. It writes the server into ~/.claude.json. For Cursor, Codex, Windsurf, Cline, Zed and about fifteen more clients, put their name in place of claude-code.
How do I enable file editing through tilth?
Add the --edit flag: tilth install claude-code --edit. This adds the tilth_write tool, and tilth_read starts returning lines with hashes such as 42:a3f. An edit is accepted only when the hashes match the last read.
Which languages does tilth understand?
Rust, TypeScript, TSX, JavaScript, Python, Go, Java, Scala, C, C++, Ruby, PHP, C#, Swift, Kotlin, Elixir and Bash. Dockerfile and Make files are recognised but not parsed.
How is tilth different from grep and ripgrep?
Text search finds lines that contain a name. Through the parse tree tilth tells a definition from a mention, shows callers and callees and lists definitions first. It still searches file contents with the same crates ripgrep uses.
Does it need an index or a background process?
No. Each query walks the directory tree afresh, and the outline cache resets when a file's modified time changes. Search skips node_modules, target and .venv but does not skip gitignored files.
Discussion
No questions or reviews yet.
Related
MCP serversrust-analyzer MCP: Rust code navigation for agents
r3bl-rust-analyzer-mcp-server
A Rust MCP server on standard threads: the agent gets hover info, go to definition, references, formatting and compiler diagnostics from rust-analyzer
An MCP server and CLI for code research: search and understand your project and all of GitHub with fewer tokens
A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks
A structural code search MCP server for agents: finds the right file by query intent and runs locally
An MCP server that turns a large codebase into a semantic feature graph for precise navigation and meaning-based search
CodeGraph (Rust)
codegraph-rust
A Rust code graph for agents: four MCP tools show what an edit will touch, how the architecture fits together and where the fragile spots are
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| tilth (this entry) | no | not required | 357 | |
| Serena | no | not required | 30,849 | gives the agent IDE features through language servers and is heavier to set up |
| jCodeMunch MCP | no | not required | 2,817 | indexes code with tree-sitter and serves single symbols, while tilth builds no index |
README in short
The project shows the tool's real output on the FastAPI and Gin repositories and lists its own limitations. The author gives installation for more than twenty clients and closes by explaining how the tool is built.