feat: kubectl-style CLI + Deployment/Pod model #5

Merged
michal merged 1 commits from feat/kubectl-deployment-model into main 2026-02-22 13:39:02 +00:00
Owner

Summary

Refactors the CLI to follow kubectl patterns and introduces a Deployment/Pod model for servers and instances.

Server = Deployment — defines what to run (image, command, env, transport) + desired replicas
Instance = Pod — ephemeral, automatically created/maintained to match the server's replica count

Backend Changes

  • Add replicas field to McpServer (default 1)
  • Add reconcile() to InstanceService — scales instances up/down to match desired replicas
  • Remove manual start/stop/restart endpoints — instances are auto-managed
  • Server delete cascades: stops all containers, then DB cascade
  • Server create/update auto-triggers reconciliation

CLI Changes

  • mcpctl delete <resource> <id> — generic deletion with name resolution
  • mcpctl logs <instance-id> — top-level logs command
  • Remove instance compound command (use get/delete/logs)
  • Clean up project command (list/show/delete → top-level get/describe/delete)
  • describe instance enriched with container inspect info
  • apply supports replicas field in server specs

Key Behaviors

  • Creating a server auto-creates instances (replicas: 1 by default)
  • Deleting an instance triggers reconcile → new instance auto-created
  • Deleting a server cascades → all instances removed
  • replicas: 0 stops all instances without removing the server definition

Test Plan

  • All 595 tests pass (21 mcpd + 24 cli + other packages)
  • Reconcile tests: scale up, scale down, external servers, Docker failures
  • Integration tests: full lifecycle with auto-reconciliation
  • CLI tests: delete, logs, updated e2e command registration

🤖 Generated with Claude Code

## Summary Refactors the CLI to follow kubectl patterns and introduces a Deployment/Pod model for servers and instances. **Server = Deployment** — defines what to run (image, command, env, transport) + desired `replicas` **Instance = Pod** — ephemeral, automatically created/maintained to match the server's replica count ### Backend Changes - Add `replicas` field to McpServer (default 1) - Add `reconcile()` to InstanceService — scales instances up/down to match desired replicas - Remove manual start/stop/restart endpoints — instances are auto-managed - Server delete cascades: stops all containers, then DB cascade - Server create/update auto-triggers reconciliation ### CLI Changes - `mcpctl delete <resource> <id>` — generic deletion with name resolution - `mcpctl logs <instance-id>` — top-level logs command - Remove `instance` compound command (use `get`/`delete`/`logs`) - Clean up `project` command (list/show/delete → top-level `get`/`describe`/`delete`) - `describe instance` enriched with container inspect info - `apply` supports `replicas` field in server specs ### Key Behaviors - Creating a server auto-creates instances (replicas: 1 by default) - Deleting an instance triggers reconcile → new instance auto-created - Deleting a server cascades → all instances removed - `replicas: 0` stops all instances without removing the server definition ## Test Plan - [x] All 595 tests pass (21 mcpd + 24 cli + other packages) - [x] Reconcile tests: scale up, scale down, external servers, Docker failures - [x] Integration tests: full lifecycle with auto-reconciliation - [x] CLI tests: delete, logs, updated e2e command registration 🤖 Generated with [Claude Code](https://claude.com/claude-code)
michal added 1 commit 2026-02-22 13:31:19 +00:00
feat: kubectl-style CLI + Deployment/Pod model for servers/instances
Some checks failed
CI / lint (pull_request) Has been cancelled
CI / typecheck (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / package (pull_request) Has been cancelled
467357c2c6
Server = Deployment (defines what to run + desired replicas)
Instance = Pod (ephemeral, auto-created by reconciliation)

Backend:
- Add replicas field to McpServer schema
- Add reconcile() to InstanceService (scales instances to match replicas)
- Remove manual start/stop/restart - instances are auto-managed
- Cascade: deleting server stops all containers then cascades DB
- Server create/update auto-triggers reconciliation

CLI:
- Add top-level delete command (servers, instances, profiles, projects)
- Add top-level logs command
- Remove instance compound command (use get/delete/logs instead)
- Clean up project command (list/show/delete → top-level get/describe/delete)
- Enhance describe for instances with container inspect info
- Add replicas to apply command's ServerSpec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
michal merged commit 72643fceda into main 2026-02-22 13:39:02 +00:00
michal deleted branch feat/kubectl-deployment-model 2026-02-22 13:39:03 +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#5