MCP Hub
Back to servers

claudecode-rlm

MCP server for Claude Code - Knowledge graph-based context storage with 74x faster reads

Updated
Jan 26, 2026

Quick Install

npx -y claudecode-rlm

claudecode-rlm

Unlimited context for Claude Code - Knowledge graph-based context storage with surgical precision code analysis.

Author: Michael Thornton (tekcin@yahoo.com) Repository: https://github.com/tekcin/claudecode-rlm


Features

  • TRUE Unlimited Context - Proxy server auto-stores ALL conversations, auto-injects relevant context
  • Surgical Precision - Deep code analysis for function, class, and symbol-level understanding
  • Live File Tracking - Real-time monitoring of code changes with automatic re-analysis
  • Repository Loading - Bulk load entire codebases into the knowledge graph
  • Web Console - Full management GUI with file browser, symbol explorer, and graph visualizer
  • Docker Ready - Production-ready containerization with Nginx reverse proxy
  • Knowledge Graph - Hierarchical storage (Document → Section → Chunk → Entity → Symbol)
  • 74x Faster Reads - LRU cache with inverted index
  • Entity Extraction - Automatic extraction of code elements, files, concepts
  • Multi-Language Support - TypeScript, JavaScript, Python, Go, Rust

Quick Start (30 seconds)

# 1. Install and setup
git clone https://github.com/tekcin/claudecode-rlm.git
cd claudecode-rlm
npm install && npm run build && npm run setup

# 2. Start proxy (keep running)
npm run proxy

# 3. Open NEW terminal and use Claude Code
claude

That's it! Works with Claude Max subscription (no API key needed) or API key.

Web Console

Open http://localhost:3456/web to browse files, symbols, and the knowledge graph.


Alternative: Docker

git clone https://github.com/tekcin/claudecode-rlm.git
cd claudecode-rlm
docker-compose up -d

Alternative: Global Install

npm install -g claudecode-rlm
claudecode-rlm-proxy

Proxy Mode (Recommended)

The proxy server intercepts ALL API calls for complete automatic context:

1. Start the proxy

claudecode-rlm-proxy

2. Configure Claude Code

export ANTHROPIC_BASE_URL=http://localhost:3456

What happens automatically:

  • Every user message → Stored in knowledge graph
  • Every assistant response → Stored in knowledge graph
  • Before each request → Relevant past context injected
  • Streaming supported → Works with Claude Code's streaming
  • Live tracking → Auto-watches your working directory

Web Console

Access the full management console at http://localhost:3456/web

Features

PageDescription
DashboardOverview with stats, node charts, loading progress
File BrowserTree view of tracked files with Monaco Editor
Symbol ExplorerSearch symbols, view usages and call hierarchy
Graph VisualizerInteractive vis-network graph visualization
Upload ManagerDrag-drop file upload and repository loading
Live MonitorReal-time file change tracking
SettingsServer status and graph management

Building the Web Console

cd web
npm install
npm run build

Repository Loading

Load entire codebases into the knowledge graph:

Via Web Console

  1. Open http://localhost:3456/web
  2. Go to Upload Manager
  3. Enter repository path and file patterns
  4. Click Load Repository

Via API

curl -X POST http://localhost:3456/repo/load \
  -H "Content-Type: application/json" \
  -d '{
    "rootDir": "/path/to/repo",
    "patterns": ["**/*.ts", "**/*.js", "**/*.py"]
  }'

Via CLI Menu

claudecode-rlm-menu

Surgical Precision Code Analysis

Get precise code context for surgical edits:

Find Symbol

curl "http://localhost:3456/code/symbol?name=processRequest"

Get Context at Location

curl "http://localhost:3456/code/context?file=src/index.ts&line=42"

Find All Usages

curl "http://localhost:3456/code/usages?name=GraphStorage"

Get Call Hierarchy

curl "http://localhost:3456/code/callers?name=ingestFile&direction=both"

Live File Tracking

Real-time monitoring of code changes:

Start Watching

curl -X POST http://localhost:3456/live/start \
  -H "Content-Type: application/json" \
  -d '{"rootDir": "/path/to/watch"}'

Get Live File Content

curl "http://localhost:3456/live/content?path=src/index.ts"

Subscribe to Changes (SSE)

curl http://localhost:3456/live/updates

Docker Deployment

Basic Deployment

docker-compose up -d

Production with Nginx + SSL

docker-compose -f docker-compose.prod.yml up -d

