rlm-mcp
MCP to optimize Claude code context window and effectively scan large files and code
Install / Use
claude mcp add NextTokens -- npx -y github:NextTokens/rlm-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of rlm-mcp
rlm-mcp scores 71/100 on our quality scale, 3793rd of 4,650 Development & Engineering skills we index.
Its MCP Server is 5.5 KB long, well organised into 18 sections with 9 code examples: a solid amount of guidance for an agent.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-09-23 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 81/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-03. Automated pattern scan on 2026-10-03. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
rlm-mcp compared with similar skills
All 4 of these similar skills score higher than rlm-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| rlm-mcp (this skill)by NextTokens | 71 | 3 | 9mo ago | MCP Server |
| taste-skillby Leonxlnx | 100 | 111.7k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 110.0k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.1k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 70.3k | today | CLAUDE.md |
Frequently asked questions
- How do I install rlm-mcp?
- Run
claude mcp add NextTokens -- npx -y github:NextTokens/rlm-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does rlm-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is rlm-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 81/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is rlm-mcp still maintained?
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubRLM MCP Server
Analyze 10GB+ files with Claude Code — no API keys required.
An MCP server implementing MIT's Recursive Language Models that lets Claude Code analyze files too large for its context window.
┌─────────────────────────────────────────────────────────────┐
│ "Find all errors in this 5GB log file" │
│ │
│ Claude → writes Python → RLM executes → returns results │
│ │
│ Result: 78% fewer tokens, same accuracy │
└─────────────────────────────────────────────────────────────┘
Quick Start
1. Install:
pip install rlm-mcp
2. Configure Claude Code (~/.claude/settings.json):
{
"mcpServers": {
"rlm": {
"command": "rlm-mcp"
}
}
}
3. Use it:
Load /var/log/syslog and find all kernel errors
That's it. Claude automatically uses RLM for large file analysis.
Why RLM?
| Problem | Traditional | RLM Solution | |---------|-------------|--------------| | 10GB log file | ❌ Doesn't fit in context | ✅ Loads externally, queries via Python | | Token usage | 📈 ~12,500 tokens | 📉 ~2,700 tokens (78% less) | | Complex analysis | ❌ Limited to grep patterns | ✅ Full Python (regex, stats, aggregation) |
Real Benchmark
Testing on a 300KB system log with Claude Code Opus 4.5:
┌───────────┬──────────────┬───────────────┬─────────┐
│ Method │ Input Tokens │ Output Tokens │ Total │
├───────────┼──────────────┼───────────────┼─────────┤
│ Grep/Read │ ~10,000 │ ~2,500 │ ~12,500 │
│ RLM │ ~1,500 │ ~1,200 │ ~2,700 │
└───────────┴──────────────┴───────────────┴─────────┘
Both methods found identical results.
RLM used 78% fewer tokens.
The Science
Based on Recursive Language Models from MIT CSAIL:
"We propose treating the long context as an 'external environment' to be interacted with via a Python REPL..." — Alex L. Zhang, Tim Kraska, Omar Khattab (MIT), 2025
Paper Results
| Benchmark | Traditional | RLM | |-----------|-------------|-----| | S-NIAH (8M tokens) | 39.3% | 96.0% | | OOLONG QA | 36.2% | 56.7% |
How It Works
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Claude Code │────▶│ RLM Server │────▶│ Python REPL │
│ (The Brain) │◀────│ (MCP) │◀────│ (Execution) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
1. You ask: "Find errors in this huge log"
2. Claude loads file via rlm_load_file()
3. Claude writes Python: re.findall(r'ERROR.*', context)
4. RLM executes on full file (outside Claude's context)
5. Only results return to Claude
6. Claude answers with findings
Key insight: Claude is the brain, RLM is the hands. No API keys needed — uses your Claude Code subscription.
Available Tools
| Tool | Description |
|------|-------------|
| rlm_load_file | Load a massive file |
| rlm_load_multiple_files | Load multiple files as dict |
| rlm_execute_code | Run Python on loaded content |
| rlm_get_variable | Get a variable's value |
| rlm_session_info | Check session state |
| rlm_reset_session | Clear session memory |
When to Use
┌─────────────────────────────┬────────────────────┐
│ Use Case │ Recommended │
├─────────────────────────────┼────────────────────┤
│ Small files (<50KB) │ Direct read │
│ Single pattern search │ Grep │
│ Large files (>200KB) │ ✅ RLM │
│ Complex analysis/statistics │ ✅ RLM │
│ Multi-pattern correlation │ ✅ RLM │
│ Aggregation/counting │ ✅ RLM │
│ Cross-file analysis │ ✅ RLM │
└─────────────────────────────┴────────────────────┘
Example Session
# Load a large log
>>> rlm_load_file("/var/log/app.log")
File loaded: 2,847,392 chars
# Search for errors
>>> rlm_execute_code("""
import re
errors = re.findall(r'ERROR.*', context)
print(f"Found {len(errors)} errors")
""")
Found 156 errors
# Analyze patterns
>>> rlm_execute_code("""
from collections import Counter
types = re.findall(r'ERROR.*?\] (\w+)', context)
print(Counter(types).most_common(5))
""")
[('Connection', 67), ('Database', 43), ('Timeout', 28)]
Safety
- 30s timeout — Runaway code auto-killed
- Process isolation — Uses multiprocessing
- Output truncation — Prevents memory issues
Requirements
- Python 3.10+
- Claude Code with MCP support
- No API keys needed
Links
- GitHub: https://github.com/ahmedm224/rlm-mcp
- Paper: https://arxiv.org/abs/2512.24601
- Issues: https://github.com/ahmedm224/rlm-mcp/issues
Citation
@article{zhang2025recursive,
title={Recursive Language Models},
author={Zhang, Alex L. and Kraska, Tim and Khattab, Omar},
journal={arXiv preprint arXiv:2512.24601},
year={2025}
}
License
MIT © Ahmed Ali
Related Skills
taste-skill
111.7kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
110.0kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
70.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
