Skip to main content
Glama
mcp-interactive-repl

mcp-interactive-repl

by zachsnow
README.md
# mcp-interactive-repl

An MCP server that provides generic interactive REPL access for Claude and other MCP clients.
Useful for working with command-line tools that have prompt-based interfaces, interactively.

> I only vibed this so that Claude could help me debug an issue in [Quinix](https://quinix.vein.io)
> using the `qvm` interactive debugger; hopefully it's useful.

## Installation

```bash
npm install -g mcp-interactive-repl
```

Or use directly with npx (no install needed).

## Usage

Add to your Claude Code MCP configuration (`~/.claude/settings.json`):

```json
{
  "mcpServers": {
    "repl": {
      "command": "npx",
      "args": ["mcp-interactive-repl"]
    }
  }
}
```

Or if installed globally:

```json
{
  "mcpServers": {
    "repl": {
      "command": "mcp-interactive-repl"
    }
  }
}
```

## Tools

### repl_start

Start a REPL session with prompt detection. For example, to start the Python REPL:

```json
{
  "command": "python",
  "args": ["-i"],
  "prompt": "^>>> $"
}
```

Parameters:
- `command` (required): Command to run
- `prompt` (required): Regex pattern to detect the prompt
- `args`: Command arguments (default: `[]`)
- `cwd`: Working directory (default: server's current directory)
- `env`: Additional environment variables, merged with server's environment (default: `{}`)
- `initialTimeout`: Max milliseconds to wait for initial prompt (default: 30000)

### repl_send

Send input to a session and wait for the next prompt.

```json
{
  "sessionId": "...",
  "input": "print('hello')",
  "timeout": 30000
}
```

Parameters:
- `sessionId` (required): Session ID from `repl_start`
- `input` (required): Input to send (newline appended automatically)
- `timeout`: Max milliseconds to wait for prompt (default: 30000)

### repl_read

Non-blocking read of the current output buffer.

```json
{
  "sessionId": "..."
}
```

Parameters:
- `sessionId` (required): Session ID from `repl_start`

### repl_kill

Terminate a session.

```json
{
  "sessionId": "..."
}
```

Parameters:
- `sessionId` (required): Session ID from `repl_start`

### repl_list

List all active sessions. Takes no parameters.

## Development

```bash
npm install
npm run typecheck   # Type check
npm run build       # Build to dist/
npm run dev         # Build and run
```

TDQS

A3.6/5.0

Scored across 5 tools

Disambiguation5/5

Each tool maps to a distinct lifecycle action: start, send (blocking), read (non-blocking), kill, list. The blocking vs. non-blocking distinction between repl_send and repl_read is explicitly documented, so overlap is minimal.

Naming Consistency5/5

All five tools use the same repl_ prefix followed by a short verb (start, send, read, kill, list). The pattern is fully predictable and readable.

Tool Count5/5

Five tools is a tight, well-scoped surface for managing interactive REPL sessions, with no redundant or filler tools.

Completeness4/5

Session lifecycle (create, interact, inspect, terminate, enumerate) is fully covered. Minor gaps exist: no explicit interrupt/signal-send or status/exit-code tool, though agents can approximate these via repl_send sending control characters.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues