RLM Tools — Claude Code MCP server: a sandbox for code search
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.
claude mcp add rlm-tools -- uvx rlm-toolsWhat RLM Tools 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.
What it helps with
- 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 for the agent
- Start an RLM Tools session on
srcand count which modules importUIKitmost often - Use RLM Tools to find every call to
fetchUserand print just the file names - In the RLM Tools sandbox, walk the project tree to depth 3 and show me the layout
How to install RLM Tools
Platform CLI
claude mcp add rlm-tools -- uvx rlm-toolsuvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>
Platform CLI
codex mcp add rlm-tools -- uvx rlm-toolsuvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add rlm-tools uvx rlm-toolsuvx runs the command named after the package; if the README names another one, use uvx --from rlm-tools <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about RLM Tools
How do I install RLM Tools in Claude Code?
Run claude mcp add rlm-tools -- uvx rlm-tools. The agent picks up the sandbox on its own afterwards, with no config or prompt changes.
What does RLM Tools do?
It hands the agent a persistent Python sandbox for exploring code. Searching, reading and directory walks happen server-side, and only the result comes back.
Do I need an API key?
Only for the llm_query helper, which talks to the Anthropic API. File reads, grep, glob and tree work without one.