OpenCode Workbench
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).

Homepage & remote MCP: https://opencode-workbench.simonmak.com ยท POST https://opencode-workbench.simonmak.com/mcp
Overview
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 sandbox (bubblewrap) โ run the agent with a read-only system and no secret mounts
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:
{
"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 (โค 5 minutes)
Fastest path: no box required โ register the MCP server with
npx -y @simonmak-ascent/opencode-workbench (config in
Clone This Workbench); or provision a fresh box:
gh SWAS create --repo simonmak-ascent/opencode-workbench --machine basicLinux32gb
opencode
Architecture
flowchart TB
AGENT["OpenCode agent"] -->|"npx @simonmak-ascent/opencode-workbench"| MCP["opencode-workbench MCP<br/>inspect ยท plan ยท apply ยท verify"]
REPO[("Git repo โ single source of truth")] --> MCP
MCP -->|"local or SSH"| BOX["Target Linux box"]
BOX --> PROF["Workstation profile<br/>OpenCode CLI ยท 35 MCP servers ยท 45 skills ยท Docker infra"]
Clone lifecycle
apply_clone is consent-gated: without confirm: true it returns a plan and changes nothing.
sequenceDiagram
autonumber
participant A as OpenCode agent
participant M as opencode-workbench MCP
participant B as Target box (local or SSH)
A->>M: inspect_target
M-->>A: OS, toolchain, Docker, existing config
A->>M: plan_clone
M-->>A: components + privileged-command preview
A->>M: apply_clone { confirm: true }
M->>B: install components ยท write ~/.env.workbench template
B-->>M: result
A->>M: verify_clone
M-->>A: pass/fail + missing credentials
flowchart LR
A["OpenCode agent"] --> D["Discovery<br/>describe_workbench ยท inspect_target"]
A --> C["Clone<br/>plan_clone ยท apply_clone ยท verify_clone"]
A --> K["Components<br/>install ยท remove ยท update_component"]
A --> S["Credentials<br/>list_required_credentials ยท run_auth_flow"]
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
| Category | Details |
|---|
| OpenCode | Latest stable CLI, DeepSeek V4 Pro model, LSP enabled |
| MCP Servers | 35 configured (33 enabled, 2 disabled), 9 remote + 26 local |
| Agent Skills | 45 reusable skills in .opencode/skills/ |
| Infrastructure | PostgreSQL 16 (Docker), Browserless Chromium (Docker) |
| Tools | pandoc, jq, miller, sqlite3, GitHub CLI, Playwright Chromium |
| Prompts | 9 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 scripts/backup/run-master-backup.sh
bash 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.
gh SWAS create --repo simonmak-ascent/opencode-workbench --machine basicLinux32gb
npx playwright install chromium
bash scripts/recovery/validate-recovery.sh
Full details: docs/recovery/RECOVERY_PLAYBOOK.md
MCP Architecture
| Type | Count | Notes |
|---|
| Remote | 9 | context7, gh_grep, vdd, exa, cloudflare, clerk, vercel (token auth), sentry, stripe |
| Local | 26 | npm / 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.
| # | Secret | Used By |
|---|
| 1 | DEEPSEEK_API_KEY | OpenCode (primary model) |
| 2 | OPENCODE_API_KEY | OpenCode Zen / Console Go providers |
| 3 | SIMONMAK_ASCENT_PAT | GitHub MCP, shadcn MCP, gh |
| 4 | PERPLEXITY_API_KEY | Perplexity MCP |
| 5 | BRAVE_API_KEY | Brave Search MCP |
| 6 | BROWSERLESS_TOKEN | Browserless MCP + container |
| 7 | SENTRY_AUTH_TOKEN | Sentry MCP |
| 8 | VERCEL_ACCESS_TOKEN | Vercel 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
| Document | Purpose |
|---|
docs/WORKBENCH_CHARTER.md | Mission, principles, governance |
docs/security-model.md | Security architecture, threat model, incident response |
docs/IMPROVEMENT_BACKLOG.md | Tracked improvements and technical debt |
docs/CHANGELOG_WORKBENCH.md | Complete 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
- MCP Server: Add npm package to
.devcontainer/setup.sh, add to opencode.json, document in docs/architecture/mcp-inventory.md
- Agent Skill: Create
.opencode/skills/<name>/SKILL.md, follow naming convention
- Tool: Add to
scripts/bootstrap-tools.sh
- Prompt: Create in
docs/prompts/, update prompt-index.md
- 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:
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.