Logo di mcp-repl

mcp-repl

Organizzazione
posit-dev

mcp-repl is an MCP server that gives an agent a persistent Python or R

Autoreposit-dev
Repositorymcp-repl
LinguaRust
Fork
5
Stelle
70
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaApache-2.0
Link
  • Collega gli strumenti ai flussi di lavoro IA

    mcp-repl mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    70 stelle e 5 fork nel repository collegato.

mcp-repl

mcp-repl is an MCP server that gives an agent a persistent Python or R session, kept alive across tool calls. The agent can load data once, inspect objects, try ideas, read help, make plots, and keep iterating — the way a person would in a REPL.

A shell tool running Rscript -e or python -c keeps forcing the agent to rebuild context. mcp-repl keeps the session open instead: variables, loaded packages, plots, and other state stay available until you or the model reset.

Features

  • Sandboxed by default. The backend runs in a sandbox enforced by OS primitives at the process level — not command-specific runtime rules. Network is disabled; writes are constrained to workspace roots and the temp paths the active session needs. On Unix, a memory guardrail kills the worker if it exceeds threshold.
  • Curated output. Smart echo (omitted when safe, elided for large multi-expression blocks) and in-band help pages. Plots are returned as inline images through MCP for vision-capable models, so the agent sees the plot directly; non-vision models still get the saved file path. When replies get too large, the tool response stays short and the full output is saved as a structured bundle (transcript + plot files) the model can explore on demand.
  • No polling. R and Python run embedded in the worker, not behind a stdio pipe driven by prompt-string heuristics. The server knows precisely when the interpreter is idle and has settled, so each repl call returns the moment the work is done — no fixed waits, no guessing whether more output is on the way.
  • Explicit session control. Interrupts and resets are first-class.

Quickstart

1. Install

Install from PyPI. The package is named posit-mcp-repl and exposes the mcp-repl executable, plus a posit-mcp-repl alias for uvx:

sh
pipx install posit-mcp-repl
# or
uv tool install posit-mcp-repl
# one-off
uvx posit-mcp-repl --help

Or install via cargo (needs the Rust toolchain):

sh
cargo install --git https://github.com/posit-dev/mcp-repl --locked
# pin a version with: --tag v0.1.0

Or use a prebuilt binary. Linux/macOS:

sh
curl -fsSL https://raw.githubusercontent.com/posit-dev/mcp-repl/main/scripts/install.sh | sh

Windows PowerShell:

powershell
irm https://raw.githubusercontent.com/posit-dev/mcp-repl/main/scripts/install.ps1 | iex
Install-McpRepl

Direct downloads live on the latest release page. Linux x86_64 builds require glibc 2.35+; the glibc build produced on Ubuntu 22.04 supports Ubuntu 22.04+.

Latest release binaries:

PyPI wheels and prebuilt binaries do not bundle R or Python; install those separately.

2. Wire into your MCP client

Auto-install into agent config files:

sh
mcp-repl install                                 # all supported clients/interpreters
mcp-repl install --client codex                  # only Codex
mcp-repl install --client claude                 # only Claude (~/.claude.json)
mcp-repl install --client codex --interpreter r  # limit to one interpreter

By default this writes entries for both r and python.

install --client codex writes --sandbox inherit-codex --oversized-output files — inherit-codex tells mcp-repl to take sandbox policy from Codex's per-call _meta["codex/sandbox-state-meta"] metadata (it fails closed if the metadata is missing or malformed). install --client claude writes an explicit --sandbox workspace-write because Claude Code does not provide a way to propagate Codex's per-call sandbox metadata to MCP servers. Bare mcp-repl (no install) defaults to --oversized-output pager.

Manual Codex entry:

toml
[mcp_servers.r]
command = "/Users/alice/.cargo/bin/mcp-repl"
tool_timeout_sec = 1800   # outer guard; mcp-repl handles the primary timeout
args = ["--sandbox", "inherit-codex", "--oversized-output", "files", "--interpreter", "r"]

