fix: error handling and --force flag for create commands #10

Merged
michal merged 1 commits from fix/create-error-handling into main 2026-02-22 23:06:53 +00:00
Owner

Summary

  • Clean error messages instead of stack traces on API errors
  • --force flag on create server/secret/project to update if already exists
  • Strip null values from template fields when using --from-template
  • 6 new tests covering 409 handling, --force, and null-stripping

Test plan

  • 196 CLI tests pass (13 create tests, up from 7)
  • Verified: mcpctl create secret x → clean "already exists" message
  • Verified: mcpctl create secret x --force → updates existing
  • Verified: mcpctl create server y --from-template=grafana --env ... works
## Summary - Clean error messages instead of stack traces on API errors - `--force` flag on create server/secret/project to update if already exists - Strip null values from template fields when using --from-template - 6 new tests covering 409 handling, --force, and null-stripping ## Test plan - [x] 196 CLI tests pass (13 create tests, up from 7) - [x] Verified: `mcpctl create secret x` → clean "already exists" message - [x] Verified: `mcpctl create secret x --force` → updates existing - [x] Verified: `mcpctl create server y --from-template=grafana --env ...` works
michal added 1 commit 2026-02-22 23:06:48 +00:00
fix: proper error handling and --force flag for create commands
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
4e3d896ef6
- Add global error handler: clean messages instead of stack traces
- Add --force flag to create server/secret/project: updates on 409 conflict
- Strip null values and template-only fields from --from-template payload
- Add tests: 409 handling, --force update, null-stripping from templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
michal merged commit 081e90de0f into main 2026-02-22 23:06:53 +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#10