MCP SERVER

OPENCODE-CONFIG

Full lifecycle management for IDE configuration — servers, agents, permissions, plugins, commands, and instructions through validated tool calls.

36
Tools
8
Config domains
9
Rot categories detected
v2
Export bundle format
TOOLS
ToolPurposeReturns
diagnoseAssess workspace against the ecosystem manifest — repos cloned, deps installed, servers registered. Findings sorted by severity with actionable fix commands.Findings array, tier stats, severity summary
sanitizeDetect and remove config rot — dead servers, orphaned permissions, phantom agents, broken symlinks, stale instructions, duplicates. Dry-run by default.Rot inventory by category, cleanup results
showFull resolved config — opencode.json, agents, plugins, servers. The complete picture in one call.Merged config object with all sources
validateStructural validation of opencode.json with path existence checks for plugins, servers, and instruction files.Validation results, path existence flags
ensure_localAudit global vs project config sources. Surface settings that differ between teammates due to personal global configs.Per-level config contributions, divergences
list_serversList all MCP servers with enabled/disabled status, type, and commandServer entries with metadata
add_serverAdd a new server entry (local or remote). Also creates the corresponding permission rule automatically.Server entry, permission created
update_serverMerge-update server fields — command, url, environment, enabled, type. Null values in environment remove individual keys.Updated server entry
remove_serverRemove a server entry and its permission rule in one operationRemoval confirmation
enable_serverEnable a disabled server without touching other fieldsUpdated status
disable_serverDisable a server without removing it from configUpdated status
list_agentsList all agents from opencode.json and .opencode/agents/ with status, mode, and color. Merges both sources.Agent entries with source attribution
get_agentRead a single agent's full content — config entry, YAML frontmatter, and prompt body.Agent config, frontmatter, body text
set_agentCreate or update an agent — writes .opencode/agents/{name}.md with YAML frontmatter for model, mode, color, temperature, steps.File path, frontmatter written
set_default_agentSet the default_agent field in opencode.jsonUpdated config value
enable_agentRe-enable a disabled agent by removing the disable flagUpdated status
disable_agent[object Object]Updated status
remove_agentDelete the agent .md file and config block. Clears default_agent if matchedRemoval confirmation
list_permissionsList all permission rules from opencode.jsonPermission entries with patterns and values
set_permissionSet a permission rule — pattern (e.g. bash, scout_*) to allow, deny, or ask. Supports nested sub-patterns for bash commands.Updated permission entry
remove_permissionRemove a permission rule. Returns the previous value for confirmationPrevious value, removal confirmation
list_commandsList all slash commands from .opencode/commands/Command entries with descriptions
get_commandRead a single command's description and instruction bodyCommand frontmatter and body
set_commandCreate or update a slash command — writes .opencode/commands/{name}.md with instructions injected on trigger.File path, command registered
remove_commandDelete a slash command fileRemoval confirmation
list_pluginsList all registered plugins — directory entries from plugin array and individual files from .opencode/plugins/. Shows symlink status and hook inventory.Plugin entries with symlink targets, hooks
add_pluginRegister a plugin directory in opencode.json. Validates path existsRegistration confirmation
unregister_pluginRemove a plugin directory from opencode.json. Does not delete filesRemoval confirmation
link_pluginSymlink a plugin .ts file from a repo into .opencode/plugins/. Idempotent — re-linking same target is a no-op.Link path, target, status
unlink_pluginRemove a plugin symlink. Source file in its repo is preservedRemoval confirmation
list_instructionsList all instruction files from opencode.json with existence checkInstruction paths with exists flags
add_instructionAdd an instruction file to the instructions array. Validates file existsUpdated instructions array
remove_instructionRemove an instruction file from the arrayRemoval confirmation
set_configSet a config value by dotted path (e.g. compaction.auto, model). Rejects invalid JSON, blocks writes to managed sections.Updated config value
export_configExport full config as a portable v2 bundle — config, agents, commands, instruction contents, plugin symlink metadata.Bundle path, counts per category
import_configImport a config bundle. Supports dry-run preview, overwrite control, backward-compatible with v1 bundles.Import results, per-category counts
CONFIG LIFECYCLE
The bootstrap problem

An MCP server ecosystem needs configuration to run — but the configuration itself is complex. opencode.json manages servers, agents, permissions, plugins, commands, and instructions across multiple file locations. Manual editing is error-prone: a typo in a server command silently breaks it, a removed repo leaves orphaned permissions, a disabled agent accumulates dead config. opencode-config replaces manual editing with validated, atomic tool calls that enforce consistency across all config surfaces.

Eight domains, one surface

Configuration is scattered across opencode.json (servers, permissions, general settings), .opencode/agents/ (agent .md files with YAML frontmatter), .opencode/commands/ (slash command definitions), .opencode/plugins/ (symlinked plugin files), and the plugin array (directory-based plugins). Each domain has its own CRUD tools, but they all operate through the same shared config I/O layer — readConfig/writeConfig with atomic JSON serialization and 2-space indent normalization.

Diagnose

The manifest.yaml file declares the entire ecosystem — every server, its tier, repo URL, entry file, and dependencies. diagnose walks this manifest against the actual workspace state. Missing repos, uninstalled dependencies, unregistered servers, disabled core tools — each finding comes with a severity level and an actionable fix command. The /setup command runs diagnose as its first step.

Sanitize

Config rot accumulates silently. A server repo gets deleted but its config entry stays. An agent gets disabled but its .md file lingers. A plugin symlink points to a moved file. Sanitize detects nine categories of rot — stale servers, orphaned permissions, phantom agents, broken symlinks, stale instructions, duplicates, missing permissions, dead servers, and disabled agent files. Dry-run by default so you see the rot before cleaning it.

Export / Import

A v2 bundle captures the full config state — opencode.json, agent files with frontmatter and prompts, command definitions, instruction file contents, plugin symlink metadata, and a server manifest. Import reconstructs everything on a fresh machine, recreating symlinks when targets exist on disk. Backward-compatible with v1 bundles. Dry-run preview before applying.

INTEGRATION
Upstream
What opencode-config depends on

mcp-helpers — server bootstrap, workspace() resolution, and the respond/error response helpers shared by all servers. yaml — parses the ecosystem manifest.yaml that diagnose walks. zod — parameter validation for all 36 tools. No runtime dependency on other MCP servers. opencode-config reads opencode.json directly from disk.

Downstream
What depends on opencode-config

Every MCP server is registered and managed through opencode-config's server tools. The /setup onboarding command uses diagnose to assess workspace health and add_server to register missing servers. plugin-builder scaffolds plugin files that opencode-config then symlinks into .opencode/plugins/ via link_plugin. The manifest.yaml is the ecosystem's source of truth — other tools reference it for server metadata.

The server that configures the servers that configure the servers.