Tomas Dvorak
|
485e41a817
|
feat(mcp): stdio MCP server exposing the full API as tools
Add containr-mcp so MCP-compatible agents (Claude, Cursor, Devin)
operate the platform directly — ROADMAP2 phase A3. Reuses the CLI's
thin client and PAT auth; zero duplicated resource logic.
- ~60 containr_* tools across projects, services, deployments, logs,
exec, variables, databases, cron, templates, nodes, scaling, ha,
security, gateway, admin, notifications, tokens
- declarative tool specs → {param} path substitution, GET extras become
query params, remaining args form the request body
- destructive tools require confirm:true and return isError without it
- results are pretty JSON; API error envelopes surface as isError
- configured via CONTAINR_API_URL + CONTAINR_TOKEN env; official
modelcontextprotocol/go-sdk over StdioTransport
Verified over stdio: initialize + tools/list, auth_status returns the
token owner's identity, projects list, destructive refusal, token
creation through MCP.
Authored By: TDvorak <[email protected]>
|
2026-10-08 15:25:34 +02:00 |
|
Tomas Dvorak
|
e51b20b2d4
|
feat(cli): v2 — full API coverage, profiles, --json/--yes, containr up
Rewrite the CLI as a thin client over the authenticated API so agents
and scripts reach every resource the UI does (ROADMAP2 phase A2).
- shared Client with bearer auth, error-envelope decoding, and stable
exit codes: 0 ok / 1 error / 2 auth / 3 not-found / 4 validation /
5 unreachable
- named profiles in ~/.containr.yaml (current_profile + profiles.*);
resolution order --flag > env > profile > localhost default;
CONTAINR_TOKEN / CONTAINR_API_URL / CONTAINR_PROFILE env support
- --json prints raw API responses; --yes skips confirmations;
destructive commands refuse non-interactively without it
- auth login verifies the token against /user/profile before saving,
interactive prompt via term.ReadPassword
- commands for every resource: tokens, projects, services, deploy,
deployments (logs/rollback), logs --follow (SSE), exec, variables
(set/unset merge with secret masking preserved), databases
(backup/restore/download), cron, templates, nodes + agent tokens,
scaling, ha, security, gateway, admin, notifications
- containr up: git remote + branch → create-or-reuse service → deploy
Verified live: login/status/tokens/projects/services, up creating a
service + deployment, non-TTY confirmation refusal, scope-capped admin
rejection (exit 2), revoke.
Authored By: TDvorak <[email protected]>
|
2026-10-08 15:19:31 +02:00 |
|