opencode-sandbox
opencode-sandbox
从预构建的公共 GHCR 镜像快速启动一个隔离的 opencode 实例,并将其作为 MCP 服务器交给 Claude Code。无需构建步骤,无需检出 opencode 分支——每个实例都是独立的 Docker Compose 项目,拥有自己的命名卷,其工作区也是命名卷而非主机绑定,因此无法访问你的文件系统。镜像为公共镜像,可匿名拉取;后端报告 opencode 1.18.4,MCP 桥接器暴露了 80 个工具。
安装
从源码构建并将二进制文件放入你的 PATH:
bun run build
cp dist/opencode-sandbox ~/.local/bin/(bun run install-local 一步完成这两项操作。)或者从此仓库的 GitHub Releases 获取预构建的二进制文件。
Related MCP server: devcontainer-mcp
快速开始
创建一个实例。你 shell 中已有的任何提供商 API 密钥(ANTHROPIC_API_KEY、OPENAI_API_KEY、GOOGLE_GENERATIVE_AI_API_KEY、OPENROUTER_API_KEY)都会在创建时转发到实例中——无需 UI 登录步骤,也无需管理 auth.json。
opencode-sandbox create scratch --seed ./my-project --config ./opencode.jsonc--seed 会在实例首次启动前将目录复制到新的工作区;--config 会为该实例单独放置一个 opencode.jsonc。两者都是可选的。
将其注册到 Claude Code。create 会打印此行,url 稍后可以重新打印:
opencode-sandbox url scratch
claude mcp add --transport http scratch http://127.0.0.1:4784/mcp现在使用它——该实例的 80 个工具(读取、写入、运行 shell 命令,所有操作都限定在其自己的 /workspace 内)在该 Claude Code 会话中可用。完成后:
opencode-sandbox destroy scratch --yesdestroy 会移除容器及其卷,包括工作区。
创建时使用 --web 还可以使用 Web UI;否则,MCP 桥接器是唯一的接口。
安全说明
MCP 桥接器本身没有入站身份验证。任何能够访问其端口的人都可以获得完整的 opencode 工具界面——在该实例的 /workspace 内读写文件和运行 shell 命令。默认情况下,发布的端口绑定到 127.0.0.1;请保持此设置。不要将其放宽到 0.0.0.0,也不要将其放在没有真正认证层的公共反向代理后面。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceRuns isolated AI agents in Docker containers with persistent workspaces and conversation history. Each agent has access to file operations, shell commands, GitHub integration, and can connect to external MCP servers for additional tools.3MIT
- Alicense-qualityAmaintenance45+ first-class, OS and backend specific MCP tools that let AI coding agents create, manage, read, edit, and write files inside dev containers, keeping your machine clean and your environment reproducible and deploy-friendly. Use local Docker, GitHub Codespaces, Azure, AWS, Google Cloud or Kubernetes seamlessly!23MIT
- AlicenseAqualityCmaintenanceEnables code execution in isolated Docker containers with persistent IPython, Node.js, or R kernels, supporting file import/export and cross-session transfers via MCP tools.6MIT
- Flicense-qualityBmaintenanceContainerized MCP server for coding agents with tools for file editing, shell commands, process management, Git, browser automation, and project snapshots.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Hosted MCP server for structured code review passes on human- and AI-written code. Free tier.
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hsb3/opencode-sandbox'
If you have feedback or need assistance with the MCP directory API, please join our Discord server