Agent Repl logo

Agent Repl

Share live tmux-backed REPL sessions between coding agents and terminal users through MCP and a CLI.

Install Agent Repl

Run the project’s own setup commands, in order.

Setup steps from the project

agent-repl installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install
    
  2. 2. Install
    git clone https://github.com/omaclaren/agent-repl
    
  3. 3. Install
    npm link               # use this checkout as the agent-repl command
    

Overview

agent-repl connects coding agents and terminal users to shared tmux-backed REPL sessions through MCP and a command-line interface. It can run Python, Julia, R, Haskell, Clojure, Ruby, Java, Octave, MATLAB, gnuplot, C++, and experimental LFortran sessions, preserving state between submissions. Reach for it when an agent and a person need to inspect or modify the same live computational workspace. Claude Code, Codex, OpenCode, and other MCP-capable agents can use the same named session.

Use cases

  • Share a live Python workspace between an agent and a terminal user
  • Run exploratory Julia or R analysis while preserving session state
  • Inspect an agent's submitted code and output from tmux
  • Export a clean REPL record as Markdown
  • Execute code in multiple supported language runtimes

Key features

  • Shared named tmux sessions
  • MCP tools for session control and code execution
  • CLI commands for attaching, sending, exporting, and stopping
  • Recorded, labelled submissions with code and output
  • Support for multiple scientific and programming REPLs
  • Experimental LFortran input handling

Tools5

What Agent Repl lets your agent do. Expand a tool for its parameters.

Self-reported~125 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

5/5 checks healthy over the last 18d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit11d agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Agent Repl works

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:

Terminal
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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Agent Repl

agent-repl is an MCP server that connects coding agents and terminal users to shared tmux-backed REPL sessions. Its main tools start or inspect sessions, send code, answer an LFortran read, and review recorded submissions. It supports Python, Julia, R, Haskell, Clojure, Ruby, Java, Octave, MATLAB, gnuplot, C++, and experimental LFortran.

Install it with `npm install -g agent-repl`, then register `agent-repl mcp` as a stdio MCP server in your client. Node.js 22 or later and tmux are required, along with any language runtimes you intend to use.

Start the server with `agent-repl mcp --cwd <dir>` to choose the working directory for new sessions. Sessions that already exist keep the directory they used when they were created.

Yes, agent-repl works with both Claude Code and Codex through stdio MCP configuration. Claude Code can add it with `claude mcp add --scope user agent-repl -- agent-repl mcp`, and Codex can use `codex mcp add agent-repl -- agent-repl mcp`.

Start or reuse a runtime session through MCP, then attach to the corresponding tmux session with `agent-repl attach <runtime>`. The agent and terminal user can access the same variables, definitions, submissions, and output.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAgent Repl AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/agent-repl?style=directory)](https://allmcps.com/mcp/agent-repl)
HTML Embed
<a href="https://allmcps.com/mcp/agent-repl"><img src="https://allmcps.com/api/badge/agent-repl?style=directory" alt="Agent Repl on AllMCPs" /></a>