agit

Search, read and save versioned coding-agent sessions stored on an AgentGit hub

Official · Einsia Rust Local · stdio Git and code hostingKnowledge and memoryDeveloper tools

72 popularity score ★ 413 ↓ 2.7k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
npm install -g @einsia/agent-git --allow-scripts=@einsia/agent-git
agit login
Claude CodeTerminal
claude mcp add agit -- agit mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "agit": {
      "command": "agit",
      "args": [
        "mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "agit": {
      "command": "agit",
      "args": [
        "mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "agit": {
      "type": "stdio",
      "command": "agit",
      "args": [
        "mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.agit]
command = "agit"
args = ["mcp"]
Gemini CLITerminal
gemini mcp add --scope user agit agit -- mcp

Settings 6

AGIT_HUB_URL Optional: Hub address to use, for a self-hosted hub. Default https://agent-git.com.
AGIT_HOME Optional: Directory for agit state, store and credentials. Default ~/.agit.
AGIT_SESSION Optional: Runtime session that `commit` saves when the call gives no target. For commit.
AGIT_USE_SYSTEM_GIT Optional: Set to 1 to use system Git and Git LFS instead of the bundled copies.
Set together: telemetry
AGIT_TELEMETRY_DISABLED Optional: Set to 1 to turn off usage statistics; ignored when the hub is agent-git.com.
DO_NOT_TRACK Optional: Also turns off usage statistics on hubs other than agent-git.com.

What it does

agit is a command-line tool from Einsia for keeping versioned history of coding-agent conversations from Claude Code, Codex, OpenCode and Cursor. Those runtimes store sessions as JSONL files that get compacted or deleted over time. agit snapshots them into git-backed repositories, which you can push to an AgentGit hub (agent-git.com unless you point it elsewhere) and then share, resume or fork.

The MCP server is the hidden `agit mcp` subcommand and speaks over stdio. You normally don't configure it by hand: the one-shot installer, the global npm install script or `agit setup --mcp` registers it with your agent runtimes. When a tool is called, the server starts the matching `agit` CLI command as a child process and hands back what it prints, so tool results match the CLI.

The source registers eight tools (src/commands/mcp.rs). `search` covers readable history on the hub, or your saved local history when you pass `local=true`, and takes a single query or a batch of up to 16, four of which run at once. `activity` pulls a person's submitted messages in a repo for a time window, with the time each was sent, a page at a time. `show` and `view` read parts of a saved session. `status` reports who you're signed in as and the sync state, and `commit` saves the finished turns of a session. `rc_status` and `rc_list` report on the remote-control daemon and on the machines paired to your account.

The point is that an agent which gets stuck can first look for an earlier session, its own or a teammate's, where the same problem was already solved.

What it needs

RuntimeNode.js
Runs onmacOS, Windows, Linux
AgentGit hubagent-git.com by default, or a self-hosted hub set with AGIT_HUB_URL; sign in with `agit login`

Install with `npx -y create-agit@latest`, which installs agit and wires skills, hooks and MCP, or with `npm install -g @einsia/agent-git --allow-scripts=@einsia/agent-git`. npm 12 and later skip the package's install script unless it is allowed, and organization policies such as `ignore-scripts` can skip it too. Under pnpm the script configures nothing. If it did not run, run `agit setup` once yourself. Prebuilt binaries for Linux, macOS and Windows bundle Git and Git LFS. Other platforms such as FreeBSD need a source build with rustc 1.88 or newer and a C compiler. Then run `agit login`.

Limits

  • Limit Every search needs a signed-in account, including `local=true` searches of saved local history
  • Not covered Local search refuses `scope`, `here` and filters only the hub supports
  • Size cap A search batch holds at most 16 queries, and four run at a time
  • Limit `commit` with no `target` saves nothing unless the server was started with AGIT_SESSION set. It never falls back to the most recent session
  • Limit `activity` needs repo, author, since and before on every call
  • Limit `agit mcp` is hidden, so `agit --help` does not list it
  • Limit The makers warn against `@einsia/agentgit` (no hyphen): it is the old CLI and does not work with the current hub

Every search needs you to be signed in, including `local=true` searches of saved local history. Local search does not accept `scope`, `here` or filters that only the hub supports. A search batch holds at most 16 queries. If `commit` gets no `target` (owner/repo@branch) and the server's environment has no AGIT_SESSION, it saves nothing and returns an error. It never falls back to the most recent session. `agit mcp` is a hidden subcommand, so it is not listed in `agit --help`. The makers warn against installing `@einsia/agentgit` (without the hyphen): it is the old CLI and does not work with the current hub.

Who it suits

It suits developers and teams who already record their Claude Code, Codex, OpenCode or Cursor sessions with agit and want their agents to search and read that history and save new turns. Without an AgentGit hub account and sessions saved through agit it has nothing to work on. It is not a general git server, because its tools only cover agit session history. For ordinary repositories, branches or pull requests, pick a git or code-host server instead.

Tools 8

7 only read, 1 changes things. A ? marks an optional parameter.

search
Searches readable session history on the hub, or saved local history with local=true, with filters and pagingquery?: stringqueries?: arraylocal?: booleantype?: enumsort?: enumlimit?: integerpage?: integerscope?: stringhere?: booleanrepo?: stringowner?: stringauthor?: stringsince?: stringbefore?: stringruntime?: stringscopes?: arraytool?: stringpath?: string
activity
Returns one person's submitted messages in a repo over a time window, with send times, page by pagerepo: stringauthor: stringsince: stringbefore: stringsession?: stringcursor?: stringlimit?: integerassistant?: enum
show
Reads part of a saved session, by ref or by turnref?: string
view
Returns the ordered makeup of a VIEW (a low-level command)ref?: string
status
Shows the signed-in identity and sync status
commit changes
Saves the completed turns of a session to an owner/repo@branch targettarget?: stringmilestone?: string
rc_status
Reports whether this machine is connected to a hub and which sessions the daemon supervises
rc_list
Lists the machines paired to the account, offline ones included

Similar servers