Get the FREE Ultimate OpenClaw Setup Guide →

MegaMemory

Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio 0xk3vin-megamemory megamemory

How to use

MegaMemory is an MCP server that builds and queries a persistent knowledge graph of concepts, modules, features, patterns, decisions, and components. It indexes incoming code in natural language terms (not symbols) and lets your agent understand, create, and update concepts with edges to express relationships. The available MCP tools include understand (semantic search over the knowledge graph), create_concept (add a new concept with optional edges and references), update_concept (modify an existing concept and regenerate embeddings), link (create typed relationships), remove_concept (soft-delete with history), list_roots (discover top-level concepts), list_conflicts and resolve_conflict (for merge conflict workflows). You can run the server as a local stdio MCP server via the megamemory CLI and connect with any MCP client or workflow that supports stdio. To visualize the graph in a browser, use the web explorer via megamemory serve, which renders the graph and allows interactive inspection of nodes and edges.

How to install

Prerequisites:

  • Node.js >= 18
  • npm (comes with Node.js)
  • Internet access to install the package
  1. Install MegaMemory globally:
npm install -g megamemory
  1. Optional: verify installation
megamemory --version
  1. Prepare the database path if you want to override the default location:
export MEGAMEMORY_DB_PATH=./mydb/megamemory.db
  1. Start or configure the MCP server as needed (see mcp_config in this document for how to wire up with clients).

  2. If you plan to use the web explorer, you can launch the explorer after starting the server:

megamemory serve

Prerequisites note: The embedding model downloads on first use. Node.js >= 18 is required because the package depends on modern Node features.

Additional notes

Tips and common issues:

  • The knowledge database is stored in a local SQLite file (.megamemory/knowledge.db by default). Use MEGAMEMORY_DB_PATH to override.
  • The web explorer port defaults to 4321; if it's in use, you’ll be prompted to choose another port when starting megamemory serve.
  • When wiring with other MCP clients, the server is exposed as a stdio MCP server via the megamemory CLI (no extra server process to manage).
  • If you need to prune or merge graphs, MegaMemory provides dedicated merge and conflict resolution commands (megamemory merge, megamemory conflicts, megamemory resolve).
  • The embedding model is loaded in-process and avoids network calls after the initial download, but the first run may download model assets (~tens of MB).
  • Environment variable MEGAMEMORY_DB_PATH is useful for CI or multi-workspace setups to keep databases isolated.

Related MCP Servers

Sponsor this space

Reach thousands of developers