Graph Traversal MCP Tools
Direct Memory Association Queries via MCP
What's New
Three new MCP tools enable Claude Code to query the memory association graph directly:
- find_connected_memories - Multi-hop connection discovery (5ms, 30x faster than tag-based search)
- find_shortest_path - BFS pathfinding between two memories (15ms)
- get_memory_subgraph - Subgraph extraction for visualization (25ms)
Performance
- 30x improvement: Connected memory queries reduced from 150ms to 5ms
- Scalable: Handles complex graph traversals efficiently
- Graceful fallback: Automatic handling if memory_graph table unavailable
Use Cases
- Knowledge Graph Exploration: Traverse relationships and context chains
- Connection Discovery: Find how memories are related across multiple hops
- Pathfinding: Identify the shortest connection between concepts
- Subgraph Analysis: Extract and analyze clusters of related memories
Implementation
- New Handler Module: src/mcp_memory_service/server/handlers/graph.py (380 lines)
- Server Integration: Tool registration and routing in server_impl.py (134 lines)
- Validation Script: scripts/validation/validate_graph_tools.py for MCP schema correctness
Quality Metrics
- Health Score: 85/100 (EXCELLENT)
- Complexity: Average 4.5 (Grade A)
- Security: 0 vulnerabilities (bandit scan)
- Test Coverage: 100% handler coverage (10 tests, 328 lines, 58 assertions)
Upgrade
PyPI: pip install --upgrade mcp-memory-service
Source: git pull origin main && pip install -e .
Full Changelog: v8.71.0...v8.72.0