feat: Phase 2 — Vercel Sandbox adapter + MCP server support - #1
Conversation
Add first-class MCP server support to claude-local and introduce the emisso_sandbox adapter for running Claude Code in ephemeral Vercel Sandbox microVMs. MCP support (claude-local): - Write mcpServers config to temp file, pass via --mcp-config flag - Validate mcpServers structure in environment test - Document mcpServers in agentConfigurationDoc - Pass through mcpServersJson in UI build-config Emisso Sandbox adapter (new): - Server: create sandbox → clone repos → inject instructions + MCP → run Claude CLI → stream logs → parse result → stop sandbox - UI: config form (model, vCPUs, timeout, snapshot, MCP servers JSON), stream-json transcript parser - CLI: reuses claude-local's stream event formatter - Registered in all 3 registries (server, UI, CLI) - Cost calculator for sandbox compute + API token costs - Environment test validates API key, Vercel auth, SDK availability Also adds: - emisso-engineering skill (SKILL.md) - Engineering agent setup guide Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude review edge cases |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review edge cases |
|
Claude finished @cdotte's task in 2m 18s —— View job Edge Case Review
Findings🔴 Critical1. Kill-then-rerun race condition ( The adapter spawns a Claude CLI process with
2. if (readResult.exitCode === 0) {
// write file
}
// no else — missing file is silently ignoredAn agent with a misconfigured 🟠 High3. MCP textarea state lost on reload ( Edit mode stores valid JSON in Fix: derive the display value from eff("adapterConfig", "mcpServersJson",
config.mcpServers ? JSON.stringify(config.mcpServers, null, 2) : ""
)(This pattern already appears in the 4. for (const extra of additionalRepos) {
const url = gitAuth ? embedGitCredentials(extra.repoUrl, gitAuth) : extra.repoUrl;
repos.push({ url, dirName: extra.dirName || extractRepoDirName(extra.repoUrl) });
}If 5. const cloneDepth = asNumber(config.cloneDepth, 1);
6. Timeout detection may miss sandbox-forced termination ( const isTimeout = stderr.includes("ETIMEDOUT") || stderr.includes("timed out");
// ...
const isTimeout = message.includes("AbortError") || message.includes("timed out");When Vercel terminates the sandbox due to its wall-clock 🟡 Medium7. let fullStdout = "";
for await (const log of runnerCmd.logs()) {
if (log.stream === "stdout") fullStdout += log.data;
await onLog(log.stream, log.data);
}
8. The environment test warns when Vercel auth is partial/missing but uses 9. if (event.type === "user" && event.message?.content) {
for (const block of event.message.content) {
if (block.type === "tool_result") {
return [{ ... }]; // returns on first match
}
}
}A user message can contain multiple 🔵 Low / Informational10.
11. Cost calculator CPU utilization is a fixed guess (
12. The test reports the configured Summary Table
|
- Log warning when instructionsFilePath not found (was silently ignored) - Clamp cloneDepth to [1, 10000] (depth 0 caused full clones) - Skip additionalRepos with empty repoUrl (was causing cryptic git errors) - Broaden timeout detection to catch SDK-specific errors (TimeoutError, SandboxTimeoutError, 408, 504) - Cap fullStdout accumulation at 5 MB to prevent unbounded memory growth - Upgrade Vercel auth check from warn to error (missing auth blocks execution) - Collect all tool_result blocks per user message, not just the first Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
mcpServersin their adapter config. The adapter writes the config to a temp file and passes it via--mcp-configto the Claude CLI. Includes validation in environment tests.emisso_sandboxadapter: Runs Claude Code inside ephemeral Vercel Sandbox microVMs (Firecracker). Full lifecycle: create sandbox → clone repos → inject instructions + MCP config → run Claude CLI with stream-json → parse results → stop sandbox. Registered in all 3 registries (server, UI, CLI).skills/emisso-engineering/SKILL.mdfor agent instructions,doc/guides/engineering-agent-setup.mdfor configuration reference.Files changed
Modified (11): constants, claude-local execute/index/build-config/test, adapter-utils types, all 3 registries, server package.json, lockfile
Created (12): 6 server adapter files (types, helpers, cost-calculator, execute, test, index), 4 UI adapter files (parse-stdout, config-fields, build-config, index), engineering skill, setup guide
Test plan
pnpm buildpasses all packagespnpm typecheckclean across monorepomcpServersconfig → verify--mcp-configappears in CLI invocationtestEnvironment()validates Vercel auth + API key🤖 Generated with Claude Code