# Graphmem

> Graphmem is an open-source MCP server for knowledge and memory. Local SQLite memory shared by coding agents, with semantic recall and code navigation. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows
- **Repository:** https://github.com/sonic182/graphmem
- **MCP Registry name:** io.github.sonic182/graphmem
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

Graphmem lets Claude Code, Codex, OpenCode, pi and other MCP clients read and write the same project memory instead of each tool keeping its own. Memories are stored in SQLite under ~/.graphmem (or GRAPHMEM_HOME), searched with a local embedding model, and linked as entities.

Memories default to the current Git repository, or global outside one. Reads always include global memories, while writes are limited to the current repository and global, including updates and deletions. A list_scopes tool reports which scopes exist and which are writable. The CLI, gmem, can also remember, search, check which memories exceed the embedding model's token limit, and open a terminal UI.

Optional code tools in release binaries find symbol definitions, outline files, list imports and compare symbols between Git revisions without an embedding model. They index definitions, not call sites, and can be switched off with GRAPHMEM_CODE=off. The npm package contains launchers; a separate step downloads and verifies the native binary.

## Features

- **Shared across agents:** Several coding agents can use one memory store.
- **Repo and global scopes:** Memories follow the current Git repository, with global memories always readable.
- **Local semantic search:** Recall runs against a local embedding model with SQLite storage.
- **Symbol lookup:** find_symbol returns a definition and its source range.
- **Revision diffing:** code_diff compares symbols between Git revisions.
- **Agent plugins:** Plugins exist for Claude Code, Codex, OpenCode and pi.

## Good for

- Keep project conventions across coding sessions
- Let two different agents recall the same decisions
- Find where a symbol is defined without a language server
- See which symbols changed since another branch

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add graphmem -- npx -y @sonic182/graphmem
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add graphmem -- npx -y @sonic182/graphmem
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.graphmem]
command = "npx"
args = ["-y", "@sonic182/graphmem"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user graphmem npx -- -y @sonic182/graphmem

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "graphmem": {
      "command": "npx",
      "args": [
        "-y",
        "@sonic182/graphmem"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 3 of 6 tools read data; 3 names don't say. From the server's own tool labels and tool names; not verified by us.

- `list_scopes` (name suggests: reads): Lists memory scopes and their write permissions.
- `list` (name suggests: reads): Pages through the memories of a selection.
- `find_symbol` (name suggests: reads): Finds a definition and its source range.
- `code_outline`: Lists a file's definitions and nesting.
- `code_imports`: Lists declared imports.
- `code_diff`: Compares symbols between Git revisions.

## FAQ

### Where is the data stored?

In ~/.graphmem by default, or the directory set in GRAPHMEM_HOME.

### Does Graphmem need a network at run time?

Search is local. A separate gmem-install step downloads the native binary.

### Which license applies?

MIT.

### Can agents write to any project's memory?

No. Writes are limited to the current repository and global scope.

### Is Graphmem free?

Yes. Graphmem is open source, so you can use and self-host it for free.

### How do I add Graphmem to Claude Code?

Run this command in your terminal: claude mcp add graphmem -- npx -y @sonic182/graphmem

### What are the best alternatives to Graphmem?

The closest alternatives to Graphmem are REA, Codebase Memory, Serena MCP: the IDE for your agent, XERJ and Context7.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/graphmem
