Skip to content

feat(mcp): enable/disable configured MCP servers#46

Merged
mudler merged 3 commits into
masterfrom
feat/mcp-server-enable-disable
Jul 4, 2026
Merged

feat(mcp): enable/disable configured MCP servers#46
mudler merged 3 commits into
masterfrom
feat/mcp-server-enable-disable

Conversation

@localai-bot

@localai-bot localai-bot commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

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, matching GetMCPServer/RemoveMCPServer.
  • MCPServerInfo.Enabled (= !Disabled) — ListMCPServers returns 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> — mirrors nib plugin enable|disable / nib skill enable|disable (previously nib mcp had only add|list|remove|test).
  • nib mcp list appends (disabled) to disabled servers; enabled-server output is unchanged.

Testing

  • go test ./..., go build ./..., go vet ./..., gofmt — green.
  • Unit tests: SetMCPServerEnabled toggle lifecycle + unknown-name error + listing projection; enabledMCPServers drop/keep/no-mutation/nil→nil; CLI mcp enable|disable exit codes + list disabled marker.
  • Verified round-trip: disable → persist YAML → config.Load reload → excluded from EffectiveConfig; re-enable writes no disabled: key (omitempty).

Integrator note (nib-desktop)

EffectiveConfig reads config.Load() (from config.WritablePath()), so SetMCPServerEnabled's write is reflected only when the Configurator is built with New(base, config.WritablePath()) — the same pre-existing seam as AddMCPServer/RemoveMCPServer, already how the desktop constructs it.

🤖 Generated with Claude Code

@mudler mudler merged commit 48f34f5 into master Jul 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants