# RLM Tools [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/stefanoshea/rlm-tools  
**GitHub Stars:** 9  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/rlm-tools

## Description
Persistent Python sandbox for token-efficient codebase exploration in MCP clients

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "rlm-tools": {
    "command": "uvx",
    "args": ["--from","rlm-tools[semantic]","rlm-tools"],
    "env": {
      "RLM_ALLOWED_ROOTS": "",
      "RLM_RECURSE_GATE": "",
      "RLM_EXTERNAL_ROOTS": ""
    }
  }
}
```

**Requires environment variables:** `RLM_ALLOWED_ROOTS`, `RLM_RECURSE_GATE`, `RLM_EXTERNAL_ROOTS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What RLM Tools does

RLM Tools provides coding agents with a read-only workspace for inspecting a repository without transferring every intermediate result into the model context. Agents can search for text, locate files, inspect directory structure, read selected files, and summarize results in Python before returning them.

The main use case is context-conscious codebase exploration. For example, an agent can search for a pattern, group matches by module, read only the relevant files, and print a compact summary. Variables and cached file contents remain available during the session, allowing later steps to build on earlier exploration.

## How it works

The MCP API consists of three operations:

- `rlm_start(path, query)` opens an exploration session for a directory.
- `rlm_execute(session_id, code)` runs Python in that session.
- `rlm_end(session_id)` closes the session and releases its resources.

The sandbox includes helpers for reading files, searching with `grep`, finding paths with glob patterns, and displaying directory trees. `read_file` and `read_files` can cache content across executions. `rlm_finalize` can mark structured final output for an execution response.

Optional recursive analysis helpers let a sub-agent explore the session directory, while `llm_query` can send prompts and context to a model provider. These helpers require an API key and are separate from local repository exploration.

An evidence gate can filter tool output before recursive-loop history is replayed. It uses TypeSafe models, is enabled through configuration, and fails open when scoring is unsuitable or unavailable. Exhaustive questions such as requests for every match bypass relevance filtering so that results are not accidentally omitted.

## Setup and configuration

The server runs on macOS and Linux and requires `uvx` to be available on the client's `PATH`. Linux installations also require `libseccomp.so.2`. Codex CLI, Claude Code, and Gemini CLI have dedicated plugin or extension installation paths. Cursor, VS Code with GitHub Copilot, and Amazon Kiro can use the Agent Plugins package; standalone MCP configuration is also supported.

Set `RLM_ALLOWED_ROOTS` to an absolute checkout path when the client launches the server from a plugin directory or when workspace access must be restricted. The path supplied to `rlm_start` must be inside an allowed root. The optional evidence gate additionally requires the semantic package extra, both API keys, `RLM_RECURSE_GATE=1`, and the repository path in `RLM_EXTERNAL_ROOTS`.

## Tools and capabilities

- Persistent Python variables across `rlm_execute` calls
- `read_file` and `read_files` for cached file access
- `grep`, `grep_summary`, and `grep_read` for repository searches
- `glob_files` and `tree` for path and structure discovery
- Optional `llm_query` and `rlm_recurse` helpers
- Compact or structured output through Python summaries and `rlm_finalize`

## Limitations and notes

Repository access is read-only. Local exploration does not require an API key, but optional model helpers transmit repository content to an external provider when enabled. The evidence gate may retain original output when scoring fails, budgets are exhausted, results are too small, or the question requires exhaustive coverage. Sessions should be closed with `rlm_end` after exploration.

_Full upstream README: https://allmcps.com/mcp/rlm-tools/readme_

