feat(mcp): enable/disable configured MCP servers#46
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the ability to disable a configured MCP server in place, without removing it — the engine-side foundation for a per-server enable/disable toggle in the Dante Desktop UI (mirroring how plugins/skills already toggle), plus the matching CLI verbs.
Config / API
types.MCPServer.Disabled bool(yaml:"disabled,omitempty") — an absent field reads as enabled, so existing configs and previously-added servers stay on with no migration.Configurator.SetMCPServerEnabled(name, enabled) error— toggles the flag in the user config file; errors on unknown name, matchingGetMCPServer/RemoveMCPServer.MCPServerInfo.Enabled(= !Disabled) —ListMCPServersreturns all servers with their state.EffectiveConfig()drops disabled servers from.MCPServers, so a disabled server starts no transport, while the listing still shows it.This cleanly separates "what to show" (
ListMCPServers, all servers) from "what to run" (EffectiveConfig, enabled only).CLI
nib mcp enable <name>/nib mcp disable <name>— mirrorsnib plugin enable|disable/nib skill enable|disable(previouslynib mcphad onlyadd|list|remove|test).nib mcp listappends(disabled)to disabled servers; enabled-server output is unchanged.Testing
go test ./...,go build ./...,go vet ./...,gofmt— green.SetMCPServerEnabledtoggle lifecycle + unknown-name error + listing projection;enabledMCPServersdrop/keep/no-mutation/nil→nil; CLImcp enable|disableexit codes +listdisabled marker.config.Loadreload → excluded fromEffectiveConfig; re-enable writes nodisabled:key (omitempty).Integrator note (nib-desktop)
EffectiveConfigreadsconfig.Load()(fromconfig.WritablePath()), soSetMCPServerEnabled's write is reflected only when theConfiguratoris built withNew(base, config.WritablePath())— the same pre-existing seam asAddMCPServer/RemoveMCPServer, already how the desktop constructs it.🤖 Generated with Claude Code