Skip to main content
Glama

Git Graph for Codex

An original, MIT-licensed local Git history explorer written in TypeScript and React. It uses the MCP SDK and MCP Apps UI standard. No code from mhutchie's VS Code extension is used.

Prototype features

  • Commit topology with branch lanes and merge edges

  • Local and remote-tracking branch selection

  • Search highlighting across loaded commits, authors, and hashes

  • Commit metadata, file statistics, and bounded patches

  • Incremental history loading and a responsive layout

  • Read-only Git tools over stdio, plus an optional local browser preview

Related MCP server: git-graph-mcp

Develop

Requires Node.js 22+ and Git.

npm ci
npm run check
npm run build
npm test
GIT_GRAPH_REPO=/absolute/path/to/repository npm run preview

Open http://127.0.0.1:4317. The preview binds only to loopback. It rejects API calls from other origins. No Git fetches, writes, hosted service, accounts, telemetry, or model API keys are used.

Use the MCP server in Codex

codex mcp add git-graph --env GIT_GRAPH_REPO=/absolute/path/to/repository -- node /absolute/path/to/codex-git-graph/dist/server.js

Start a new chat after registering the server. Ask: "Show the Git graph for this repository." The tools also work in clients that cannot render the UI. Set GIT_GRAPH_REPO explicitly when the client does not launch the server from the target repository.

Local plugin package

plugins/git-graph/ contains the compatibility manifest, MCP configuration, bundled server/UI, and skill. npm run build regenerates its dist/ directory. The server bundle includes its runtime dependencies.

codex plugin marketplace add /absolute/path/to/codex-git-graph
codex plugin add git-graph@git-graph-local

The bundled MCP launches from its installed plugin directory. Pass the target checkout as the repository argument to git_history; the UI passes that repository to subsequent tools. Ask: "Show the Git graph for /absolute/path/to/repository." Local marketplace installation and the installed server bundle are verified. Native MCP Apps rendering in a fresh Codex chat remains unverified. The browser preview is a separate tested surface.

Public directory

OpenAI's current packaging documentation requires a public HTTPS MCP endpoint for public submission, or separate support for local MCP servers. This local stdio prototype is not ready for directory submission. A hosted version would need an authenticated repository provider or an explicit local bridge; a hosted server cannot directly read a user's local checkout.

See https://developers.openai.com/plugins/build/plugins and https://developers.openai.com/plugins/build/chatgpt-ui.

Limits

Remote-tracking refs reflect local state and may be stale. Search highlights matches in loaded history rather than searching every commit. Pagination is offset-based; a changing repository can shift rows. Git operations have a 10-second timeout and an 8 MiB output limit. Patches above 100,000 characters are shortened; commands exceeding the output limit report an error. Merge details use Git's default merge diff presentation. The graph is an on-demand app view, not a permanent Codex sidebar extension.

Validation

npm test exercises a real merge fixture, pagination, custom remote branches, detached HEAD, invalid inputs, and an MCP stdio handshake/tool/resource integration. The MCP test uses GIT_GRAPH_TEST_REPO when supplied, otherwise creates an isolated repository fixture. Browser interaction verification covers commit details, branch selection, search highlighting, and loading more commits.

Available Tools

2 tools
git_commitInspect commitB
Read-only

Read commit metadata, file statistics, and a bounded patch for a full Git hash.

Inputs: hash (required), repository.

git_historyExplore Git historyB
Read-only

Show a graph of local commits and branches. Does not modify the repository or contact remotes.

Inputs: limit, branch, offset, repository.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 2 tools

    Disambiguation4/5

    git_history shows a graph overview of commits and branches, while git_commit retrieves detailed metadata and patch for a specific hash. The two purposes are clearly different, though both operate on commit history and could be slightly confused by an agent skimming descriptions.

    Naming Consistency5/5

    Both tools follow a consistent `git_` prefix with snake_case nouns: `git_history` and `git_commit`. The pattern is predictable and readable, with no mixed conventions.

    Tool Count3/5

    Two tools is thin for a server focused on Git graph exploration, sitting at the borderline identified in the calibration. Additional tools for branch listing, searching, or diffing would make the set feel more complete without being excessive.

    Completeness3/5

    The server covers viewing the commit graph and inspecting a specific commit, but notable read-only operations are missing: branch/tag listing, searching or filtering history, file-level history, and showing diffs between arbitrary commits. These gaps limit deeper Git exploration workflows.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A local-first MCP server that provides read-only access to Git repository history, exposing commit metadata and optionally content patches via configurable policies, with optional AI-powered analysis while never modifying Git state.
      5 npm
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables terminal-based Git graph viewing and commit/range selection, while exposing bounded Git context such as status, diff, history, and search to MCP clients over local stdio with a read-only default workflow.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to read and investigate git history through MCP, including blame, diffs, old file versions, and automated bisect to find when a bug was introduced.
      7 npm
      MIT