Development with Hot Reload

docker-compose -f docker-compose.dev.yml up

See DOCKER.md for full deployment guide.


API Reference

Proxy Endpoints

EndpointMethodDescription
/v1/messagesPOSTAnthropic API proxy with context injection

Repository Endpoints

EndpointMethodDescription
/repo/loadPOSTStart loading repository
/repo/statusGETGet loading progress
/repo/progressGETSSE stream for real-time progress
/repo/cancelPOSTCancel current load
/repo/clearPOSTClear session memory

Code Context Endpoints

EndpointMethodDescription
/code/symbol?name=XGETFind symbol by name
/code/context?file=X&line=NGETGet precise context
/code/usages?name=XGETFind all usages
/code/callers?name=XGETGet call hierarchy
/code/source?name=XGETGet symbol source code
/code/search?pattern=XGETSearch symbols
/code/imports?file=XGETGet import graph

Live File Endpoints

EndpointMethodDescription
/live/startPOSTStart watching directory
/live/stopPOSTStop watching
/live/statusGETGet watcher status
/live/filesGETList tracked files
/live/file?path=XGETGet file with analysis
/live/content?path=XGETGet raw file content
/live/updatesGETSSE stream for file changes

Upload Endpoints

EndpointMethodDescription
/upload/filesPOSTUpload files (multipart)
/upload/urlPOSTDownload from URL

Graph API Endpoints

EndpointMethodDescription
/api/graph_statsGETGet graph statistics
/api/graph_queryPOSTQuery the graph
/api/list_entitiesPOSTList entities by type

MCP Mode

For manual control via MCP tools:

Add to Claude Code config

{
  "mcpServers": {
    "claudecode-rlm": {
      "command": "claudecode-rlm"
    }
  }
}

Available Tools

ToolDescription
memory_autoStore AND retrieve context in one call
memory_storeStore content in knowledge graph
memory_searchSearch with recency weighting
graph_queryQuery graph (search/entity/expand/path)
list_entitiesList tracked entities
graph_statsGet storage statistics

Architecture

Knowledge Graph Structure

Document (conversation turn)
├── Section (topic/header group)
│   ├── Chunk (~300 chars, searchable)
│   │   ├── Entity (function name)
│   │   ├── Entity (file path)
│   │   └── Entity (concept)
│   └── Chunk
│       └── [FOLLOWS] → next chunk
├── File (source code file)
│   ├── Symbol (function/class/method)
│   │   ├── [CALLS] → Symbol
│   │   ├── [REFERENCES] → Symbol
│   │   └── [CONTAINS] → Symbol
│   └── Import
│       └── [IMPORTS] → File
└── Section

Node Types

TypeDescription
documentConversation turn container
sectionTopic group
chunkSearchable text segment
entityExtracted concept/reference
fileSource code file
symbolFunction, class, method, etc.
importImport statement

Relationship Types

TypeDescription
HAS_SECTIONDocument → Section
HAS_CHUNKSection → Chunk
MENTIONSChunk → Entity
FOLLOWSChunk → next Chunk
DEFINESFile → Symbol
CALLSSymbol → Symbol
REFERENCESSymbol → Symbol
IMPORTSFile → File
EXTENDSClass → Class
IMPLEMENTSClass → Interface

Storage Location

.claudecode-rlm/graph/{sessionID}/
├── nodes/*.json    - Content nodes
├── edges/*.json    - Relationships
└── indexes/*.json  - Search indexes

Configuration

Environment Variables

VariableDefaultDescription
CLAUDECODE_RLM_PROXY_PORT3456Proxy server port
CLAUDECODE_RLM_WORKDIR./Storage directory
CLAUDECODE_RLM_SESSIONautoSession ID
CLAUDECODE_RLM_MAX_INJECT2000Max tokens to inject
CLAUDECODE_RLM_UPLOAD_DIR./uploadsUpload directory
ANTHROPIC_API_KEY-Your Anthropic API key
ANTHROPIC_REAL_URLhttps://api.anthropic.comTarget API URL

Performance

OperationBasicOptimizedSpeedup
Node reads21.3µs0.3µs74x
Get by type1.1ms21µs54x
Bulk insert6.07s1.21s5x

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Build web console
cd web && npm install && npm run build && cd ..

# Start MCP server
npm start

# Start proxy server
npm run proxy

# Start with Docker
npm run docker:up

License

MIT


Author

Michael Thornton


Links

Reviews

No reviews yet

Sign in to write a review