Login Sign Up

AI Sandbox & MCP Integration Guide

Embedenv now provides a unified runtime infrastructure for AI agents and LLMs. Connecting Claude Desktop, Cursor, or your autonomous python backend to isolated sandbox containers takes just minutes using either standard Model Context Protocol (MCP) or our REST APIs.

Every sandbox is dynamically isolated. System-destructive or administrative shell operations (e.g. sudo or rm -rf /) are blocked automatically.

1. Cloud MCP Server Setup (Secure Cloud Containers)

The **Cloud MCP Server** runs inside a secure, isolated cloud container. AI agents connect to this server over HTTP (via Server-Sent Events or direct POST requests). All files are managed and code is executed on the cloud server, meaning your local machine does not require any code runtimes installed.

Claude Desktop Configuration

Add the following block to your claude_desktop_config.json file:

claude_desktop_config.json
{
  "mcpServers": {
    "embedenv-cloud-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/client-sse",
        "https://embedenv.com/api/mcp/sse?token=YOUR_PUBLIC_API_KEY"
      ]
    }
  }
}

Cursor IDE Configuration

Go to **Cursor Settings -> Features -> MCP** and click **Add New MCP Server**:

  • Name: Embedenv-Cloud-MCP
  • Type: SSE
  • URL: https://embedenv.com/api/mcp/sse?token=YOUR_PUBLIC_API_KEY

2. Local MCP Server Setup (Local Machine Execution)

The **Local MCP Server** runs directly on your computer via stdio communication. It has direct access to your local files, local terminal shell, web browser, and screen. It is distributed as a ZIP bundle containing all scripts.

Claude Desktop Configuration

Add the following block to your claude_desktop_config.json file:

claude_desktop_config.json
{
  "mcpServers": {
    "embedenv-local-mcp": {
      "command": "python",
      "args": [
        "C:/path/to/extracted/distributable_mcp/mcp_server_client.py",
        "--public-key",
        "YOUR_PUBLIC_API_KEY",
        "--skills",
        "files,shell,web,screen",
        "--backend",
        "https://embedenv.com"
      ]
    }
  }
}

Cursor IDE Configuration

Go to **Cursor Settings -> Features -> MCP** and click **Add New MCP Server**:

  • Name: Embedenv-Local-MCP
  • Type: command
  • Command: python -u C:/path/to/extracted/distributable_mcp/mcp_server_client.py --public-key YOUR_PUBLIC_API_KEY --skills files,shell,web,screen --backend https://embedenv.com
Download Local MCP ZIP Package

3. Differences & Use Cases

Here is a detailed comparison of the two MCP server architectures offered by Embedenv:

Feature Cloud MCP Server Local MCP Server
Run Environment Cloud container (Secure Cloud Sandbox) User's local machine (Desktop/Laptop)
Local Runtimes Required None (No Python, Node, or DBs needed locally) Yes (Requires Python and pip package runtime)
Transport Layer HTTP POST / SSE (over HTTPS) Standard Input/Output (stdio via cmd/shell process)
Security / Isolation Highest (Completely isolated sandbox, protects local host) Medium (Runs directly on host; safety relies on LLM alignment)
File Scope Cloud workspace directories (isolated `/tmp/mcp_{session}`) Direct local filesystem access
Execution Speeds Dependent on network latency Instantaneous (Local process execution)

Cloud MCP Use Cases

  • Low-Power Local Systems: AI can run heavy compilers, dependencies, databases, and visual runtimes in the cloud workspace without stressing your laptop.
  • Remote/Web IDEs: Connecting browser-based agents or cloud workspaces (like Gitpod, GitHub Codespaces, Replit) directly.
  • Untrusted Source Code: Safely testing unknown packages, parsing risky files, or running code written by AI without risk to your local system's data and network.

Local MCP Use Cases

  • Local Software Engineering: Directly modifying local git repos, compiling code on your system toolchain, or updating files in VS Code/Cursor.
  • Interactive GUI Testing: Taking real screenshots of your actual primary display monitor to audit local web apps or desktop layouts.
  • Offline Operations & Intranet: Executing commands that interact with local network databases, smart home nodes, or local docker clusters.

4. Available MCP Tools

The AI model gains access to the following workspace tools. The **Cloud MCP** server supports all 12 tools (both cloud-native and local-parity naming conventions), while the **Local MCP** server exposes the local-specific subset.

Tool Name Arguments Server Parity Description
execute_local_command command Both Runs a shell command directly on the host (local PC or cloud container).
run_code code, language, session_id Cloud Only Runs Python, JS, or Bash script inside the cloud workspace session.
read_local_file
alias: read_file
path Both Reads content of a file (local workspace or cloud workspace).
write_local_file
alias: write_file
path, content Both Writes/creates a file inside the active workspace directory.
list_files session_id, subdir Cloud Only Lists all files in the cloud workspace.
local_page_scrape
alias: web_fetch
url Both Scrapes text content from the URL, removing styles and scripts.
capture_local_screenshot
alias: capture_screenshot
save_path Both Captures screenshot of screen/display (virtual Xvfb for Cloud, monitor for Local).
install_package package, manager Cloud Only Installs Python (pip) or Node.js (npm) package dynamically in the container.

3. REST Sandbox API (Ephemeral)

For custom autonomous loops where you manage tasks via API keys, call our endpoints directly:

A. Create / Allocate Sandbox

POST /api/v1/sandbox/create/
curl -X POST https://embedenv.com/api/v1/sandbox/create/ \
  -H "Authorization: Bearer YOUR_PUBLIC_API_KEY"
Response
{
  "ok": true,
  "sandbox_id": "sbx-a3df8b29c",
  "status": "building",
  "ws_url": "wss://embedenv.com/api/v1/sandbox/ws/sbx-a3df8b29c",
  "message": "Sandbox workspace duplication initiated."
}

B. Execute Command / Code

POST /api/v1/sandbox/execute/
curl -X POST https://embedenv.com/api/v1/sandbox/execute/ \
  -H "Authorization: Bearer YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sandbox_id": "sbx-a3df8b29c",
    "language": "python",
    "code": "import sys; print(\"Python running: \", sys.version)"
  }'
Response
{
  "ok": true,
  "stdout": "Python running: 3.10.12 (main, Jun 11 2023, 05:26:28)\n",
  "stderr": "",
  "credits_remaining": 994
}

Live Sandbox & MCP Connection Monitor

This panel displays your active real-time connections. Values update automatically every few seconds.

Active MCP Server Connections

Session ID / UUID Protocol Status Transport Type
Scanning for active SSE clients...

Active Ephemeral AI Sandboxes

Sandbox Name State Metrics (CPU / RAM) Created At Action
No active sandboxes detected.