feat: mcpctl provider <name> {up,down,status} for managed LLMs #73

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

Summary

Lifecycle control for managed local LLM providers without restarting
mcplocal (which would drop the SSE connection to mcpd and force every
virtual Llm to re-publish).

mcpctl provider vllm-local down    # release GPU memory now
mcpctl provider vllm-local up      # warm up before the next chat
mcpctl provider vllm-local status  # state, pid, uptime

mcplocal exposes three endpoints:

  • GET /llm/providers/:name/status
  • POST /llm/providers/:name/start
  • POST /llm/providers/:name/stop

up/down return 400 for non-managed providers (anthropic, openai,
gemini-cli) — stopping an API-key provider is meaningless. status
returns { managed: false } for them so introspection still works.

enable/disable (persistent across mcplocal restarts) is deferred —
needs a disabled flag on the config schema, which is a bigger change.

Test plan

  • cli unit tests pass (437/437)
  • mcplocal unit tests pass (731/731)
  • completions regenerated and pass freshness check
  • After RPM rebuild + mcplocal restart, mcpctl provider vllm-local status returns running state
  • mcpctl provider vllm-local down releases GPU memory (verify with nvidia-smi)
  • mcpctl provider vllm-local up brings it back, next chat works
  • mcpctl provider anthropic up returns the "not managed" 400

🤖 Generated with Claude Code

## Summary Lifecycle control for managed local LLM providers without restarting mcplocal (which would drop the SSE connection to mcpd and force every virtual Llm to re-publish). ``` mcpctl provider vllm-local down # release GPU memory now mcpctl provider vllm-local up # warm up before the next chat mcpctl provider vllm-local status # state, pid, uptime ``` mcplocal exposes three endpoints: - `GET /llm/providers/:name/status` - `POST /llm/providers/:name/start` - `POST /llm/providers/:name/stop` `up`/`down` return 400 for non-managed providers (anthropic, openai, gemini-cli) — stopping an API-key provider is meaningless. `status` returns `{ managed: false }` for them so introspection still works. `enable`/`disable` (persistent across mcplocal restarts) is deferred — needs a `disabled` flag on the config schema, which is a bigger change. ## Test plan - [x] cli unit tests pass (437/437) - [x] mcplocal unit tests pass (731/731) - [x] completions regenerated and pass freshness check - [ ] After RPM rebuild + mcplocal restart, `mcpctl provider vllm-local status` returns running state - [ ] `mcpctl provider vllm-local down` releases GPU memory (verify with `nvidia-smi`) - [ ] `mcpctl provider vllm-local up` brings it back, next chat works - [ ] `mcpctl provider anthropic up` returns the "not managed" 400 🤖 Generated with [Claude Code](https://claude.com/claude-code)
michal added 1 commit 2026-04-29 14:59:07 +00:00
feat(cli+mcplocal): mcpctl provider <name> {up,down,status} for managed LLMs
Some checks failed
CI/CD / typecheck (pull_request) Successful in 57s
CI/CD / test (pull_request) Successful in 1m23s
CI/CD / lint (pull_request) Successful in 3m1s
CI/CD / smoke (pull_request) Failing after 1m47s
CI/CD / build (pull_request) Successful in 5m58s
CI/CD / publish (pull_request) Has been skipped
356cbe87b5
Adds lifecycle control for managed local LLM providers (vllm-managed)
without the nuclear option of restarting mcplocal. Practical use:

  mcpctl provider vllm-local down    # release GPU memory now
  mcpctl provider vllm-local up      # warm up before the next chat
  mcpctl provider vllm-local status  # see state, pid, uptime

mcplocal exposes three new endpoints:

  GET  /llm/providers/:name/status   → returns lifecycle state for
                                       managed providers, { managed: false }
                                       for unmanaged (anthropic, openai, …)
  POST /llm/providers/:name/start    → calls warmup() (202 + initial state)
  POST /llm/providers/:name/stop     → calls dispose() (200 + post-stop state)

Stop and start return 400 for non-managed providers — stopping an API-key
provider is meaningless. The CLI surfaces the error verbatim.

Restarting mcplocal would also free the GPU but drops the SSE connection
to mcpd and forces every virtual Llm to re-publish; this is the targeted,
non-disruptive escape hatch.

The completions test gained a `topLevelMarkers` filter so a sub-command
named `status` (under `provider`) doesn't trip the existing "non-project
commands must guard with __mcpctl_has_project" rule.

Tests: cli 437/437, mcplocal 731/731.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
michal merged commit fe27947f80 into main 2026-05-03 14:40:57 +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#73