This CLI includes a Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with your Runloop devboxes programmatically.
The Model Context Protocol (MCP) is an open standard that enables AI applications to connect with external systems. It's like a USB-C port for AI applications - a standardized way to expose tools, resources, and context to large language models.
Runloop provides two transport modes for the MCP server:
For local AI assistants like Claude Desktop:
rli mcp startThe server runs on stdio and communicates using the MCP protocol.
For web-based AI assistants or remote access:
rli mcp start --httpOr specify a custom port:
rli mcp start --http --port 8080The HTTP server runs on http://localhost:3000 by default and uses Server-Sent Events (SSE) for communication.
The MCP server exposes the following tools:
-
list_devboxes - List all devboxes with optional status filtering
- Parameters:
status(optional),limit(optional)
- Parameters:
-
get_devbox - Get detailed information about a specific devbox
- Parameters:
id(required)
- Parameters:
-
create_devbox - Create a new devbox
- Parameters:
name,blueprint_id,snapshot_id,entrypoint,environment_variables,resource_size,keep_alive_seconds
- Parameters:
-
execute_command - Execute a command on a devbox
- Parameters:
devbox_id(required),command(required)
- Parameters:
-
shutdown_devbox - Shutdown a devbox
- Parameters:
id(required)
- Parameters:
-
suspend_devbox - Suspend a devbox
- Parameters:
id(required)
- Parameters:
-
resume_devbox - Resume a suspended devbox
- Parameters:
id(required)
- Parameters:
- list_blueprints - List all available blueprints
- Parameters:
limit(optional)
- Parameters:
-
list_snapshots - List all snapshots
- Parameters:
devbox_id(optional),limit(optional)
- Parameters:
-
create_snapshot - Create a snapshot of a devbox
- Parameters:
devbox_id(required),name(optional)
- Parameters:
The easiest way to set up with Claude Desktop:
rli mcp installThis automatically adds the configuration to your Claude Desktop config file and preserves any existing MCP servers.
If you prefer to configure manually, add this to your Claude configuration file:
macOS/Linux: Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: Edit %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"runloop": {
"command": "rli",
"args": ["mcp", "start"],
}
}
}For web-based AI clients, start the HTTP server and configure your client to connect to:
- SSE endpoint:
http://localhost:3000/sse - Message endpoint:
http://localhost:3000/message
Example for Claude Code or other MCP clients supporting HTTP:
{
"mcpServers": {
"runloop": {
"url": "http://localhost:3000/sse"
}
}
}The MCP server uses the same API key configuration as the CLI. Set your API key:
export RUNLOOP_API_KEY=your_api_key_hereOnce configured, you can ask Claude to perform Runloop operations:
- "List all my running devboxes"
- "Create a new devbox using the python-base blueprint"
- "Execute 'ls -la' on devbox abc123"
- "Show me all snapshots"
- "Create a snapshot of my devbox"
Claude will use the MCP tools to interact with your Runloop account and provide responses based on the actual data.
RUNLOOP_BASE_URL— Optional. Full API URL of the formhttps://api.<domain>(e.g.https://api.runloop.pro). Defaults tohttps://api.runloop.ai. See README Setup → Custom API endpoint (RUNLOOP_BASE_URL).- API key is read from the CLI configuration (
~/.runloop/config.json)
If the stdio MCP server isn't working:
- Make sure
RUNLOOP_API_KEYenvironment variable is set - Check that the
rlicommand is in your PATH - Restart Claude Desktop after updating the configuration
- Check Claude's logs for any error messages
If the HTTP MCP server isn't working:
- Make sure
RUNLOOP_API_KEYenvironment variable is set - Check that the port isn't already in use
- Verify the server is running:
curl http://localhost:3000/sse - Check your firewall settings if connecting remotely
- Look at the server logs for error messages
- "API key not configured": Set
RUNLOOP_API_KEYenvironment variable - Port already in use: Stop other services or use a different port with
--port - Connection refused: Make sure the server is running and accessible
The MCP server provides full access to your Runloop account. Only use it with trusted AI assistants, and be aware that the assistant can create, modify, and delete devboxes on your behalf.