PluginBench
MCP Server
Active
MIT

io.github.gitmem-dev/gitmem MCP Server

io.github.gitmem-dev/gitmem

Persistent learning memory for AI coding agents that compounds across sessions.

What is the io.github.gitmem-dev/gitmem MCP server?

GitMem is an MCP server that gives AI coding agents persistent memory across sessions, remembering mistakes (scars), successes (wins), and decisions. It works with Claude Code, Cursor, VS Code, Windsurf, and any MCP-compatible client to enable agents to learn from experience instead of starting from scratch each time.

GitMem provides institutional memory for AI agents by storing and recalling lessons learned across coding sessions. Before acting, agents check memory for relevant past lessons; after work, mistakes become scars, successes become wins, and strategies become patterns. This creates a compounding learning system where agents improve over time, with features like automatic recall, session continuity, and structured reflection.

How to install io.github.gitmem-dev/gitmem

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
Environment / auth
  • SUPABASE_URL

    Supabase project URL for pro tier features (semantic search, analytics). Not required for free tier.

  • SUPABASE_SERVICE_ROLE_KEY
    secret

    Supabase service role key for pro tier features. Not required for free tier.

~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": [
        "-y",
        "gitmem-mcp"
      ],
      "env": {
        "SUPABASE_URL": "<YOUR_SUPABASE_URL>",
        "SUPABASE_SERVICE_ROLE_KEY": "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
      }
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • Recall — Check memory for relevant lessons from past sessions before acting
  • Learn — Convert mistakes into scars, successes into wins, and strategies into patterns
  • Close — Structured session reflection that persists context for next time
  • Memory Search — Search and retrieve scars, wins, patterns, decisions, and threads
  • Scar Management — Create, update, and manage scars (mistakes to avoid) with counter-arguments
  • Win Management — Record and track successful approaches and strategies
  • Pattern Management — Store and retrieve reusable strategies and architectural patterns
  • Decision Logging — Document architectural choices with rationale
  • Thread Management — Track unfinished work that carries across sessions
  • Session Analytics — Analyze patterns in what breaks and what works (Pro tier)
  • Semantic Search — Intelligent recall using semantic search instead of keywords (Pro tier)
  • Sub-agent Briefing — Automatically hand institutional context to sub-agents (Pro tier)

Use cases

  • Prevent recurring bugs by automatically surfacing past mistakes before similar actions are taken
  • Improve agent performance by applying proven strategies from previous successful sessions
  • Track architectural decisions and their rationale for consistency across projects
  • Maintain continuity of unfinished work and context across multiple coding sessions
  • Share institutional knowledge across team members using cloud persistence (Pro tier)

io.github.gitmem-dev/gitmem MCP server FAQ

What is GitMem?

GitMem is an MCP server that gives AI coding agents persistent memory across sessions. It remembers mistakes (scars), successes (wins), and decisions so agents learn from experience instead of starting fresh each time.

Is GitMem free?

Yes. The free tier stores all data locally in `.gitmem/` on your machine with no telemetry. Pro tier (self-hosted on your own Supabase) adds semantic search, analytics, and cloud persistence.

How do I install GitMem in Cursor or Claude?

Run `npx gitmem-mcp init` in your project root. The wizard auto-detects your IDE and sets up MCP configuration, instructions files, and lifecycle hooks. Use `--client cursor` or `--client claude` to specify.

What authentication is required?

Free tier requires no authentication. Pro tier requires Supabase credentials (SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY) and an OpenRouter API key for semantic search.

What gets stored in memory?

GitMem stores scars (mistakes to avoid), wins (successful approaches), patterns (reusable strategies), decisions (architectural choices with rationale), and threads (unfinished work).

Can I use GitMem with other AI clients?

Yes. GitMem works with Claude Code, Cursor, VS Code (Copilot), Windsurf, Claude Desktop, and any MCP-compatible client.

README (reference)

Source of truth, from the repository.

