opencode-mcp-workspace-state
v0.1.1
Published
OpenCode plugin that remembers per-workspace MCP enabled/disabled state and defaults new servers to off.
Readme
opencode-mcp-workspace-state
OpenCode plugin that remembers MCP server toggles per workspace/project and keeps newly seen MCP servers disabled by default.
What it does
- Remembers MCP server on/off state per workspace.
- Reapplies remembered state on startup.
- Defaults any new/unseen MCP server to
enabled: false. - Persists state in:
~/.config/opencode/mcp-workspace-state.json
Installation
No manual install step needed. OpenCode installs published plugins automatically.
Usage
Add the plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-mcp-workspace-state"
]
}On startup, OpenCode will install/update opencode-mcp-workspace-state from npm.
Behavior details
- Workspace key priority:
project.idworktreedirectory
- State is updated when OpenCode emits:
workspace.readymcp.tools.changed
- While OpenCode is open, the plugin also polls MCP status every 4 seconds so UI toggle changes are persisted even when no MCP event is emitted.
Development
npm install
npm test