memory_graph_mcp
Build and query a persistent, auto-updating knowledge graph of a project's code, so an AI agent can reason about dependencies, DB side effects, and past debugging history — all over MCP stdio.
Explore dependencies —
graph_query_context(path, symbol?, depth?)returns the dependency subgraph for a file or symbol plus adjacent modules, so changes to one file reveal everything else they touch.Assess change risk —
graph_impact_analysis(path, change)takes a planned change and returns affected nodes, tables, and a risk level before any code is written.Surface hidden side effects —
graph_get_side_effects(path)reports implicit module effects like table reads/writes and external calls.Keep a decision journal —
graph_record_session(topic, decisions?, bugs?, related_paths?)stores discussion/debug sessions and their decisions and bugs, linked back to files.Inspect index health —
graph_stats()reports node/edge counts, indexed file count, and last update time.Implicit indexing behavior — parsing via tree-sitter (TS/TSX/JS) extracts imports, functions, calls, and SQL/ORM table access into
File,Symbol,Table,Session,Decision, andBugnodes connected byimports,calls,contains,reads_table, andwrites_tableedges; a chokidar watcher incrementally re-indexes on file changes in under a second, persisting everything to.memory-graph/graph.dbfor the project set as the server'scwd.
Parses Drizzle ORM patterns in indexed source files to detect database table access, adding reads_table and writes_table edges to the project knowledge graph so agents can see which code touches which tables.
Parses Prisma ORM patterns in indexed source files to detect database table access, adding reads_table and writes_table edges to the project knowledge graph so agents can see which code touches which tables.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memory_graph_mcp What's the impact of changing src/api/users.ts?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🧠 memory_graph_mcp
An MCP server that gives your AI agent a persistent knowledge graph of your project.
AST dependencies · DB-schema links · debugging sessions · side effects
💡 Why
When a feature is requested, the agent receives a dependency subgraph, not a list of similar files — protecting adjacent modules from breaking changes.
graph_query_context("src/api/users.ts")
┌─────────────────┐ imports ┌─────────────────┐
│ src/db/users.ts │ ◄────────────── │ src/api/users.ts │
└────────┬────────┘ └─────────────────┘
│ writes_table
▼
[table: users] ◄── also touched by 2 other filesInstead of "here are 5 files matching users" the agent learns: changing this file affects two other modules, writes to the users table, and a past debug session recorded a missing await bug here.
Related MCP server: hive-memory
🛠 Tools
Tool | Purpose |
| file/symbol → dependency subgraph + adjacent modules + related sessions |
| planned change → affected nodes, tables, and risk level |
| implicit module effects: table reads/writes, calls |
| record a discussion/debug session with decisions and bugs, linked to files |
| index state: nodes, edges, files, last update time |
📦 Installation
Requires Node.js ≥ 18
Option A: install directly from GitHub (recommended)
Prebuilt JavaScript is committed to the repo — no TypeScript toolchain needed on install:
npm install -g git+ssh://git@github.com/FuryCow/memory_graph_mcp.git#v0.1.1(or git+https://... if you don't have SSH keys set up)
Pin the tag (
#v0.1.1) so npm doesn't resolve the package from a stale tarball cache. If a previous install failed halfway, clear the cache first:npm cache clean --force.
⚠️ npm ≥ 11.8 on Windows: git deps install as dangling junctions
npm 11.8 has a bug where a git dependency is installed as a junction into the npm cache
(...\npm-cache\_cacache\tmp\git-cloneXXXX), and the cache temp dir is deleted afterwards —
leaving a broken install that fails with TAR_ENTRY_ERROR ENOENT storms and
spawn cmd.exe ENOENT during lifecycle scripts. Install from a packed tarball instead:
npm pack git+ssh://git@github.com/FuryCow/memory_graph_mcp.git#v0.1.1
npm install -g .\memory_graph_mcp-0.1.1.tgzThis extracts the package normally (no junction) and runs fine on Windows.
Option B: clone and build manually
git clone git@github.com:FuryCow/memory_graph_mcp.git
cd memory_graph_mcp
npm install
npm run build🔌 Connecting
The server communicates over stdio. Set the root of the project you want to index as the working directory (cwd) in your MCP client config — the index is built from process.cwd() and stored in .memory-graph/graph.db.
Claude Desktop / Cursor
The configuration is identical for both clients; only the config file location differs:
Claude Desktop:
claude_desktop_config.json(menu → Settings → Developer → Edit Config)Cursor:
~/.cursor/mcp.json
{
"mcpServers": {
"memory-graph": {
"command": "memory-graph-mcp",
"cwd": "/absolute/path/to/your/project"
}
}
}With Option B, point
commandat node and the entry file instead:"command": "node", "args": ["/absolute/path/to/memory_graph_mcp/dist/src/index.js"], "cwd": "/absolute/path/to/your/project"
💡 On Windows, escape paths (
C:\\path\\to\\...) or use forward slashes (C:/path/to/...).
🗺 Graph model
Nodes |
|
Edges |
|
The indexer (tree-sitter) extracts imports, function definitions and calls, and database access from SQL strings (SELECT/INSERT/UPDATE/DELETE) and ORM patterns (Prisma, drizzle). A watcher (chokidar) incrementally re-indexes the graph on file changes — typically under a second.
🧰 Stack
Layer | Technology |
Server |
|
Parsing |
|
Storage |
|
Watching |
|
🚀 Development
npm run build # tsc
npm test # node --test dist/test/*.test.js
npm run lint # tsc --noEmit📄 License
Available Tools
5 toolsgraph_get_side_effectsB
Return implicit side effects of a module (DB writes, external calls, etc.).
Inputs: path (required).
graph_impact_analysisB
Given a planned change, return affected nodes and risks.
Inputs: path (required), change (required).
graph_query_contextB
Return the dependency subgraph for a file or symbol, plus adjacent modules.
Inputs: path (required), depth, symbol.
graph_record_sessionA
Record a discussion/debug session with decisions and bugs, linked to related files.
Inputs: topic (required), bugs, decisions, related_paths.
graph_statsA
Return index state: node/edge counts, files indexed, last update time.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct operation: recording a session, querying context, analyzing impact, inspecting side effects, and viewing stats. There is no meaningful overlap, so an agent can reliably pick the right tool.
All tools share the graph_ prefix and most follow a verb_noun pattern, but graph_impact_analysis and graph_stats are noun-style names and only graph_get_side_effects uses 'get_'. The overall pattern is still predictable and readable.
Five tools is a tight, well-scoped set that covers the server's apparent purpose without redundancy or bloat. Each tool earns its place.
The set covers the core workflows: recording new knowledge, querying relationships, assessing change impact, inspecting side effects, and checking index health. Minor gaps like updating or deleting sessions are absent but not critical to the primary graph-based workflow.
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Persistent engineering memory designed to follow developers across coding agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceTransforms codebases into a knowledge graph for AI agents, enabling semantic search, impact analysis, and persistent session memory with up to 94% token savings.4 npm15ISC
- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with persistent, graph-connected memory across projects, enabling cross-project context retrieval via synaptic connections and hybrid search.3 npm8MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI coding agents with persistent architectural memory of codebases, enabling impact analysis, test generation, and code generation with reduced token usage.MIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with persistent memory by recording sessions and normalizing them into a searchable knowledge graph, then delivering relevant context at the start of the next session.MIT