
Using Medusa Cloud
- 724 installs
- 207 repo stars
- Updated July 31, 2026
- medusajs/medusa-agent-skills
using-medusa-cloud is an agent skill that guides Medusa Cloud CLI (mcloud) setup, deployments, debugging, environments, and variables for developers who operate Medusa commerce backends on managed infrastructure.
About
using-medusa-cloud is a workflow skill from the medusa-cloud plugin in medusajs/medusa-agent-skills for operating Medusa commerce backends on Medusa Cloud through the Cloud CLI. The skill teaches agents correct mcloud auth, project and organization selection, deployment inspection, environment lifecycle commands, variable management, and log filtering so storefront linkage and env configuration stay aligned with Medusa conventions. Developers reach for using-medusa-cloud when a Medusa backend is already targeting Cloud and they need agent-driven deploy debugging, environment redeploys, or managed infra operations without hand-reading CLI docs. The medusa-cloud plugin bundles 8 related Cloud CLI skills alongside using-medusa-cloud, covering auth, deployments, environments, logs, variables, organizations, and projects. Install via Claude Code plugin marketplace or yarn skills add medusajs/medusa-agent-skills for Cursor and other agents.
- Medusa Cloud project provisioning
- Environment and secrets configuration
- Storefront and backend linkage
- Managed hosting workflows
- Commerce deployment conventions
Using Medusa Cloud by the numbers
- 724 all-time installs (skills.sh)
- +77 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #335 of 1,039 Cloud & Infrastructure skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/medusajs/medusa-agent-skills --skill using-medusa-cloudAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 724 |
|---|---|
| repo stars | ★ 207 |
| Last updated | July 31, 2026 |
| Repository | medusajs/medusa-agent-skills ↗ |
How do you operate Medusa Cloud with mcloud CLI?
Deploy and operate Medusa commerce backends on Medusa Cloud with correct env setup, storefront linkage, and managed infrastructure conventions.
Who is it for?
Backend developers operating a Medusa commerce API already deployed or migrating to Medusa Cloud who want agents to run mcloud safely.
Skip if: Developers still scaffolding a local Medusa project or building storefront UI who should use medusa-dev or ecommerce-storefront skills instead.
When should I use this skill?
User asks to deploy, redeploy, debug builds, tail logs, or manage environments and variables on Medusa Cloud.
What you get
Configured Medusa Cloud environments, deployment runbooks, env var maps, and mcloud command sequences for logs and redeploys.
- mcloud command sequences
- environment configuration
- deployment debug notes
By the numbers
- medusa-cloud plugin bundles 8 Cloud CLI skills
- Covers 8 mcloud resource areas from auth through projects
Files
Managing Medusa Cloud Resources
Operational guide for AI agents managing Medusa Cloud infrastructure through the mcloud CLI. Covers setup, deployments, debugging, environments, and variables.
Constraints
- Always pass `--json` when parsing CLI output. Plaintext output is for humans and may change without warning.
- Confirm context before mutating. Run
mcloud whoami --jsonbefore any state change. - Read before you write. Run a
getorlistbefore anydelete,redeploy, ortrigger-build. - Use `--yes` for destructive operations.
deletecommands require--yesin non-interactive mode. - Production environments cannot be deleted.
mcloud environments deleteerrors on production by design. - Never pass `--reveal` unless the user explicitly asks. Secret values appear in terminal scrollback and logs.
- `--json` and `--follow` are incompatible. Use bounded time windows (
--from/--to) with--jsonfor programmatic log ingestion.
CRITICAL: Load Reference Files When Needed
Load these references based on what you're doing:
- Setting up the CLI? → MUST load
setup.mdfirst - Debugging a failed deployment? → MUST load
debugging-deployments.mdfirst - Managing environments or variables? → MUST load
environments-and-variables.mdfirst
Minimum requirement: Load at least one reference file before executing multi-step workflows.
Quick Reference
Authentication Check
Always verify auth and scope before mutating state:
mcloud whoami --json | jq -e '.auth.kind != "none" and .organization.id != null'Exit code 0 = authenticated and scoped. Non-zero = stop and ask the user.
Set Context Once
mcloud use \
--organization org_123 \
--project proj_123 \
--environment productionCRITICAL: mcloud use without flags is interactive and fails in CI/Docker/piped input. Always pass flags.Deployment Status Routing
Route on backend_status (or storefront_status):
| Status | Meaning | Logs to check |
|---|---|---|
build-failed | Build step failed | mcloud deployments build-logs <id> |
deployment-failed | Runtime crashed after build | mcloud logs --deployment <id> |
timed-out | Exceeded time budget | Both: build-logs first, then runtime logs |
Redeployment Decision
| Command | When to use |
|---|---|
mcloud environments redeploy <env> | Fix is environment-side (variable change, infra) — reruns existing build |
mcloud environments trigger-build <env> | Fix is in source code on the tracked branch — starts new build |
Common Pitfalls
- TTY-only commands.
mcloud login,mcloud use(without flags), anddeletewithout--yesrequire a TTY. They fail in CI, Docker, or piped input. - `MCLOUD_TOKEN` precedence. When set, file-based credentials are ignored and
mcloud loginis rejected. Unset it to switch accounts. - Personal vs org access keys. Personal keys require
--organization; org keys are pre-scoped. - `organizations list` requires personal auth. Org access keys return 401 on this command.
- Build IDs vs deployment IDs.
depl_*= deployment ID; anything else = build ID (resolved to latest deployment).mcloud logs --deploymentaccepts both; other commands take build IDs only.
Reference Files
setup.md - CLI installation, authentication, context setup
debugging-deployments.md - Build/deployment failure recipes and log analysis
environments-and-variables.md - Environment lifecycle and variable managementDebugging Deployments
Inspecting Deployments
Status fields per deployment: backend_status and storefront_status.
Values: created, building, built, deploying, deployed, build-failed, deployment-failed, timed-out (backend only), canceled, idle.
# Most recent failed deployment
mcloud deployments list --json \
| jq -r '[.[] | select(.backend_status == "build-failed" or .backend_status == "deployment-failed")][0].id'
# Deployments for a specific commit
mcloud deployments list --commit a1b2c3d --json | jq '.'
# Only preview deployments
mcloud deployments list --environment-type preview --json | jq '.'
# Single deployment details
mcloud deployments get bld_01ABC123 --jsonBuild Failure Recipe
Use when backend_status == "build-failed":
# Find the most recent build-failed deployment
DEPLOYMENT_ID=$(
mcloud deployments list --json \
| jq -r '[.[] | select(.backend_status == "build-failed")][0].id'
)
# Inspect deployment metadata
mcloud deployments get "$DEPLOYMENT_ID" --json
# Read the build output
mcloud deployments build-logs "$DEPLOYMENT_ID"
# For storefront build failures
mcloud deployments build-logs "$DEPLOYMENT_ID" --type storefrontbuild-logs returns a build_status field. When failed, check metadata.failed_docker_layer via mcloud deployments get --json to identify the failing layer.
Deployment Failure Recipe
Use when backend_status == "deployment-failed" (build succeeded, runtime crashed):
# Find the most recent deployment-failed
DEPLOYMENT_ID=$(
mcloud deployments list --json \
| jq -r '[.[] | select(.backend_status == "deployment-failed")][0].id'
)
# Runtime logs for that deployment
mcloud logs --deployment "$DEPLOYMENT_ID" --limit 1000
# Error-level lines only
mcloud logs --deployment "$DEPLOYMENT_ID" --search error --limit 1000
# Filter by HTTP status
mcloud logs --deployment "$DEPLOYMENT_ID" --metadata status=500 --limit 1000
# Structured analysis
mcloud logs --deployment "$DEPLOYMENT_ID" --json | jq '.[] | {timestamp, source, message}'Note:--followcannot be combined with--json. Use bounded time windows with--from/--toand--jsonfor scripts.
Rerunning a Deployment
Two options — not interchangeable:
Redeploy (environment-side fix): Re-runs the active deployment's existing build. Use when the fix is a variable change or infra issue.
mcloud environments redeploy env_123Requires the environment to have an active deployment. If it doesn't, use trigger-build first.
Trigger build (source code fix): Starts a new build from the tracked branch. Use when the fix is in committed code.
mcloud environments trigger-build env_123Verify the new build:
mcloud deployments list --environment env_123 --limit 5 --json \
| jq '.[] | {id, backend_status, commit_hash, updated_at}'Environments and Variables
Managing Environments
Create a Preview Environment
mcloud environments create \
--name "Staging" \
--branch developInspect an Environment
mcloud environments get staging --json | jq '{id, name, type, status, external_id}'Delete an Environment
mcloud environments delete env_123 --yesCRITICAL: Production environments are protected —deletereturns a non-zero exit code. Always check thetypefield viaenvironments get --jsonbefore attempting a delete in automation.
Managing Environment Variables
Variables are scoped to a single environment.
List Variables
mcloud variables list --jsonGet a Variable
# By key (requires active project and environment)
mcloud variables get DATABASE_URL --json
# By ID (works without project/environment context)
mcloud variables get var_01XYZ --jsonReveal Secret Values
CRITICAL: Only pass --reveal when the user explicitly asks. Plaintext values appear in terminal scrollback, log aggregators, and process listings.mcloud variables get STRIPE_SECRET_KEY --reveal --json | jq -r '.value'Export to .env
Replicate a Cloud environment's variables locally:
mcloud variables list --reveal --json \
| jq -r '.[] | "\(.key)=\(.value)"' \
> .envCLI Setup and Authentication
One-time setup for the Medusa Cloud CLI. Skip steps whose checks already pass.
1. Check if CLI is Installed
mcloud --versionIf this exits 0 and prints a version, skip to Confirm Authentication.
2. Verify Node.js Version
The CLI requires Node.js v22+:
node --versionIf below v22, ask the user to upgrade (via nvm or the official installer). Do not upgrade without authorization.
3. Install the CLI
npm install -g @medusajs/mcloudVerify:
mcloud --versionIf not found, ask the user to check their global npm bin directory is on PATH.
4. Confirm Authentication
Ask the user if they have a Medusa Cloud account.
Has account:
mcloud loginOpens a browser to complete auth.
No account:
mcloud signup
mcloud loginNon-interactive environments (CI, Docker, headless):
export MCLOUD_TOKEN=<access-key>When MCLOUD_TOKEN is set, the CLI uses it on every command and mcloud login is rejected.
5. Verify Setup
mcloud whoami --jsonCheck auth and scope:
mcloud whoami --json | jq -e '.auth.kind != "none" and .organization.id != null'Setting the Active Context
Persist org, project, and environment so subsequent commands skip --organization, --project, --environment flags:
mcloud use \
--organization org_123 \
--project proj_123 \
--environment productionResolving Names to IDs
If you only have names:
# Resolve organization ID by name
ORGANIZATION_ID=$(
mcloud organizations list --json \
| jq -r '.[] | select(.name == "My Organization") | .id'
)
# Resolve project handle by name
PROJECT_HANDLE=$(
mcloud projects list --organization "$ORGANIZATION_ID" --json \
| jq -r '.[] | select(.name == "My Store") | .handle'
)
# Resolve environment handle by name
ENVIRONMENT_HANDLE=$(
mcloud environments list --organization "$ORGANIZATION_ID" --project "$PROJECT_HANDLE" --json \
| jq -r '.[] | select(.name == "Production") | .handle'
)
mcloud use \
--organization "$ORGANIZATION_ID" \
--project "$PROJECT_HANDLE" \
--environment "$ENVIRONMENT_HANDLE"Clearing Context
mcloud use --clearRelated skills
How it compares
Pick using-medusa-cloud over medusa-dev skills when the backend already runs on Medusa Cloud and operations—not local feature coding—are the task.
FAQ
What CLI does using-medusa-cloud teach?
using-medusa-cloud teaches the Medusa Cloud CLI (mcloud) for auth, deployments, environments, variables, organizations, projects, and filtered logs. Agents follow plugin workflows so Cloud resource operations match Medusa documentation and managed infrastructure conventions.
How do you install using-medusa-cloud in Claude Code?
using-medusa-cloud installs with the medusa-cloud plugin: run /plugin marketplace add medusajs/medusa-agent-skills then /plugin install medusa-cloud@medusa. Other agents can copy the skill via yarn skills add medusajs/medusa-agent-skills and select using-medusa-cloud.