<p align="center"> <img src="assets/banner.svg" alt="GitMem — Institutional memory for AI coding agents" width="700" /> </p> <p align="center"> <a href="https://www.npmjs.com/package/gitmem-mcp"><img src="https://img.shields.io/npm/v/gitmem-mcp?style=flat-square&color=c41920&label=npm" alt="npm version" /></a> <a href="https://www.npmjs.com/package/gitmem-mcp"><img src="https://img.shields.io/npm/dm/gitmem-mcp?style=flat-square&color=333333&label=downloads" alt="npm downloads" /></a> <a href="https://github.com/gitmem-dev/gitmem/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gitmem-dev/gitmem?style=flat-square&color=c41920" alt="MIT License" /></a> <a href="https://github.com/gitmem-dev/gitmem/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/gitmem-dev/gitmem/ci.yml?style=flat-square&color=333333&label=build" alt="Build" /></a> <img src="https://img.shields.io/badge/node-%3E%3D18-c41920?style=flat-square" alt="Node.js >= 18" /> </p> <p align="center"> <a href="https://gitmem.ai/docs"><strong>Documentation</strong></a> &middot; <a href="https://www.npmjs.com/package/gitmem-mcp"><strong>npm</strong></a> &middot; <a href="https://gitmem.ai/docs/getting-started"><strong>Getting Started</strong></a> &middot; <a href="https://gitmem.ai/docs/tools"><strong>Tool Reference</strong></a> </p>

GitMem is an MCP server that gives your AI coding agent persistent learning memory across agent sessions. It remembers mistakes (scars), successes (wins), and decisions — so your agent learns from experience instead of starting from scratch every time.

What's MCP? Model Context Protocol is how AI coding tools connect to external capabilities. GitMem is an MCP server — install it once and your agent gains persistent memory.

Works with Claude Code, Cursor, VS Code (Copilot), Windsurf, and any MCP-compatible client.

Quick Start

npx gitmem-mcp init

One command. The wizard auto-detects your IDE and sets up everything:

  • .gitmem/ directory with starter scars
  • MCP server config (.mcp.json, .vscode/mcp.json, .cursor/mcp.json, etc.)
  • Instructions file (CLAUDE.md, .cursorrules, .windsurfrules, .github/copilot-instructions.md)
  • Lifecycle hooks (where supported)
  • .gitignore updated

Already have existing config? The wizard merges without destroying anything. Re-running is safe.

npx gitmem-mcp init --yes                # Non-interactive
npx gitmem-mcp init --dry-run            # Preview changes
npx gitmem-mcp init --client vscode      # Force specific client

How It Works

recall  -->  work  -->  learn  -->  close  -->  recall  -->  ...
  1. Recall — Before acting, the agent checks memory for relevant lessons from past sessions
  2. Work — The agent does the task, applying past lessons automatically
  3. Learn — Mistakes become scars, successes become wins, strategies become patterns
  4. Close — Session reflection persists context for next time

Every scar includes counter-arguments — reasons why someone might reasonably ignore it. This prevents memory from becoming a pile of rigid rules.

What Gets Remembered

TypePurposeExample
ScarsMistakes to avoid"Always validate UUID format before DB lookup"
WinsApproaches that worked"Parallel agent spawning cut review time by 60%"
PatternsReusable strategies"5-tier test pyramid for MCP servers"
DecisionsArchitectural choices with rationale"Chose JWT over session cookies for stateless auth"
ThreadsUnfinished work that carries across sessions"Rate limiting still needs implementation"

Key Features

  • Automatic Recall — Scars surface before the agent takes similar actions
  • Session Continuity — Context, threads, and rapport carry across sessions
  • Closing Ceremony — Structured reflection captures what broke, what worked, and what to do differently
  • 20+ MCP Tools — Full toolkit for memory management, search, threads, and multi-agent coordination
  • Zero Config — npx gitmem-mcp init and you're running
  • Non-Destructive — Merges with your existing .mcp.json, CLAUDE.md, and hooks

Supported Clients

ClientSetupHooks
Claude Codenpx gitmem-mcp initFull (session, recall, credential guard)
Cursornpx gitmem-mcp init --client cursorPartial (session, recall)
VS Code (Copilot)npx gitmem-mcp init --client vscodeInstructions-based
Windsurfnpx gitmem-mcp init --client windsurfInstructions-based
Claude DesktopAdd to claude_desktop_config.jsonManual
Any MCP clientnpx gitmem-mcp init --client genericInstructions-based

