ForeverVM MCP Server

ForeverVM MCP Server avatar

by jamsocket

Securely run AI-generated code in stateful sandboxes that run forever.

What is ForeverVM MCP Server

foreverVM

GitHub Repo stars Chat on Discord

repo version
cli npm
sdk npm

foreverVM provides an API for running arbitrary, stateful Python code securely.

The core concepts in foreverVM are machines and instructions.

Machines represent a stateful Python process. You interact with a machine by running instructions (Python statements and expressions) on it, and receiving the results. A machine processes one instruction at a time.

Getting started

You will need an API token (if you need one, reach out to paul@jamsocket.com).

The easiest way to try out foreverVM is using the CLI. First, you will need to log in:

npx forevervm login

Once logged in, you can open a REPL interface with a new machine:

npx forevervm repl

When foreverVM starts your machine, it gives it an ID that you can later use to reconnect to it. You can reconnect to a machine like this:

npx forevervm repl [machine_name]

You can list your machines (in reverse order of creation) like this:

npx forevervm machine list

You don't need to terminate machines -- foreverVM will automatically swap them from memory to disk when they are idle, and then automatically swap them back when needed. This is what allows foreverVM to run repls “forever”.

Using the API

import { ForeverVM } from '@forevervm/sdk'

const token = process.env.FOREVERVM_TOKEN
if (!token) {
  throw new Error('FOREVERVM_TOKEN is not set')
}

// Initialize foreverVM
const fvm = new ForeverVM({ token })

// Connect to a new machine.
const repl = fvm.repl()

// Execute some code
let execResult = repl.exec('4 + 4')

// Get the result
console.log('result:', await execResult.result)

// We can also print stdout and stderr
execResult = repl.exec('for i in range(10):\n  print(i)')

for await (const output of execResult.output) {
  console.log(output.stream, output.data)
}

process.exit(0)

Working with Tags

You can create machines with tags and filter machines by tags:

import { ForeverVM } from '@forevervm/sdk'

const fvm = new ForeverVM({ token: process.env.FOREVERVM_TOKEN })

// Create a machine with tags
const machineResponse = await fvm.createMachine({
  tags: { 
    env: 'production', 
    owner: 'user123',
    project: 'demo'
  }
})

// List machines filtered by tags
const productionMachines = await fvm.listMachines({
  tags: { env: 'production' }
})

Memory Limits

You can create machines with memory limits by specifying the memory size in megabytes:

// Create a machine with 512MB memory limit
const machineResponse = await fvm.createMachine({
  memory_mb: 512,
})

Leave a Comment

Frequently Asked Questions

What is MCP?

MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.

What are MCP Servers?

MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.

How do MCP Servers work?

MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.

Are MCP Servers secure?

Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.

Related MCP Servers

PostgreSQL MCP Server avatar

PostgreSQL MCP Server

A Model Context Protocol server that provides read-only access to PostgreSQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

databasepostgresqlcommunity
sylphlab pdf reader mcp avatar

sylphlab pdf reader mcp

An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.

pdf-parsetypescriptnodejs
aashari mcp server atlassian bitbucket avatar

aashari mcp server atlassian bitbucket

Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.

atlassianrepositorymcp
aashari mcp server atlassian confluence avatar

aashari mcp server atlassian confluence

Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.

atlassianmcpconfluence
prisma prisma avatar

prisma prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

cockroachdbgomcp
yaoxiaolinglong mcp mongodb mysql server avatar

yaoxiaolinglong mcp mongodb mysql server

用于mysql和mongodb的mcp

mcpgodatabase
weibaohui k8m avatar

weibaohui k8m

一款轻量级、跨平台的 Mini Kubernetes AI Dashboard,支持大模型+智能体+MCP(支持设置操作权限),集成多集群管理、智能分析、实时异常检测等功能,支持多架构并可单文件部署,助力高效集群管理与运维优化。

openaichatgptmcp
watchdealer pavel watchbase mcp server avatar

watchdealer pavel watchbase mcp server

MCP Server for structured and standardized querying of watch-related metadata such as brands, families, and reference details from WatchBase.com.

caliberswatcheswatch
vgnshiyer apple books mcp avatar

vgnshiyer apple books mcp

Apple Books MCP Server

applemcpmcp-server
ttiimmaacc cinema4d mcp avatar

ttiimmaacc cinema4d mcp

Cinema 4D plugin integrating Claude AI for prompt-driven 3D modeling, scene creation, and manipulation.

plugincinema-4d-pluginai-integration

Submit Your MCP Server

Share your MCP server with the community

Submit Now