# treecut

> treecut is an open-source MCP server for developer tools. Slices AST definitions and call graphs for AI coding agents over MCP stdio. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows
- **Repository:** https://github.com/bigwalkdoe/treecut
- **MCP Registry name:** io.github.bigwalkdoe/treecut
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-27

## About

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.

## Features

- **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

## Tools

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_node` (name suggests: reads): Line-bounded precision source reader

## 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.

## Alternatives

- [Aptu Coder](https://ai-powered.com/mcp/aptu-coder): Aptu Coder is an open-source MCP server for developer tools.
- [Code Analyze MCP](https://ai-powered.com/mcp/code-analyze-mcp): Code Analyze MCP is an open-source MCP server for developer tools.
- [Surgical Context MCP](https://ai-powered.com/mcp/surgical-context-mcp): Surgical Context MCP is an open-source MCP server for developer tools.
- [codetopo — code graph for AI agents](https://ai-powered.com/mcp/codetopo-code-graph-for-ai-agents): codetopo — code graph for AI agents is an open-source MCP server for developer tools.
- [Arbor](https://ai-powered.com/mcp/arbor): Arbor is an open-source MCP server for developer tools.
- [Codegraph](https://ai-powered.com/mcp/codegraph): Codegraph is an open-source MCP server for developer tools.
- [graphlore](https://ai-powered.com/mcp/graphlore): graphlore is an open-source MCP server for developer tools.
- [Automatised Pipeline](https://ai-powered.com/mcp/automatised-pipeline): Automatised Pipeline is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/treecut
