Agentree MCP
Tool calls available to agents through Agentree MCP.
Agentree MCP is the local Model Context Protocol server that connects agents back to the current Agentree workspace. Agents use it to inspect graph history, thread state, commits, diffs, and file attribution without leaving their isolated worktree.
Current Workspace
Agentree passes the active workspace and auth context to the MCP server before an agent run starts. Most tools auto-detect the current workspace, so agents usually do not need to pass workspace_id.
Available Tools
get_graph_overview
Returns a visual overview of the current workspace graph with thread and branch statistics.
Use it when an agent needs quick orientation before choosing which thread, branch, or node to inspect.
graph_locate
Locates a node by node_id. It returns depth, parent, path, siblings, children, agent, and status details.
Use it when an agent knows a node ID and needs to understand where that node sits in the graph.
graph_query
Searches and filters graph nodes. Filters can target fields such as role or status.
Use it to find completed assistant nodes, user prompts, failed runs, or other graph subsets.
graph_read_node
Reads a specific graph node, including content, run metadata, and tool calls.
Use it when the agent needs exact prompt text, assistant output, execution metadata, or prior tool activity.
graph_blame
Gets line-by-line attribution for a file at an assistant node's resolved git commit.
Use it to understand which prior agent node changed a line and whether that line came from the base commit.
graph_diff
Compares the committed git states for two assistant nodes. It can return a whole-commit diff or a diff for one file.
Use it to compare two implementation attempts, inspect what a fixer changed, or understand a merge candidate.
list_thread_sessions
Lists active thread sessions in the current workspace, including status, source, base commit, first node, and node count.
Use it to find which tasks are open, closed, or relevant to the current work.
read_thread
Reads a thread session and its ordered graph nodes.
Use it when the agent needs the full task narrative instead of isolated node reads.
query_commits
Searches and filters the persisted workspace commit graph. It can include commit parents and observations.
Use it to find agent-generated commits, imported commits, merge commits, or commits produced by a specific node.
Common Patterns
Start with get_graph_overview for orientation, then use list_thread_sessions or graph_query to find candidate nodes. Once the agent has node IDs, use graph_read_node, graph_diff, or graph_blame for precise context.
For code review, graph_diff is usually the most direct tool. For history reconstruction, read_thread and query_commits are usually better.
