CodeSandbox

v1.0.0Developer Toolsstable

MCP server for CodeSandbox SDK

codesandboxmcpai-integration
Share:
10
Stars
0
Downloads
0
Weekly
0/5

What is CodeSandbox?

CodeSandbox is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for codesandbox sdk

MCP server for CodeSandbox SDK

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • MCP server for CodeSandbox SDK

Use Cases

Access CodeSandbox SDK features through MCP for cloud-based development.
techlibs

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedOct 31, 2025
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx codesandbox

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use CodeSandbox

The CodeSandbox MCP server wraps the CodeSandbox SDK and exposes sandbox lifecycle management and filesystem operations as MCP tools. AI clients can create, resume, hibernate, and configure cloud sandbox VMs; read and write files in sandbox filesystems; and manage sessions — enabling fully cloud-based code execution and development workflows without leaving the AI assistant.

Prerequisites

  • Node.js 18 or higher and npx available
  • A CodeSandbox account at https://codesandbox.io
  • A Personal Access Token from CodeSandbox with Sandbox Creation, Read/Edit, VM Manage, and Preview Token Manage scopes
  • Claude Desktop or a Cursor installation
  • The CODESANDBOX_API_TOKEN environment variable set
1

Generate a CodeSandbox Personal Access Token

Log in to CodeSandbox, go to Settings > API Tokens, and create a new token. Enable the scopes: Sandbox Creation, Sandbox Read/Edit, VM Manage, and Preview Token Manage.

2

Verify the package works

Run a quick test to confirm the package installs and the help output is accessible.

npx -y @techlibs/codesandbox-mcp@latest --help
3

Add the server to Claude Desktop config

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) and add the CodeSandbox MCP server entry.

{
  "mcpServers": {
    "codesandbox": {
      "command": "npx",
      "args": ["-y", "@techlibs/codesandbox-mcp@latest"],
      "env": {
        "CODESANDBOX_API_TOKEN": "your_personal_access_token_here"
      }
    }
  }
}
4

Optional: enable read-only mode

Add the --read-only flag to the args array to prevent the MCP server from performing any write operations, making it safe for read-only workflows.

{
  "mcpServers": {
    "codesandbox": {
      "command": "npx",
      "args": ["-y", "@techlibs/codesandbox-mcp@latest", "--read-only"],
      "env": {
        "CODESANDBOX_API_TOKEN": "your_personal_access_token_here"
      }
    }
  }
}
5

Restart Claude Desktop and verify

Quit and reopen Claude Desktop. Confirm the codesandbox server appears in the tools panel and try listing available tools.

CodeSandbox Examples

Client configuration

Complete claude_desktop_config.json entry using the @techlibs/codesandbox-mcp npm package.

{
  "mcpServers": {
    "codesandbox": {
      "command": "npx",
      "args": ["-y", "@techlibs/codesandbox-mcp@latest"],
      "env": {
        "CODESANDBOX_API_TOKEN": "your_personal_access_token_here"
      }
    }
  }
}

Prompts to try

Example natural language prompts to use with the CodeSandbox MCP server.

- "Create a new CodeSandbox from the React template and start it"
- "List all files in my sandbox's src directory"
- "Read the contents of /workspace/src/App.tsx in sandbox abc123"
- "Write a new file /workspace/src/utils.ts with the following TypeScript code"
- "Hibernate sandbox abc123 to save resources"
- "Get metadata for sandbox abc123 without starting the VM"

Troubleshooting CodeSandbox

401 Unauthorized when using sandbox tools

Verify your CODESANDBOX_API_TOKEN is correct and has not expired. Generate a new token in CodeSandbox Settings > API Tokens. Ensure all required scopes (Sandbox Creation, Read/Edit, VM Manage, Preview Token Manage) are enabled on the token.

Sandbox VM fails to start or times out

CodeSandbox VMs may take 30-60 seconds to resume from hibernation. Use resumeSandbox first, then wait before issuing file operations. If consistently failing, check your CodeSandbox plan limits and VM tier availability.

npx cannot find the package or uses a cached old version

Clear the npx cache with npx clear-npx-cache or specify the exact version in args: ["-y", "@techlibs/codesandbox-mcp@latest"]. If behind a corporate proxy, ensure npm registry access is allowed.

Frequently Asked Questions about CodeSandbox

What is CodeSandbox?

CodeSandbox is a Model Context Protocol (MCP) server that mcp server for codesandbox sdk It connects AI assistants to external tools and data sources through a standardized interface.

How do I install CodeSandbox?

Follow the installation instructions on the CodeSandbox GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with CodeSandbox?

CodeSandbox works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is CodeSandbox free to use?

Yes, CodeSandbox is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "codesandbox": { "command": "npx", "args": ["-y", "codesandbox"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use CodeSandbox?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides