Skip to main content
Glama
Luiguard

mcp-sqlite-graph-memory

by Luiguard

mcp-sqlite-graph-memory

License: MIT Python: 3.10+ MCP: 2024-11-05

Universal Model Context Protocol (MCP) server delivering dynamic SQLite-backed code knowledge graph memory for AI coding assistants and autonomous agents.

Automatically detects active workspaces, parses multi-language ASTs and structural dependencies into an isolated local SQLite knowledge graph, and exposes precision MCP tools to inspect symbols, calculate shortest call/import paths, and navigate code topologies.


๐ŸŒŸ Key Capabilities

  • Zero Runtime Dependencies: Written entirely in Python standard library (ast, sqlite3, json, re, hashlib, threading).

  • Dynamic Multi-Workspace Isolation: Generates deterministic SHA-256 hashes per workspace root; stores isolated SQLite databases in ~/.mcp-graph-memory/storage/graph_<hash>.db.

  • Incremental Stat Caching: Verifies file mtime and size to achieve sub-millisecond skips for unchanged files during re-indexing.

  • Multi-Language AST & Structural Parser:

    • Python: Classes, methods, functions, async functions, decorators, imports (from x import y, import z), inheritance hierarchies, call sites.

    • TypeScript / JavaScript: Classes, interfaces, types, functions, arrow functions, ES6 imports/exports, CommonJS require().

    • Go: Packages, imports, structs, interfaces, functions, methods.

    • Rust: Modules, structs, enums, traits, impl blocks, fn signatures.

    • C / C++ / Java / PHP / Ruby / Kotlin / Swift / Shell: Structs, classes, definitions.

  • Freeze & CPU Starvation Protection:

    • Non-blocking asynchronous daemon initialization.

    • Non-busy stdio transport (for raw_line in sys.stdin:).

    • Strict ignore list for node_modules/, .git/, .venv/, binary weights, and cache blobs.


Related MCP server: OpenCodeHub MCP Server

๐Ÿ› ๏ธ MCP Tools Specification

Tool

Parameters

Description

graph_reindex

force (bool)

Scans and updates workspace graph memory incrementally or forced.

graph_query_symbol

query (str), type (str), exact (bool)

Finds symbols with exact file paths, line ranges, signatures, and relations.

graph_find_paths

source (str), target (str), max_depth (int)

Calculates shortest dependency / import / call paths between two files or symbols.

graph_get_neighbors

node_id_or_path (str), direction (in/out/both), relation (all/imports/calls/contains/inherits)

Inspects direct callers, callees, imports, and containment edges.

graph_structure_overview

depth (int), focus_path (str)

Returns architectural metrics, hub modules, and directory tree.

graph_find_files

pattern (str), extension (str), contains_symbol (str)

Finds workspace files by path pattern, extension, or contained symbols.


๐Ÿš€ Installation

git clone https://github.com/Luiguard/mcp-sqlite-graph-memory.git ~/.mcp-graph-memory
chmod +x ~/.mcp-graph-memory/server.py

๐Ÿ”Œ Integration Guides

1. Google Antigravity Integration

Add graph-memory to your global Antigravity MCP configuration file at ~/.gemini/config/mcp_config.json:

{
  "mcpServers": {
    "graph-memory": {
      "command": "python3",
      "args": [
        "/home/YOUR_USER/.mcp-graph-memory/server.py"
      ]
    }
  }
}

(Replace /home/YOUR_USER with your actual $HOME directory path or use an absolute path).

Option B: Workspace-Level Configuration

For per-project activation, place mcp_config.json inside your workspace root under .agents/mcp_config.json:

{
  "mcpServers": {
    "graph-memory": {
      "command": "python3",
      "args": [
        "${workspaceFolder}/.mcp-graph-memory/server.py"
      ]
    }
  }
}

2. Claude Desktop Integration

Locate your Claude configuration:

  • Linux: ~/.config/Claude/claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the server definition:

{
  "mcpServers": {
    "graph-memory": {
      "command": "python3",
      "args": [
        "/path/to/mcp-sqlite-graph-memory/server.py"
      ]
    }
  }
}

3. Cursor / VSCode / Windsurf Integration

In .cursor/mcp.json or .vscode/mcp.json:

{
  "mcpServers": {
    "graph-memory": {
      "command": "python3",
      "args": [
        "/path/to/mcp-sqlite-graph-memory/server.py"
      ]
    }
  }
}

๐Ÿ”ง Environment Variables

Variable

Default

Description

MCP_GRAPH_STORAGE_DIR

~/.mcp-graph-memory/storage

Persistent directory for SQLite databases (graph_<hash>.db).

MCP_WORKSPACE_ROOT

os.getcwd()

Fallback workspace path if client omits rootUri in initialize.


๐Ÿงช Verification & Testing

Execute the automated integration suite:

python3 test_server.py

๐Ÿ“„ License

MIT License - Copyright (c) 2026 Benjamin Leimer. See LICENSE for details.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI assistants with a structured, token-efficient map of a codebase's symbols, dependencies, and relationships via MCP tools like overview, query, and impact analysis.
    8
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.
    3
    Apache 2.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides structural code intelligence via 26 MCP tools, enabling AI assistants to query code symbols, dependencies, and call graphs accurately without file-pasting.
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides code intelligence by indexing source code into SQLite and offering MCP tools for symbol search, flow tracing, and context retrieval to assist with code navigation and understanding.

View all related MCP servers

Related MCP Connectors

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

  • Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.

  • Package intelligence MCP for AI agents โ€” 22 tools, 19 ecosystems, AGPL SDK, free.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Luiguard/mcp-sqlite-graph-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server