Opencode Workbench

io.github.simonmak-ascentv2.0.0更新于 Oct 2, 2026

Provision an OpenCode workbench and MCP stack on any Linux box, local or over SSH.

已验证Streamable HTTP可网页运行Developer ToolsCloud & Infrastructure

概览

AI 生成的概览

一个 MCP 服务器,可检查 Linux 机器并在本地或通过 SSH 将预配置的 OpenCode 开发工作台克隆到该机器上。

功能
它把完整的 OpenCode 工作站配置部署到 Linux 机器上,目标可以是本机,也可以是通过 SSH 访问的远程主机。流程分阶段进行:inspect_target、plan_clone、apply_clone 和 verify_clone。apply_clone 需要确认,未提供 confirm:true 时只返回计划,列出组件和特权命令预览。list_required_credentials 工具会报告目标机器还缺哪些密钥;克隆对密钥缺失有容错:没有模型密钥时仍可在免费层启动,凭据缺失的 MCP 服务器会被禁用并报告。
适用场景
当你需要在另一台 Linux 机器上复现一套有文档记录的 OpenCode 开发环境,或在构建机丢失后重建环境、又不想重复手工配置时使用。它适合已将该工作台仓库作为配置唯一来源、并希望运行时与之一致的用户。
运行要求
需要一个 Linux 目标机,可以是本机,或可通过 SSH 访问的主机(需提供主机与用户)。服务器以本地 stdio 进程方式通过 npx 运行该 npm 包,也可作为远程端点使用。未声明身份验证。克隆出的环境所需凭据由用户另行提供;连接器只写入一个空的环境变量模板,不读取也不传输密钥值。
安装前请注意
apply_clone 会在目标机器上安装软件并执行特权命令,确认前应先查看返回的计划。该工作台配置涉及大量第三方凭据,包括 DEEPSEEK_API_KEY、OPENCODE_API_KEY、SIMONPLMAK_CLOUD_PAT、PERPLEXITY_API_KEY、BRAVE_API_KEY、BROWSERLESS_TOKEN、SENTRY_AUTH_TOKEN 和 VERCEL_ACCESS_TOKEN,以及 STRIPE_SECRET_KEY、CLOUDFLARE_API_TOKEN 等可选密钥,这些凭据可访问付费或敏感服务。SSH 模式会操作远程主机,请确认主机和用户正是预期的目标。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Opencode Workbench,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "opencode-workbench": {
      "type": "http",
      "url": "https://opencode-workbench.simonmak.com/mcp"
    }
  }
}

README

OpenCode Workbench

[Secret Scan] [License: MIT] [MCP Server] [Validate Documentation] [MCP Tool Definition Quality]

A reproducible, self-documenting, and recoverable OpenCode development workstation — configuration, agent skills, MCP stack, and an MCP server that clones the entire setup onto any Linux machine (locally or over SSH).

Purpose

This repository is the single source of truth for a complete cloud development workstation. Everything needed to rebuild from scratch is versioned here:

  • Workstation configuration and automation
  • OpenCode configuration (model, providers, MCP servers)
  • Agent skills (45 reusable AI instructions across research, dev, data, science and ops)
  • Operational prompts (disaster recovery, backup, security)
  • Recovery procedures (playbook, checklist, gap analysis)
  • Security governance (secret management, threat model)
  • opencode-workbench — an MCP server that installs this profile on any Linux box

No important knowledge exists only in human memory.

Clone This Workbench to Another Linux Machine

Register the MCP server with OpenCode:

json
{  "mcp": {    "opencode-workbench": {      "type": "local",      "command": ["npx", "-y", "@simonmak-ascent/opencode-workbench"],      "enabled": true,      "timeout": 600000    }  }}

Then ask the agent to run inspect_target → plan_clone → apply_clone { confirm: true } → verify_clone, for { "mode": "local" } or { "mode": "ssh", "host": "<your-box>", "user": "<your-user>" }. apply_clone is consent-gated: without confirm:true it returns a plan (components + privileged-command preview) and changes nothing. Run list_required_credentials to see which keys the box still needs and how to acquire them, and bash scripts/selftest/run-selftest.sh to verify it works. See mcp-server/README.md and docs/architecture/clone-mcp.md.

