feat: mcpctl provider {enable,disable} — persistent on/off switch #74
Reference in New Issue
Block a user
Delete Branch "feat/provider-disable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds persistent disable/enable on top of the v7 lifecycle CLI (
up/down/status).Use case: vLLM keeps crashing on engine init.
downworks for "now"but the next chat re-spawns it.
disablewritesdisabled: trueintothe provider's entry in
~/.mcpctl/config.jsonand short-circuitscomplete()/ensureRunning()until youenable.enableis live — the provider stays in the registry while disabled,so flipping the flag back is enough; no mcplocal restart needed.
Test plan
mcpctl provider disable vllm-localwrites the config flag,downsemantics applied, GPU releasedmcpctl chat-llm vllm-localerrors with "provider is disabled" instead of restarting vllmsystemctl --user restart mcplocalfollowed by status — still shows(disabled)mcpctl provider enable vllm-localclears it; next chat works🤖 Generated with Claude Code
Adds two new subcommands on top of v7's provider lifecycle CLI: mcpctl provider disable vllm-local # release GPU + survive restart mcpctl provider enable vllm-local # clear the flag, ready to chat Use case: vLLM keeps crashing on engine init. `down` works for "now" but the next chat triggers a restart; `disable` writes `disabled: true` into the provider's entry in ~/.mcpctl/config.json and short-circuits complete()/ensureRunning() until you re-enable. Implementation: - LlmProviderEntry / LlmProviderFileEntry: new optional `disabled` field - ManagedVllmProvider: setDisabled(bool), isDisabled(), gate in complete()/ensureRunning(), expose `disabled` in getStatus() - mcplocal HTTP: POST /llm/providers/:name/{disable,enable} write the config file and apply the change live; /start returns 409 when the target is disabled instead of silently failing - Boot: createSingleProvider honors `entry.disabled` so a known-bad vLLM doesn't auto-start on the first chat after mcplocal restart - CLI: `disable` / `enable` subcommands on `mcpctl provider`; status output now shows `(disabled)` next to the state `enable` is live — provider stays in the registry while disabled, so flipping the flag back is enough; no mcplocal restart needed. Tests: cli 437/437, mcplocal 731/731. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>