# agent-repl [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/omaclaren/agent-repl  
**GitHub Stars:** 1  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agent-repl

## Description
pi-repl's shared tmux REPLs (Python, Julia, R and more) for Claude Code, Codex, OpenCode and other agents, over MCP and a CLI.

## Tools
Capabilities this server exposes over MCP:

- **repl_start** — Start or reuse a session with an explicit runtime and wait for a normal prompt
- **repl_status** — Report which sessions are running, with their paths and recent output
- **repl_send** — Run code in a running session and return the submitted code and output, after any record entries and pane text the agent hasn't seen
- **repl_input** — Answer the READ that an LFortran cell sent by `repl_send` is waiting on
- **repl_history** — List a session's record entries, a page at a time, or show one in full by its ID, changing nothing

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/omaclaren/agent-repl), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
npm install
```

2. Install:

```sh
git clone https://github.com/omaclaren/agent-repl
```

3. Install:

```sh
npm link               # use this checkout as the agent-repl command
```

## Documentation

## What agent-repl does

agent-repl provides shared interactive sessions for coding agents and people working in a terminal. Each supported runtime runs inside a named tmux session, allowing an agent to execute code while a human attaches to the same REPL and observes or contributes to it. State such as variables, loaded libraries, and definitions remains available across submissions.

Supported runtimes include Python and IPython, Julia, R, GHCi, Clojure, Ruby, Java, Octave, MATLAB, gnuplot, C++, and an experimental LFortran mode. Python and IPython use the same session. Claude Code, Codex, OpenCode, and other MCP-capable agents can connect to the sessions.

## How it works

The MCP entry point runs over stdio. An agent starts or reuses a runtime session with `repl_start`, then submits code through `repl_send`. Submitted code and its output are recorded with labelled entries, while the agent also receives records and pane text that it has not yet seen. `repl_status` reports active sessions, their paths, and recent output.

`repl_history` provides paginated access to the clean submission record or returns a complete entry by ID without changing the session. LFortran cells that pause for a read can be answered with `repl_input`.

The command-line interface supports starting, attaching to, inspecting, sending code to, exporting, and stopping sessions. A terminal user can run `agent-repl attach julia` to follow an agent, or use `agent-repl send` to submit their own code. Clean records can be exported as Markdown.

## Setup and configuration

Install the package globally with:

```bash
npm install -g agent-repl
```

The runtime requires Node.js 22 or later and tmux. Any REPLs you plan to use must be installed and available as commands in the login shell, such as `python`, `julia`, `R`, `ghci`, `clojure`, `irb`, `jshell`, `octave-cli`, `matlab`, `gnuplot`, `cling`, or `lfortran`. LFortran support uses a build from its `main` branch.

Register the stdio server with an MCP client using `agent-repl mcp`. For example, Claude Code uses `claude mcp add --scope user agent-repl -- agent-repl mcp`, while Codex uses `codex mcp add agent-repl -- agent-repl mcp`. Other clients can configure `agent-repl` with the `mcp` argument as a stdio server.

New sessions use the MCP process's working directory. Set a specific starting directory with `agent-repl mcp --cwd <dir>`; an existing session retains the directory it used when created. The software is developed and tested on macOS, with pi-repl support also covering Linux and Windows through WSL.

## Tools and capabilities

- `repl_start`: start or reuse a named runtime session and wait for its normal prompt.
- `repl_status`: list running sessions, paths, and recent pane output.
- `repl_send`: execute code and return the submission, relevant unseen records or pane text, and output.
- `repl_input`: respond to an LFortran read waiting for input.
- `repl_history`: inspect recorded submissions page by page or retrieve one entry by ID.
- Shared tmux sessions let terminal users, agents, and compatible pi-studio setups work with the same live state.

_Full upstream README: https://allmcps.com/mcp/agent-repl/readme_