The clone is key-resilient: with no model key it still boots on the OpenCode Zen free floor, and MCP servers whose credentials are absent are disabled and reported (not left to fail at runtime).

The connector never reads or transmits secret values; it writes an empty ~/.env.workbench template for you to fill in.

Quick Start

bash
# Create a new build boxgh SWAS create --repo simonmak-ascent/opencode-workbench --machine basicLinux32gb
# Wait for postCreate (3-5 min) — installs everything automatically# Then start coding:opencode

Architecture

opencode-workbench/├── mcp-server/                     # opencode-workbench: clone this profile onto Linux│   ├── src/                        # inspect / plan / apply / verify, local + SSH│   ├── test/                       # unit tests (vitest)│   └── README.md├── connector.json                  # MCP connector manifest / registration snippet├── plugins/                        # memory.ts + doc-tools.ts OpenCode plugins├── package.json                    # thin launcher for opencode-workbench (bin + prepare)├── .devcontainer/                  # build box definition & bootstrap│   ├── devcontainer.json           # Container image, features, ports, remoteEnv│   ├── setup.sh                    # Post-create: installs opencode, MCPs, Docker infra│   └── aliases.sh                  # Shell aliases sourced at runtime├── .opencode/│   └── skills/                     # 28 custom agent skills (10 research, 10 dev, 8 publishing)├── vendor/                         # Vendored MCP source code│   ├── perplexity-agent-mcp/│   └── browserless-mcp/├── configs/                        # Reference configurations│   ├── mcp/                        # MCP server inventory & architecture│   ├── opencode/                   # OpenCode settings documentation│   ├── shell/                      # Shell configuration│   ├── git/                        # Git configuration & hooks│   └── providers/                  # AI provider configuration├── docs/                           # Complete documentation system│   ├── WORKBENCH_CHARTER.md        # Governance: mission, principles, requirements│   ├── security-model.md           # Security architecture & threat model│   ├── IMPROVEMENT_BACKLOG.md      # Tracked improvements and fixes│   ├── CHANGELOG_WORKBENCH.md      # Append-only change history│   ├── architecture/               # System documentation (incl. clone-mcp.md)│   ├── recovery/                   # Recovery procedures (4 docs)│   ├── prompts/                    # Operational prompt library (9 prompts)│   └── backup-reports/             # Dated backup snapshots├── scripts/                        # Automation scripts│   ├── backup/                     # Master backup script│   ├── inventory/                  # Auto-generate inventories (software, env, MCP, OpenCode)│   ├── security/                   # Secret pattern scanner│   ├── recovery/                   # Recovery validation│   └── maintenance/                # Config sync, routine tasks├── .github/workflows/              # CI (docs, inventory, gitleaks, mcp-server)├── opencode.json                   # OpenCode configuration (MCP servers)├── AGENTS.md                       # OpenCode agent instructions└── README.md                       # This file

What's Inside

CategoryDetails
OpenCodeLatest stable CLI, DeepSeek V4 Pro model, LSP enabled
MCP Servers35 configured (33 enabled, 2 disabled), 9 remote + 26 local
Agent Skills45 reusable skills in .opencode/skills/
InfrastructurePostgreSQL 16 (Docker), Browserless Chromium (Docker)
Toolspandoc, jq, miller, sqlite3, GitHub CLI, Playwright Chromium
Prompts9 operational prompts in docs/prompts/

Workstation Governance

This workstation operates under a formal charter. Key principles:

  • Single Source of Truth: Runtime must match repository. Drift is a bug.
  • Secrets Never Touch Disk: All secrets flow through the build box Secrets.
  • Immutable History: Changelog is append-only. Every change is traceable.
  • Documentation Lives With Code: Docs describe the system as it is, not as imagined.

Read the full charter: docs/WORKBENCH_CHARTER.md

Backup Workflow

