MCPSERV.CLUB
jamsocket

ForeverVM

MCP Server

Stateful Python execution that lives forever

Stale(50)
220stars
2views
Updated 14 days ago

About

ForeverVM offers an API to run arbitrary, stateful Python code securely. Machines persist across sessions, automatically swapping idle instances between memory and disk for long‑running REPLs.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

ForeverVM: Persistent, Secure Python Execution for AI Workflows

ForeverVM offers a lightweight, stateful Python runtime that can be controlled over a networked API. It solves the problem of running arbitrary, long‑lived Python code from an AI assistant without exposing your local environment or risking resource exhaustion. By treating each execution context as a machine that can be started, stopped, and resumed, ForeverVM allows developers to maintain continuity across multiple interactions while keeping the underlying process isolated and sandboxed.

The core concept revolves around machines—persistent Python processes that retain their global state between instructions. An AI assistant can send a single line of code or an entire script as an instruction to a machine, receive the result, and continue building on that state in subsequent calls. This is especially valuable when working with complex data pipelines, interactive notebooks, or any scenario that requires iterative refinement of code. The server automatically swaps idle machines from memory to disk and restores them on demand, ensuring that REPL sessions can truly run “forever” without manual cleanup.

Key capabilities include:

  • Stateful execution: Variables, imports, and compiled functions persist across instructions, enabling incremental development.
  • Resource isolation: Each machine runs in a secure sandbox with configurable memory limits, protecting the host system from runaway processes.
  • Tagging and filtering: Machines can be annotated with arbitrary metadata, allowing developers to organize sessions by environment, project, or owner.
  • Automatic persistence: Idle machines are swapped to disk and rehydrated when needed, eliminating the need for explicit termination or manual state management.
  • Rich I/O handling: Standard output, standard error, and return values are streamed back to the client, giving the assistant full visibility into execution.

In practice, ForeverVM is ideal for building AI‑powered development assistants that need to keep a Python session alive across user queries. For example, an AI tutor can maintain a student’s code state while the learner iterates through exercises; a data scientist can persist a large in‑memory dataset across multiple analysis steps; or a chatbot can execute user‑supplied scripts on the fly while safeguarding the host environment. By integrating with MCP, these scenarios become seamless: the AI client sends instructions via the protocol, receives immediate feedback, and can resume or spawn new machines as the workflow evolves.