feat: mcpctl provider {enable,disable} — persistent on/off switch #74

Merged
michal merged 1 commits from feat/provider-disable into main 2026-05-03 14:57:23 +00:00
Owner

Summary

Adds persistent disable/enable on top of the v7 lifecycle CLI (up/down/status).

mcpctl provider disable vllm-local   # release GPU + survive mcplocal restart
mcpctl provider enable  vllm-local   # clear the flag, next chat starts it

Use case: vLLM keeps crashing on engine init. down works for "now"
but the next chat re-spawns it. disable writes disabled: true into
the provider's entry in ~/.mcpctl/config.json and short-circuits
complete() / ensureRunning() until you enable.

enable is live — the provider stays in the registry while disabled,
so flipping the flag back is enough; no mcplocal restart needed.

Test plan

  • cli unit tests pass (437/437)
  • mcplocal unit tests pass (731/731)
  • completions regenerated
  • After deploy: mcpctl provider disable vllm-local writes the config flag, down semantics applied, GPU released
  • mcpctl chat-llm vllm-local errors with "provider is disabled" instead of restarting vllm
  • systemctl --user restart mcplocal followed by status — still shows (disabled)
  • mcpctl provider enable vllm-local clears it; next chat works

🤖 Generated with Claude Code

## Summary Adds persistent disable/enable on top of the v7 lifecycle CLI (`up`/`down`/`status`). ``` mcpctl provider disable vllm-local # release GPU + survive mcplocal restart mcpctl provider enable vllm-local # clear the flag, next chat starts it ``` Use case: vLLM keeps crashing on engine init. `down` works for "now" but the next chat re-spawns it. `disable` writes `disabled: true` into the provider's entry in `~/.mcpctl/config.json` and short-circuits `complete()` / `ensureRunning()` until you `enable`. `enable` is live — the provider stays in the registry while disabled, so flipping the flag back is enough; no mcplocal restart needed. ## Test plan - [x] cli unit tests pass (437/437) - [x] mcplocal unit tests pass (731/731) - [x] completions regenerated - [ ] After deploy: `mcpctl provider disable vllm-local` writes the config flag, `down` semantics applied, GPU released - [ ] `mcpctl chat-llm vllm-local` errors with "provider is disabled" instead of restarting vllm - [ ] `systemctl --user restart mcplocal` followed by status — still shows `(disabled)` - [ ] `mcpctl provider enable vllm-local` clears it; next chat works 🤖 Generated with [Claude Code](https://claude.com/claude-code)
michal added 1 commit 2026-05-03 14:57:14 +00:00
feat(cli+mcplocal): persistent provider disable/enable
Some checks failed
CI/CD / lint (pull_request) Successful in 55s
CI/CD / test (pull_request) Successful in 1m11s
CI/CD / typecheck (pull_request) Successful in 3m20s
CI/CD / smoke (pull_request) Failing after 52s
CI/CD / build (pull_request) Successful in 3m59s
CI/CD / publish (pull_request) Has been skipped
d04adb5623
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>
michal merged commit f8aa6c2f0d into main 2026-05-03 14:57:23 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: michal/mcpctl#74