rlm-mcp-server
Click on "Install 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., "@rlm-mcp-serverLoad my 500-page contract and summarize key terms"
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.
RLM MCP Server
"The difference between the Enterprise's computer and a Culture Mind is that the Mind doesn't try to hold everything in immediate consciousness—it knows how to efficiently explore vast data stores."
A containerized MCP (Model Context Protocol) server that provides Recursive Language Model capabilities to any AI assistant.
What is RLM?
Based on the paper "Recursive Language Models" from MIT CSAIL, RLM treats large contexts as external environments that can be explored programmatically rather than stuffed into a context window.
Instead of cramming a 500-page document into context, RLM teaches the model to write Python code that explores the document—searching, parsing, counting, extracting—building up understanding iteratively until it can answer your question.
Related MCP server: MCP-RLM
Quick Start
With Docker Compose (recommended)
# Clone and enter directory
cd rlm-mcp-server
# With OpenAI
OPENAI_API_KEY=sk-xxx docker compose up
# With local llama.cpp server (running on port 8080)
RLM_API_BASE=http://host.docker.internal:8080/v1 docker compose up
# With Ollama
RLM_API_BASE=http://host.docker.internal:11434/v1 RLM_MODEL=llama3.2 docker compose upWith Docker directly
# Build
docker build -t rlm-mcp-server .
# Run with OpenAI
docker run -e OPENAI_API_KEY=sk-xxx -p 8765:8765 rlm-mcp-server
# Run with local LLM
docker run \
-e RLM_API_BASE=http://host.docker.internal:8080/v1 \
--add-host host.docker.internal:host-gateway \
-p 8765:8765 \
rlm-mcp-serverIntegration with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"rlm": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"--network", "host",
"-e", "OPENAI_API_KEY",
"rlm-mcp-server",
"python", "src/server.py", "--transport", "stdio"
],
"env": {
"OPENAI_API_KEY": "your-key-here"
}
}
}
}See examples/ for more configuration options including local LLM setups.
Available Tools
Session Management
Tool | Description |
| Load text content into a session |
| Load a file into a session |
| List active sessions |
| Close a session to free memory |
Querying
Tool | Description |
| Ask a question about loaded context (iterative exploration) |
| One-shot: load and query in one call |
| Execute Python directly against context (power user) |
Configuration
Tool | Description |
| View current server configuration |
Usage Examples
Load and query a large document
Human: Load this 200-page PDF transcript and find all mentions of "quarterly revenue"
Claude: I'll use RLM to explore this large document.
[Uses rlm_load_context to load the document]
[Uses rlm_query with question "Find all mentions of quarterly revenue with surrounding context"]
Based on exploring the document, I found 47 mentions of quarterly revenue...Analyze a codebase
Human: Here's our entire codebase (500 files). What authentication methods are used?
Claude: I'll load this into RLM and explore it programmatically.
[Uses rlm_load_context with the codebase]
[Uses rlm_query to explore authentication patterns]
After exploring the codebase, I found three authentication methods:
1. JWT tokens in /api/auth/...
2. OAuth2 in /integrations/...
3. API keys in /external/...Environment Variables
Variable | Default | Description |
|
| Primary model for RLM |
| Same as RLM_MODEL | Model for iterations (can be cheaper) |
|
| Max exploration iterations |
| OpenAI | API endpoint (for local models) |
| - | API key |
| Same as RLM_API_BASE | Separate endpoint for sub-model |
Cost Optimization
You can use a cheaper/local model for the iterative exploration while using a more capable model for initialization:
RLM_MODEL=gpt-4o \
RLM_SUB_MODEL=gpt-4o-mini \
docker compose upOr use a local model for iterations entirely:
RLM_MODEL=gpt-4o \
RLM_SUB_MODEL=local-model \
RLM_SUB_API_BASE=http://host.docker.internal:8080/v1 \
docker compose upHow It Works
Load Context: Your massive document/codebase is stored in a session
Question: You ask a question about the content
Exploration: The LLM writes Python code to explore the context
Iteration: Code executes, LLM sees results, writes more code
Answer: When confident, LLM provides final answer
The REPL environment has access to:
CONTEXT- the full loaded textre- regex modulejson- JSON moduleCounter,defaultdict- from collectionsStandard Python builtins
Architecture
┌─────────────────────────────────────────────────────────┐
│ Claude Desktop │
│ or │
│ Any MCP Client │
└────────────────────────┬────────────────────────────────┘
│ MCP Protocol
▼
┌─────────────────────────────────────────────────────────┐
│ RLM MCP Server │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Sessions │ │ RLM Core │ │ REPL Env │ │
│ │ Storage │ │ Engine │ │ (Python) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└────────────────────────┬────────────────────────────────┘
│ OpenAI-compatible API
▼
┌─────────────────────────────────────────────────────────┐
│ LLM Backend (OpenAI / Local / Ollama) │
└─────────────────────────────────────────────────────────┘Development
# Install dependencies
pip install -r requirements.txt
# Run locally (stdio mode for testing)
cd src && python server.py --transport stdio
# Run tests
pytest tests/Transferring to Offline Lab (Mojoverse)
Build the image on Cybertron:
docker save rlm-mcp-server:latest | gzip > rlm-mcp-server.tar.gzTransfer to Mojoverse via your usual method
Load on Mojoverse:
gunzip -c rlm-mcp-server.tar.gz | docker loadRun with local L4-powered llama.cpp:
RLM_API_BASE=http://localhost:8080/v1 docker compose up
References
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/wgthomas/rlm-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server