Back to Browse

Memory Graph MCP Server

Developer ToolsUse Caution4.8MCP RegistryLocal
Free

Server data from the Official MCP Registry

Authority-weighted memory graph for AI agents with conflict detection and semantic search.

About

Authority-weighted memory graph for AI agents with conflict detection and semantic search.

Security Report

4.8
Use Caution4.8High Risk

A well-architected memory management MCP server with proper input validation, secure dependency choices, and appropriate permission scoping. The codebase demonstrates good security practices including parameterized SQL queries, no hardcoded secrets, and thoughtful conflict resolution. Minor code quality observations exist but do not materially impact security. Supply chain analysis found 4 known vulnerabilities in dependencies (0 critical, 4 high severity). Package verification found 1 issue.

8 files analyzed · 11 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

env_vars

Check that this permission is expected for this type of plugin.

database

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-retrorobai-mcp-memory-graph": {
      "args": [
        "mcp-memory-graph"
      ],
      "command": "uvx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

mcp-memory-graph

A context-aware memory MCP server for Claude Code and any MCP-compatible AI agent.

Goes beyond basic vector search by adding authority weighting, conflict detection, and typed relationship edges between memories — so your agent always retrieves the right answer when sources disagree.

Inspired by the context engine architecture described in Unblocked's "How a Context Engine Actually Works".


Why this exists

Standard memory MCP servers store and retrieve memories by semantic similarity. That works until you have conflicting memories — an old instruction saying one thing and a new one saying another. Without authority weighting, the agent retrieves whichever is semantically closer to the query, not whichever is more trustworthy.

mcp-memory-graph solves this with three mechanisms:

ProblemSolution
All memories treated equallyPriority tiers: high / medium / low → authority scores 1.0 / 0.6 / 0.3
Stale memories persist silentlySupersession tracking: old memories marked status=superseded with typed edges
Duplicates accumulate over timeConflict detection before every store; auto-resolve by authority

Installation

pip install mcp-memory-graph

Or run directly:

git clone https://github.com/RetroRobAI/mcp-memory-graph
cd mcp-memory-graph
pip install -r requirements.txt
python server.py

Claude Code setup

Add to ~/.claude.json under mcpServers:

"mcp-memory-graph": {
  "type": "stdio",
  "command": "mcp-memory-graph",
  "env": {
    "MEMORY_GRAPH_DB_PATH": "/path/to/memories.db"
  }
}

Or with the raw script:

"mcp-memory-graph": {
  "type": "stdio",
  "command": "python",
  "args": ["/path/to/mcp-memory-graph/server.py"],
  "env": {
    "MEMORY_GRAPH_DB_PATH": "/path/to/memories.db"
  }
}

Migrating from an existing memory service

If you have an existing memory service (mcp-memory-service, Mem0, or a markdown-based memory system), you can import your memories into mcp-memory-graph using the included migration script.

Migration is manual and opt-in — it never runs automatically. Nothing is written until you explicitly confirm.

Run the migration script

python -m mcp_memory_graph.migrate

The script will:

  1. Auto-detect any existing mcp-memory-service SQLite database
  2. Ask if you have a markdown memory directory to import
  3. Show you how many memories it found
  4. Present three choices:
    • [1] Migrate — import everything into mcp-memory-graph
    • [2] Run in parallel — start mcp-memory-graph fresh, keep your old service running
    • [3] Skip — do nothing
  5. Ask for a final confirmation before writing anything

Your existing memory service is never modified — the script only reads from it.


Configuration

All settings via environment variables:

VariableDefaultDescription
MEMORY_GRAPH_DB_PATH~/.mcp-memory-graph/memories.dbSQLite database path
MEMORY_GRAPH_MODELall-MiniLM-L6-v2sentence-transformers model
MEMORY_GRAPH_DIM384Embedding dimensions
MEMORY_GRAPH_CONFLICT_THRESHOLD0.85Cosine similarity above which memories are flagged as conflicting
MEMORY_GRAPH_DEFAULT_RESULTS10Default retrieval limit

Tools

ToolDescription
store_memoryStore with conflict detection and optional auto-resolve
retrieve_memoriesSemantic search ranked by similarity × authority
check_conflictsPreview conflicts before storing
update_memoryUpdate content/priority with supersession tracking
delete_memorySoft delete (preserves history)
add_memory_edgeManually add typed relationship
get_related_memoriesTraverse relationship graph for a memory
list_memoriesList with filters (status, type, priority)

Priority system

priority="high"    # authority_score=1.0  — explicit instructions, confirmed preferences
priority="medium"  # authority_score=0.6  — inferred preferences, reference data
priority="low"     # authority_score=0.3  — session summaries, historical context

Retrieval ranking: weighted_score = 1 - (distance / (authority_score + 0.001) / 10)

A high-authority memory will rank above a semantically closer low-authority one when their similarity scores are within ~3x of each other.


Edge types

  • supersedes — this memory replaces another
  • relates_to — connected but not conflicting
  • contradicts — explicitly conflicting, unresolved
  • referenced_by — another memory cites this one

Stack


License

MIT

Reviews

No reviews yet

Be the first to review this server!