bash
# Master backup — full inventory, security scan, commit prepbash scripts/backup/run-master-backup.sh
# Quick backup — save state before risky operationsbash scripts/maintenance/sync-runtime-config.sh && \  git diff > /tmp/quick-backup-$(date +%Y%m%d).diff

Or use OpenCode prompts:

  • docs/prompts/RUN_MASTER_BACKUP.md — execute backup via AI
  • docs/prompts/QUICK_BACKUP.md — rapid state preservation

Recovery Workflow

Assume the build box is deleted. Only Git repo + build box Secrets survive.

bash
# 1. Create new build boxgh SWAS create --repo simonmak-ascent/opencode-workbench --machine basicLinux32gb
# 2. Wait for automation (3-5 min)
# 3. If needed (usually done by setup.sh):npx playwright install chromium# Vercel MCP uses VERCEL_ACCESS_TOKEN (token auth — no OAuth step)
# 4. Validate recoverybash scripts/recovery/validate-recovery.sh

Full details: docs/recovery/RECOVERY_PLAYBOOK.md

MCP Architecture

TypeCountNotes
Remote9context7, gh_grep, vdd, exa, cloudflare, clerk, vercel (token auth), sentry, stripe
Local26npm / vendored / binary stdio servers

Totals: 35 configured (33 enabled, 2 disabled: google-search, google-workspace).

See: docs/architecture/mcp-inventory.md

Secrets Management

All secrets stored in the build box Secrets. Never in repository files.

#SecretUsed By
1DEEPSEEK_API_KEYOpenCode (primary model)
2OPENCODE_API_KEYOpenCode Zen / Console Go providers
3SIMONPLMAK_CLOUD_PATGitHub MCP, shadcn MCP, gh
4PERPLEXITY_API_KEYPerplexity MCP
5BRAVE_API_KEYBrave Search MCP
6BROWSERLESS_TOKENBrowserless MCP + container
7SENTRY_AUTH_TOKENSentry MCP
8VERCEL_ACCESS_TOKENVercel MCP (token auth)

Additional keys for opt-in servers (EXA_API_KEY, CLOUDFLARE_API_TOKEN, STRIPE_SECRET_KEY, SURREAL_*, ALIBABA_CLOUD_*, AZURE_*, FIRECRAWL_API_KEY, FRED_API_KEY, COMPANIES_HOUSE_API_KEY) are catalogued in docs/architecture/secrets.md — never by value.

See: docs/architecture/secrets.md

Documentation Index

DocumentPurpose
docs/WORKBENCH_CHARTER.mdMission, principles, governance
docs/security-model.mdSecurity architecture, threat model, incident response
docs/IMPROVEMENT_BACKLOG.mdTracked improvements and technical debt
docs/CHANGELOG_WORKBENCH.mdComplete change history
docs/architecture/System documentation (10 inventory docs)
docs/recovery/Recovery playbook, disaster recovery, checklist, gap analysis
docs/prompts/9 operational prompts with index
docs/backup-reports/Dated backup snapshots

Adding to the Workbench

  1. MCP Server: Add npm package to .devcontainer/setup.sh, add to opencode.json, document in docs/architecture/mcp-inventory.md
  2. Agent Skill: Create .opencode/skills/<name>/SKILL.md, follow naming convention
  3. Tool: Add to scripts/bootstrap-tools.sh
  4. Prompt: Create in docs/prompts/, update prompt-index.md
  5. After any change: Update CHANGELOG_WORKBENCH.md, run master backup

Recovery Score: 94/100

Validated disaster recovery within < 10 minutes using repository + build box Secrets alone.

Use with Context7

Up-to-date OpenCode Workbench documentation is indexed on Context7, so coding agents can pull it into context on demand. With the Context7 MCP server or ctx7 CLI installed, name the library in your prompt:

text
use library /simonmak-ascent/opencode-workbench for API and docs

License

MIT — see LICENSE.


A tool by Simon Mak.

If this saves you time, a ⭐ on GitHub helps others find it.

来源:README.md,提交 091e373

工具

0
工具元数据尚未被收录。

版本历史

1
  1. v2.0.0最新Oct 2, 2026