Swap --interpreter r for --interpreter python (and rename the section) for the Python entry. Existing Codex configs that use --sandbox inherit still work; it is a compatibility alias for inherit-codex.

Manual Claude entry in ~/.claude.json:

json
{
  "mcpServers": {
    "r": {
      "command": "/Users/alice/.cargo/bin/mcp-repl",
      "args": [
        "--sandbox", "workspace-write",
        "--oversized-output", "files",
        "--interpreter", "r"
      ]
    }
  }
}

3. Pick interpreter (optional)

Resolution order: --interpreter <r|python> → MCP_REPL_INTERPRETER → r.

Runtime discovery

R. Set R_HOME to force a specific installation; otherwise it's discovered from R on PATH (via R RHOME). Verify with R.home() in the session.

Python. The interpreter resolves in this order:

  • nearest .venv/bin/python walking upward from cwd
  • nearest .venv/bin/python3 walking upward from cwd
  • first python3 on PATH
  • first python on PATH
  • fallback literal python3

.venv search stops at $HOME (inclusive), otherwise at the filesystem root. The selected Python must expose a loadable CPython library via its sysconfig metadata. Runtime-owned stdout/stderr is routed through worker IPC; raw fd writes and child-process output are still captured from the worker's stdout/stderr pipes.

Platform support

  • macOS: supported.
  • Linux: supported. Release binaries are glibc builds produced on Ubuntu 22.04.
  • Windows: experimental for R. Python is not part of the stable Windows surface yet.

Sandbox

Default policy: workspace-write with network disabled. Write access covers the working area plus worker-required temp paths (exact roots vary by OS/policy). On Windows, the experimental R sandbox uses parent-prepared workspace ACLs plus launch-scoped session-temp ACLs; some environments reject the restricted-token setup.

See docs/sandbox.md for precise behavior.

MCP surface

  • repl → { "input": "1+1\n", "timeout_ms": 10000 }

The exact repl tool description depends on the interpreter and --oversized-output mode. Per-tool guides live in docs/tool-descriptions/.

Session control

  • Interrupt: prefix repl input with \u0003 (SIGINT, best-effort). Session continues.
  • Reset: prefix repl input with \u0004 (Ctrl-D / EOF). Reset requests worker shutdown, waits through a bounded graceful shutdown window, escalates to forceful termination when that window expires, then starts a fresh session. The same reply includes old-worker output captured through that window, followed by any remaining input's fresh-session output under the original call timeout.
  • In-band exits: EOF, quit(), etc. also work — output is returned and the next request runs in a fresh worker.

Debugging

Enable JSONL logs per startup:

  • CLI: --debug-dir /path/to/debug-root
  • Env: MCP_REPL_DEBUG_DIR=/path/to/debug-root

Each startup writes a session directory with events.jsonl, startup logs, and sandbox-state logs. See docs/debugging.md for the full guide, including the external wire-trace proxy.

Docs

  • Engineering map: docs/index.md
  • Sandbox: docs/sandbox.md
  • Worker sideband protocol: docs/worker_sideband_protocol.md
  • Tool guides: docs/tool-descriptions/

License

Apache-2.0. See LICENSE.

Installazione

TypingMind
Prerequisiti:

Node.js 18+

{
  "mcpServers": {
    "t-kalinowski-mcp-repl": {
      "command": "",
      "args": []
    }
  }
}

Usa MCP mcp-repl con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso mcp-repl, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi mcp-repl come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di mcp-repl.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "t-kalinowski-mcp-repl": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-repl"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di mcp-repl, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di mcp-repl.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare mcp-repl per aiutarmi con questa attività?
mcp-repl
Certo. Ho letto.
Ecco cosa ho trovato con mcp-repl.

Domande frequenti

A cosa serve il server MCP mcp-repl?

mcp-repl è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare mcp-repl MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare mcp-repl con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP mcp-repl con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando mcp-repl, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego mcp-repl MCP a TypingMind?

mcp-repl funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre mcp-repl MCP in TypingMind?

mcp-repl mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare mcp-repl MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se mcp-repl richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