The wizard auto-detects your IDE. Use --client to override.

<details> <summary><strong>Manual MCP configuration</strong></summary>

Add this to your MCP client's config file:

{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": ["-y", "gitmem-mcp@latest"]
    }
  }
}
ClientConfig file
Claude Code.mcp.json
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Windsurf~/.codeium/windsurf/mcp_config.json
</details>

CLI Commands

CommandDescription
npx gitmem-mcp initInteractive setup wizard (auto-detects IDE)
npx gitmem-mcp init --client <name>Setup for specific client (claude, cursor, vscode, windsurf, generic)
npx gitmem-mcp init --yesNon-interactive setup
npx gitmem-mcp init --dry-runPreview changes
npx gitmem-mcp activate <key>Activate Pro tier (auto-applies schema)
npx gitmem-mcp deactivateRemove Pro credentials, free device slot
npx gitmem-mcp setupOutput schema SQL (for manual Supabase setup)
npx gitmem-mcp uninstallClean removal (preserves .gitmem/ data)
npx gitmem-mcp uninstall --allFull removal including data
npx gitmem-mcp checkDiagnostic health check

Pro Tier

Self-hosted on your own Supabase. You bring the infrastructure, gitmem sets it up.

What you getWhy your agent cares
Semantic searchRecall returns the right scars, not keyword noise
Session analyticsSpot patterns in what keeps going wrong
Sub-agent briefingHand institutional context to sub-agents automatically
Cloud persistenceMemory survives machine changes, shareable across team
A/B testing analyticsMeasure which scar phrasings actually change agent behavior

Quick start

npx supabase login                                          # one time
export SUPABASE_URL="https://yourproject.supabase.co"
export SUPABASE_SERVICE_ROLE_KEY="eyJ..."
export OPENROUTER_API_KEY="sk-or-v1-..."
npx gitmem-mcp activate <your-license-key>

The activate command creates all tables, views, RPC functions, and indexes automatically. No manual SQL needed.

See docs/pro-setup-guide.md for the full guide.

The free tier gives you everything for solo projects. Pro makes recall smarter and memory portable.

GitMem + MEMORY.md

Your AI agent likely has its own memory file (MEMORY.md, .cursorrules, etc.). Here's how they work together:

MEMORY.mdGitMem
LoadedEvery turn (system prompt)On-demand (tool calls)
Best forPreferences, shortcuts, quick referenceEarned lessons, unfinished work, decisions
UpdatesAgent writes directlySession lifecycle (close ceremony)
Example"User prefers terse output""Always validate UUID before DB lookup"

Tip: Include .gitmem/agent-briefing.md in your MEMORY.md for a lightweight bridge between the two systems.

Privacy & Data

  • Local-first — All data stored in .gitmem/ on your machine by default
  • No telemetry — GitMem does not collect usage data or phone home
  • Cloud opt-in — Pro tier Supabase backend requires explicit configuration via environment variables
  • Your data — Sessions, scars, and decisions belong to you. Delete .gitmem/ to remove everything

Development

git clone https://github.com/gitmem-dev/gitmem.git
cd gitmem
npm install
npm run build
npm test

See CONTRIBUTING.md for full development setup.

License

MIT — see LICENSE.

Related MCP servers

MCP server for GitScrum — manage tasks, sprints, time tracking, and client workflows via AI

5
TypeScript
MIT
View repository →

The shared AI context engine for git — save, search, and share the reasoning behind code changes.

0
View repository →

On-chain watches, web-page monitors, dead-man switches, cron, and agent coordination, paid via x402.

0
JavaScript
MIT
View repository →

Generate a timed exam on any topic and take it in an interactive exam sheet with live grading.

1
TypeScript
View repository →
CRCRA AGENT logo

CRA AGENT

Active

Lets an agent pay for x402 APIs in USDC on Arc, under a spending policy it cannot change.

1
TypeScript
MIT
View repository →

Federated commerce search across independent WooCommerce merchants. Keyless, read-only MCP server.

0
MIT
View repository →