# GitMem MCP server

> Provides persistent learning memory for AI coding agents to remember mistakes, successes, and architectural decisions across sessions.

- Repository: https://github.com/gitmem-dev/gitmem
- Page: https://hostedmcp.org/servers/gitmem-dev/gitmem
- Transport: stdio
- Stars: 9
- License: MIT
- Latest version: 1.2.1

## Install

### Claude Code

```sh
claude mcp add --env 'SUPABASE_SERVICE_ROLE_KEY=<YOUR_SUPABASE_SERVICE_ROLE_KEY>' gitmem -- npx -y gitmem-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": [
        "-y",
        "gitmem-mcp"
      ],
      "env": {
        "SUPABASE_SERVICE_ROLE_KEY": "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "gitmem": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "gitmem-mcp"
      ],
      "env": {
        "SUPABASE_SERVICE_ROLE_KEY": "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"gitmem","type":"stdio","command":"npx","args":["-y","gitmem-mcp"],"env":{"SUPABASE_SERVICE_ROLE_KEY":"<YOUR_SUPABASE_SERVICE_ROLE_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": [
        "-y",
        "gitmem-mcp"
      ],
      "env": {
        "SUPABASE_SERVICE_ROLE_KEY": "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add gitmem --env 'SUPABASE_SERVICE_ROLE_KEY=<YOUR_SUPABASE_SERVICE_ROLE_KEY>' -- npx -y gitmem-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.gitmem]
command = "npx"
args = ["-y", "gitmem-mcp"]

[mcp_servers.gitmem.env]
SUPABASE_SERVICE_ROLE_KEY = "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'SUPABASE_SERVICE_ROLE_KEY=<YOUR_SUPABASE_SERVICE_ROLE_KEY>' gitmem npx -- -y gitmem-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "gitmem": {
      "command": "npx",
      "args": [
        "-y",
        "gitmem-mcp"
      ],
      "env": {
        "SUPABASE_SERVICE_ROLE_KEY": "<YOUR_SUPABASE_SERVICE_ROLE_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SUPABASE_SERVICE_ROLE_KEY` | no | yes | Supabase service role key for pro tier features. Not required for free tier. |
| `OPENROUTER_API_KEY` | no | no |  |
| `SUPABASE_URL` | no | no | Supabase project URL for pro tier features (semantic search, analytics). Not required for free tier. |
