// Docs

AI agents (MCP)

Let Claude Code, Codex, Cursor and other agents search your repositories' history through GeeTree's index, read only, with nothing leaving your computer.

GeeTree keeps an index of every commit of the repositories it knows: messages, authors, changed paths and, where it is on, every line each commit added or removed. Over the Model Context Protocol (MCP), AI agents can use that index and GeeTree’s other read-only views: Claude Code, Codex, Cursor, VS Code, Claude Desktop, Gemini CLI and any other MCP client.

The agent’s own model does the thinking. GeeTree calls no model, needs no API key and sends nothing anywhere; the tools only read.

Turning it on

  1. Open Preferences › MCP and switch on Let AI agents read your repositories.
  2. Pick your client. For Claude Code, copy the command and run it in a terminal; for the others, Write to Config File… shows the change to the client’s configuration file and writes only GeeTree’s entry, keeping the file as it was beside it (<name>.geetree-backup). Writing the file turns MCP on.
  3. Restart the client, or refresh its MCP servers. GeeTree’s tools appear in it, and Recent calls in Preferences lists each call the agent makes.

The client starts geetree --mcp itself. It works while GeeTree is not running; while it runs, the indexes of the repositories an agent reads are brought up to date at once.

The tools

Tool What it does
search_commits The search page’s search: text in messages, authors, paths, SHAs and changed code lines, with filters for authors, branch, dates, directories and file types, and counts of the matches
commit_stats Commits counted by author (one person per email), month, directory or file type
get_commit A commit’s message, dates, parents, the branches and tags containing it, its files and, if asked, its diff
file_history A file’s commits, following renames, or the commits that changed some of its lines
blame The commit that last changed each line of a file
list_refs Branches, with their upstream and how far ahead or behind, remote branches and tags
compare_refs Two refs compared: their merge base, the commits each has, the files changed
repository_info The current branch, an operation in progress, the number of stashes, and how far the index covers the history
list_repositories The repositories the agent may read
show_in_geetree Opens a commit, a file’s history, Blame, a comparison, the working tree’s changes or a search in the GeeTree window, for you to look at

Every tool can be switched off. Results name full SHAs, so an agent can cite them. Long answers come in parts: Blame gives up to 1,000 lines a call, a comparison lists the first 100 commits of each side (with their counts), and searches page with offset.

What agents can read

  • The repository the agent runs in, always (it reads its files anyway).
  • The repositories on GeeTree’s list: all of them, or only those you allow in each one’s settings (repository settings › Advanced). Choose in Preferences › MCP › Shared.
  • Excluded paths (.env*, *.pem, *.key, secrets/ and the like, editable) are counted, never named; their diffs and Blame are not returned. Lines in diffs, Blame and commit messages that look like keys or passwords are replaced with [redacted].
  • Return diff text off: no diffs and no search in changed code lines; Blame names each line’s commit without the line’s text.

A repository GeeTree has not indexed yet is answered from git, more slowly and without totals (“more than 30”); changed code lines are searched there only when the agent asks for them, which on a long history can take minutes, and counts by directory or file type wait for the index. While GeeTree runs, it builds the index in the background as soon as an agent reads the repository.

Clients that connect to a URL

Some clients cannot start a program. For them, turn on Also offer an HTTP endpoint: GeeTree, while it runs, serves http://127.0.0.1:47390/mcp. Requests must carry Authorization: Bearer <token> (copy the token in Preferences, or make a new one there, which refuses the old); requests from other sites’ web pages or from other computers are refused, and none is answered without the token. Over HTTP each call names its repository. While GeeTree is not running, another program on the computer could listen on that port instead; on a computer other people also use, prefer clients that start geetree --mcp.

Running in the background

Closing GeeTree’s window leaves it running, with an icon in the menu bar (macOS) or the tray (Windows, Linux), so it keeps serving agents and keeping indexes up to date. The icon’s menu opens the window again and quits. To have closing the window quit instead: Preferences › General › When the window is closed (there is then no icon either).

On Linux the icon needs a desktop that shows StatusNotifierItems (KDE, most panels, GNOME with the AppIndicator extension on). Where there is none, closing the window quits GeeTree.

To have GeeTree start at login, in the background with its icon only: Preferences › General › Start GeeTree in the background at login.

On macOS, move GeeTree to Applications before writing a client’s configuration or starting it at login: run from the disk image, or from the temporary copy macOS makes of a download, it runs from a place that is gone once the image is ejected or after a restart, so Preferences refuse both, and show no command to copy, until it is moved.

Last updated: 2026-11-03