FO

ForeverVM MCP Server for Claude Python REPL

Enable Claude to run Python code with the ForeverVM MCP server, providing secure, low-latency REPL execution for testing and development.

Quick Install
npx -y @javascript/mcp-server

Overview

The ForeverVM MCP Server provides a compact Model Context Protocol (MCP) integration that lets Claude (Anthropic) execute Python code inside a managed REPL. It exposes a pair of tools that create and drive Python REPL sessions, enabling interactive code execution for experimentation, debugging, and small-scale programmatic workflows directly from a Claude-enabled client.

This server is designed for low-latency interactive execution during development and testing. It is not intended to replace production-grade execution environments: treat it as a fast developer-facing bridge that runs Python snippets in isolated REPLs and returns results to the calling MCP client.

Features

  • Fast, interactive Python REPL creation and execution via MCP-compatible tools
  • Two simple tools: create a REPL and run code in a REPL
  • Minimal footprint: implemented as a small JavaScript MCP server
  • Simple local development setup for integrating with Claude Desktop or other MCP clients
  • Intended for testing, debugging, and prototyping code execution workflows

Installation / Configuration

Quickstart (Claude Desktop)

# Install MCP tools in Claude Desktop (uses npx)
npx forevervm-mcp install --claude

Local development / custom MCP client

  1. Clone or place the MCP server code on your machine (example path: ./javascript/mcp-server).
  2. Configure your MCP client to run the server using npm. Set the client command to npm and the arguments to:
["--prefix", "<path/to/this/directory>", "run", "start", "run"]

Replace <path/to/this/directory> with the path to the MCP server folder.

Notes:

  • The provided local setup is intended for development and testing only. Do not expose the server to the public internet without applying proper sandboxing, authentication, and resource controls.
  • See the ForeverVM docs for additional MCP client integrations: https://forevervm.com/docs/guides/forevervm-mcp-server/

Available Tools

The MCP server exposes two tools for controlling Python REPL sessions. These are intended to be consumed by MCP-aware clients such as Claude.

Tool overview table

Tool namePurposeInputsReturns
create-python-replCreate a new Python REPL sessionnonereplId (string) - ID of the created REPL
run-python-in-replRun Python code in an existing REPLcode (string), replId (string)Execution result (string / structured output)

Details

  • create-python-repl

    • What it does: Spawns a new Python REPL instance and returns its identifier. Use this ID for subsequent code execution calls.
    • Return: A string identifier (replId) that represents the REPL.
  • run-python-in-repl

    • What it does: Executes a given Python code snippet inside the specified REPL and returns the result/output. This supports short-lived commands and REPL-style interactions.
    • Required inputs:
      • code (string): The Python code to execute.
      • replId (string): The identifier of the REPL where the code will run.
    • Return: A result object or textual output indicating stdout, stderr, and execution responses.

Example usage (conceptual payload)

{
  "tool": "run-python-in-repl",
  "input": {
    "replId": "repl-abc123",
    "code": "print('hello from Claude')"
  }
}

Use Cases

  • Interactive debugging
    • Ask Claude to reproduce a bug or prototype a function; create a REPL, send the code, and iterate quickly.
  • Teaching and exploration
    • Run short Python examples or experiments while working through tutorials or unit tests.
  • Rapid prototyping
    • Evaluate small algorithm snippets or data transformations without setting up a full runtime environment.
  • Automated small-scale tests
    • Use Claude to drive test snippets against a helper REPL session during development.

Concrete example workflow

  1. create-python-repl → returns replId “repl-01”.
  2. run-python-in-repl with replId “repl-01” and code:
    import math
    math.factorial(5)
    
  3. Receive the result (e.g., “120”) and continue iterating in the same REPL session for stateful interactions.

Security & Operational Notes

  • The MCP server is intended for local development and controlled environments. If you must deploy it in shared or production environments:
    • Enforce authentication and authorization on the MCP client/server transport.
    • Restrict network access to trusted clients.
    • Run REPLs in isolated sandboxes or containers and apply resource/time limits to prevent runaway processes.
    • Sanitize inputs and consider execution-time and memory caps.
  • For high-volume or production code execution, prefer dedicated, hardened execution services rather than a lightweight REPL-based MCP server.

Resources

  • GitHub repository: https://github.com/jamsocket/forevervm/tree/main/javascript/mcp-server
  • ForeverVM MCP docs: https://forevervm.com/docs/guides/forevervm-mcp-server/

The ForeverVM MCP Server offers a simple, developer-friendly way to let Claude run Python snippets through a managed REPL. Use it for testing, rapid prototyping, and interactive experimentation while keeping security and scope considerations in mind.