# RLM Tools

A persistent Python sandbox where your agent explores a codebase and only the summary reaches the chat. Built for large repos where grep floods the window.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8
- Author: stefanoshea
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/stefanoshea/rlm-tools
- Updated: 2026-02-13
- HTML: https://affpapa.org/en/nevibecode/mcp/rlm-tools

## What it does

The agent opens a session on a directory, then runs Python server-side. Raw data stays in sandbox memory; whatever goes through `print()` is what the model sees. Variables survive between `rlm_execute` calls, so the agent can search, filter and read in steps without dragging intermediate output into the conversation.

The whole API is three tools: `rlm_start(path, query)` opens a session, `rlm_execute(session_id, code)` runs code, `rlm_end(session_id)` closes it and frees resources. Helpers inside cover `read_file`, `read_files`, `grep`, `grep_summary`, `grep_read`, `glob_files` and `tree`. One helper, `llm_query`, calls the Anthropic API for semantic analysis and needs `ANTHROPIC_API_KEY`; reading, searching and walking directories do not.

The sandbox is read-only and scoped to the session directory, with path traversal blocked and a safe subset of the standard library. `exec`, `eval` and `__import__` are disabled. Defaults allow 5 concurrent sessions with a 10-minute timeout, and each code call is capped at 30 seconds. Configuration is optional — the server runs with no `.env` file at all.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add rlm-tools -- uvx rlm-tools
```
uvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>

### Codex

**Platform CLI**
```bash
codex mcp add rlm-tools -- uvx rlm-tools
```
uvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "rlm-tools": {
            "command": "uvx",
            "args": [
                "rlm-tools"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "rlm-tools": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "rlm-tools"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add rlm-tools uvx rlm-tools
```
uvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>

## When to use it
- keep a repo-wide search inside the context limit
- turn hundreds of grep hits into a short summary
- read a batch of files without dumping their contents into the chat
- map out a module before touching it
- locate every place a pattern is used

## Example prompts
- Start an RLM Tools session on `src` and count which modules import `UIKit` most often
- Use RLM Tools to find every call to `fetchUser` and print just the file names
- In the RLM Tools sandbox, walk the project tree to depth 3 and show me the layout

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
