Skip to content
MCP server

treecut

Slices AST definitions and call graphs for AI coding agents over MCP stdio

Runs locally

treecut is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
CLI, Linux, macOS
Runs
Locally
Version
0.4.4
Listing updated

Similar MCP servers

About treecut

Rather than handing an assistant entire source files, treecut parses a codebase with tree-sitter and returns only the function, struct or class definition being asked about, plus the call sites that reference it across files. Its Git diff mode intersects changed hunks with parsed symbol spans to pull out just the modified code and the callers that depend on it.

The tool runs as a local stdio MCP server or as a terminal command, and keeps an incremental SQLite cache in a .treecut directory so repeated queries on large repositories stay fast. Call-graph traversal can walk up to four hops in either direction, and scope and include-glob options let monorepo users narrow what gets indexed.

It suits developers who run coding agents such as Claude Code, Cursor or OpenCode on sizeable codebases and want to limit token use while keeping the relevant context in view.

Tools this server provides (5)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 5 tools reads data; 4 names don't say.

From the server's own tool labels and tool names; not verified by us.

repo_skeleton
Compressed codebase signature map
slice_symbol
Full definition plus cross-file call sites
slice_symbols
Batch slice multiple symbols in one call
slice_changed_symbols
Modified AST symbols in Git diff plus callers
read_nodeName suggests: reads
Line-bounded precision source reader

What it does

Symbol definition slicing
Extracts a target function, struct or class together with its cross-file call sites.
Git diff blast radius
Maps changed hunks to AST symbols and includes their callers.
Compressed repository maps
Produces token-budgeted outlines with function bodies stripped out.
Multi-hop call graph
Traverses callers, callees or both up to four hops, with cycle handling.
Import alias resolution
Follows aliased imports in Rust, TypeScript, Python, Go and C# to find call sites.
Monorepo scoping
Restricts slicing to a sub-directory and excludes files by glob pattern.
Token savings stats
Reports byte and estimated token savings to stderr when requested.

Good for

  • Giving a coding agent only the function and callers relevant to a bug
  • Checking which callers a modified function will affect before opening a pull request
  • Producing a compact architectural outline of a large repository for an assistant
  • Tracing how a value flows through a codebase from the terminal
  • Batch-slicing several related symbols in one tool call

Pricing

Open source

Free and open source under Apache 2.0 or MIT.

treecut FAQ

How do I install treecut?

It can be installed with cargo install treecut, through a shell or PowerShell installer, via Homebrew, or built from source.

Does treecut need an API key to run as an MCP server?

No. The MCP server communicates over stdio with no background daemon or API keys required.

Which languages are supported?

Rust, Python, TypeScript and TSX, Go, Java, C and C++, JavaScript and JSX, C#, Ruby, PHP, Swift and Bash.

What license is treecut released under?

It is dual-licensed under Apache 2.0 and MIT, at the user's option.

Is treecut free?

Yes. treecut is open source, so you can use and self-host it for free.

What are the best alternatives to treecut?

The closest alternatives to treecut are Aptu Coder, Code Analyze MCP, Surgical Context MCP, codetopo — code graph for AI agents and Arbor.

Where this comes from

  • Description: written from the project's README and its MCP Registry entry.

How AIPoweredBot checks servers