/agami-core:agami-deployfrom agami-core
Guides users through deploying a self-hosted agami MCP server for team use. Gathers hostname and admin identity, writes docker-compose.yml, Caddyfile, and agami.env, then runs docker compose up or prints VM deployment steps.
Ships in agami-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are preparing a deploy bundle on the user's machine so they can stand up the multi-user agami
server (the HTTP MCP server with OAuth + admin) that their team's Claude connects to. The bundle pulls
the published image (ghcr.io/agamiai/agami-core) — there is no repo to clone and nothing to
build. You gather a few inputs, write the bundle locally, and hand off the cloud steps you can't do.
The local mirror of this (single-player, no network, no auth) is agami-serve — if the user only wants
agami in their own Claude Desktop, point them there instead.
agami.env file (Phase 2 hand-off), exactly like agami-connect
does for DB credentials. You never see it.prepare_deploy.py takes only non-secret values;
deploy_preflight generates the signing secret into the file. Hosts render Bash calls in chat.agami.env step — point the user at the in-repo deploy
README if they ask, and move on.Tight and oriented. Print one-line progress markers (✓ Bundle written to …, ✓ agami.env validated).
Be honest about what's the user's clicks (provision the VM, point DNS) vs what you automate.
Run the detection logic from shared/plan-mode-check.md. This skill
writes files and may run Docker. If plan mode is active, refuse with: "I can't prepare a deploy bundle
in plan mode — it writes the bundle + your agami.env and may run Docker. Switch to Auto or Edit
Automatically mode (Shift+Tab) and re-invoke me." DO NOT write a plan file or call ExitPlanMode.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" connect_resolve.py prints JSON;
read data.artifacts_dir (the local model dir). An env_profile_has_no_model
anomaly means AGAMI_PROFILE names a database with no model: say its detail in one line and stop.<artifacts_dir>/<active_profile>/datasource.yaml must exist. If there's no model yet,
stop and invoke /agami-connect first — the deployed server has nothing to serve without one.Ask only these (everything else is defaulted or generated). Prefer one compact exchange:
PUBLIC_BASE_URL=https://<host>.
bundled-db,tunnel; they'll add CLOUDFLARE_TUNNEL_TOKEN to agami.env). The tunnel still needs a
domain on Cloudflare — it removes the public IP, not the name.edge (drops the bundled DB). The
managed postgresql://… URL is a credential, so do not collect it in chat — after the bundle
is written, the user sets APP_DATABASE_URL in agami.env themselves (the same hand-off as the password).<artifacts_dir>/<profile>/datasource.yaml). If there's exactly one, use it silently. If there's more than
one, ask: "You have N datasources — <names>. Deploy all, or pick?" Pass the chosen set as
--datasources a,b (omit to deploy all). The server serves every datasource you stage, and each needs
its own DSN (Phase 2).Confirm where to write the bundle. Ask: "Where should I put the deploy bundle? (default ~/agami-deploy)"
and use their answer as --target. It must not be inside the artifacts dir (prepare_deploy rejects that —
it copies the model out of artifacts into the bundle). Then write it:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" prepare_deploy.py \
--target <chosen-dir, default ~/agami-deploy> \
--artifacts-dir "<data.artifacts_dir>" \
--public-base-url "https://<host>" \
--admin-email "<email>" --admin-first "<first>" --admin-last "<last>" \
--profiles "bundled-db,edge"
Append these flags to the command when they apply (add each as another \-continued line): --datasources "a,b" to stage a subset of models; on a version upgrade --image-tag "<version>" to bump it (omit it on a
model-only re-stage so an existing pin isn't changed).
(Use --profiles "bundled-db,tunnel" for the tunnel, or --profiles "edge" for managed Postgres — then
have the user set APP_DATABASE_URL in agami.env by hand, never on the command line.)
Read the status line and branch on the first token:
PREPARED <dir> — a fresh bundle. Go to Phase 2 (fill the secrets).UPGRADED <dir> new_keys=<a,b,…> — an existing bundle upgraded in place: every value the user
typed (password, secret, DSN) is kept. If new_keys is non-empty, this version added settings — tell
the user exactly which to set (e.g. "this version added DATASOURCE_URL — set it in agami.env before we
restart"). If it's empty, nothing new is needed. Existing secrets are already there — don't re-ask;
continue to Phase 3 (deploy).Open the file for them so they don't have to hunt for it (it's a plain visible file, agami.env, in the
bundle dir): open -t -- "<target>/agami.env" on macOS (opens it in the default text editor; the -- stops a
path that starts with - being read as a flag); on other platforms
just print the absolute path. Then tell the user (do not proceed past this in the same turn). These are
credentials — the user types them by hand; you never see them, they stay in the file on their machine:
Open
<target>/agami.env(I just opened it for you) and set, then save:
AGAMI_ADMIN_PASSWORD=— a strong admin password.- the warehouse DSN(s) — the connection string(s) the model queries (the scheme picks the type:
postgresql://mysql://redshift://snowflake://…). (These live here now — not shipped in the bundle.) Name them per the datasource(s) you deployed:
- one datasource →
DATASOURCE_URL=(e.g.postgresql://<user>:<password>@host:5432/db).- several → one per datasource:
DATASOURCE_URL__<TOKEN>=, where<TOKEN>is the datasource id upper-cased with every non-alphanumeric char turned to_(sosales-pg→DATASOURCE_URL__SALES_PG). (List the exact var names for the datasources they chose in Phase 1.4.) agami only runs read-only SELECTs, so the warehouse user only needs read access — a read-only user is safest. Ask for "the read-only grant" and I'll hand you the SQL (shared/readonly-grants.md).- (only if you chose managed Postgres)
APP_DATABASE_URL=— your Postgres URL.Then tell me to continue.
End the turn here. The user fills the secrets and re-invokes (or says "continue").
bash "${CLAUDE_PLUGIN_ROOT}/scripts/py" -m deploy_preflight ~/agami-deploy/agami.env. If it
reports missing inputs (e.g. the password still blank, or a non-https URL), relay them and stop. On
success it has written AGAMI_SIGNING_SECRET + derived AGAMI_PUBLIC_HOST into the file.cd ~/agami-deploy && ./deploy.sh (pulls the image + docker compose up -d).~/agami-deploy to the host
(scp -r or a synced folder), then run ./deploy.sh there. Give them the cloud checklist below.<PUBLIC_BASE_URL>/mcp (what teammates add in
claude.ai → Connectors), and the admin console <PUBLIC_BASE_URL>/admin.curl -fsSL https://get.docker.com | sudo sh../deploy.sh on the host → wait ~30s for Caddy to issue the cert → open <PUBLIC_BASE_URL>/admin.A re-run of /agami-deploy over an existing bundle is non-destructive — it never touches the secrets the
user typed (UPGRADED status); it re-stages the model, appends any settings new in this version, and reports
them as new_keys. Two cases:
--image-tag (keeps the pinned
version), then on the host docker compose restart agami — the server re-ingests the model on boot. No
rebuild, no DB access.--image-tag "<version>" (bumps it), set any
new_keys the run reports, then cd <target> && ./deploy.sh (pulls the new image + recreates).agami-serve (stdio, no
network). For a fully managed, governed, always-on server, that's the hosted product — see
docs/open-vs-hosted.md.agami.env, so a
VM rebuild that re-uses the same bundle keeps every connected Claude working (no reconnect).What SKILL.md sets; muted values are Claude Code's defaults
Use when the user says 'deploy agami', 'self-host agami', 'set up the agami server for my team', 'stand up a shared agami', 'host agami on a VM / in the cloud', '/agami-deploy', or otherwise wants the multi-user HTTP server (not the local single-player setup — that's agami-serve). Requires agami-connect to have run first (needs a semantic model + credentials). This is the TEAM path: it produces an internet-reachable server with OAuth + admin that claude.ai connects to.
Three short reads, in order
npx claudepluginhub agamiai/agami-core --plugin agami-core9 skills in this plugin
/agami-connectEnd-to-end database connection for agami: sets up credentials on first run (DB-type picker → writes <artifacts_dir>/local/credentials.example for the user to fill in), then introspects the live DB directly into the agami semantic model (subject areas, tables, columns, relationships with join cardinality, deep-table column groups, sensitive-column flags) under <artifacts_dir>/<profile>/. The structural model is built deterministically by the agami-core semantic_model package (catalog mode, or a probe-mode fallback when the catalog is locked down); the skill then layers LLM enrichment (descriptions, entities, metrics) and seeds EXPLAIN-validated NL→SQL examples. Every model write is gated by the semantic-model validator — no breaking model is ever persisted./agami-evalRuns the golden evaluation harness for a profile. Picks one golden dataset, regenerates SQL for every question in it, executes each statement against the org's own warehouse, scores the result against the confirmed answer key, and reports the verdicts — failures first, with the errored, the unscored and the unconfirmed each kept separate. Scoring is deterministic and happens in agami-core; the skill reports it and never re-judges it. Neither the answer key nor the generated statement is printed: both stay in a local JSON artifact the report points at./agami-modelThe semantic model in the chat: what needs sign-off and the subject areas with their tables, then a card — review what needs sign-off (approve / reject the AI-proposed metrics, entities and guessed joins; Rule 1 — a query using an unsigned metric still answers but carries a warning until it's approved), hide tables or columns from queries, look up a table or metric, or show the full view (the model explorer page: browse with live search, edit descriptions/metrics/entities/joins, add metrics, edit datasource.md). Every change is applied through the curation engine and gated by the validator before it touches the YAML. (This skill absorbed the former `/agami-review`.)/agami-queryAnswers natural-language questions about the user's database. Loads the agami semantic model (subject areas, tables, columns, relationships with join cardinality, entities, metrics) and few-shot examples from <artifacts_dir>/<profile>/, generates SQL via the examples-first traversal (pick subject area → match examples → resolve entities/metrics → compound table context), executes it locally via the user's chosen tool (psql / mysql / snowsql / sqlite3 native CLI, DuckDB binary, or the Python driver `execute_sql.py` — which runs the scope gates and reports fan-trap/chasm-trap and aggregation findings on the receipt), returns results as a markdown table with optional CSV export, and renders Chart.js HTML charts on request. All execution is local — no data leaves the machine./agami-reconcileReconciles known (label, expected_value) numbers from an existing dashboard against agami's answers. Input can be a SCREENSHOT of a Metabase / Power BI / Tableau / Looker dashboard (Claude's vision extracts the pairs), a CSV, or numbers pasted inline — the user doesn't need to know which; they can just ask. For each pair, the skill generates a matching NL question, runs it through the active profile's semantic model, diffs actual vs expected, and surfaces matches in green and mismatches in red with drill-down receipts. The strongest onboarding demo for a skeptical data engineer — either we agree with their numbers (trust earned via evidence) or we surface a real definitional disagreement (trust earned via transparency)./agami-save-correctionSaves a user correction so future queries learn from it. Always appends a (question, corrected_sql) pair to the subject area's example library under <artifacts_dir>/<profile>/prompt_examples/<area>/. Additionally, classifies the correction and — when applicable — applies a surgical edit to the semantic model itself (relationship fix, column metadata, or new metric) via the curation engine. Every model edit is validated before write; the validator is the binding gate, and a failed validation reverts. Shows the user a model diff for approval before any model mutation.Other plugins' skills for the same job