By jamsocketCreated 16 days ago
starstarstarstarstar

Run Python safely in a code sandbox via ForeverVM.

Visit Project
Share this MCP:
X (Formerly Twitter)RedditblueskyThreads by Instagram

Category

Official MCP Server

Tags

Code SandboxPython ExecutionSecure RuntimeForevervm

what is ForeverVM?

ForeverVM is a secure code execution environment that allows you to run arbitrary, stateful Python code in an isolated sandbox. It provides an API for convenient access, making it ideal for safe code execution and experimentation.

How to use ForeverVM?

Using ForeverVM involves interacting with machines and instructions via the CLI or SDK:

CLI Usage:

  1. Log in: npx forevervm login
  2. Start a REPL session: npx forevervm repl
  3. Reconnect to a machine: npx forevervm repl [machine_name]
  4. List machines: npx forevervm machine list

SDK Usage (TypeScript/JavaScript):

  1. Initialize ForeverVM:
    const fvm = new ForeverVM({ token: 'YOUR_API_TOKEN' })
    
  2. Connect to a REPL:
    const repl = fvm.repl()
    
  3. Execute code:
    let execResult = await repl.exec('4 + 4')
    console.log(execResult.result)
    
  4. Stream output:
    for await (const output of execResult.output) {
      console.log(output.stream, output.data)
    }
    

Key features of ForeverVM?

  • Secure Python Execution: Run Python in sandboxed environments.
  • Stateful Machines: Machines retain state between executions.
  • Memory Management: Automatically swaps idle machines to disk.
  • Tag-based Organization: Machines can be tagged for filtering.
  • API & CLI Access: Integration-friendly interfaces.

Use cases of ForeverVM?

  1. Educational Coding Platforms: Safe execution of student-submitted code.
  2. Function-as-a-Service Workloads: Isolated Python function execution.
  3. Prototype Development: Securely test Python code in production-like environments.
  4. Data Science Sandboxes: Isolated execution of exploratory code.

FAQ from ForeverVM?

  • How do I get an API token?

    Reach out to paul@jamsocket.com.

  • Can I run persistent processes?

    Yes, machines retain state; foreverVM handles memory swapping for idle machines.

  • Is there a memory limit?

    Yes, you can specify memory_mb when creating a machine (default is unspecified).

  • Can I filter machines by tags?

    Yes, use the listMachines method with tag filters.