Use the MCP Stack CLI
Manage organizations, servers, Host, Gateway, agents, smoke tests, logs, and automation from a terminal.
The mcpstack CLI is the automation surface for MCP Stack. Use it for CI, repeatable operations, debugging, smoke tests, and day-to-day platform work that should not depend on clicking through the dashboard.
npm install -g @mcpstack/cli
mcpstack auth login
mcpstack auth statusMost commands support common flags:
mcpstack servers list --org org_123 --json
mcpstack servers get srv_support --json
mcpstack gateways logs gw_123 --output tableCommon flags:
| Flag | Purpose |
|---|---|
--api-url | Override the MCP Stack API base URL. |
--org | Select an organization. |
--json | Emit JSON output. |
--output | Choose output format where supported. |
--yes | Skip interactive confirmation. |
--wait | Wait for async operations. |
--timeout | Set operation timeout. |
--verbose | Print more detail. |
--debug-http | Debug API requests. |
Use environment variables in CI:
export MCPSTACK_API_URL=https://api.mcpstack.com
export MCPSTACK_ORG_ID=org_123
export MCPSTACK_API_KEY=mcpstack_sk_xxxx
export MCPSTACK_OUTPUT=jsonSupported variables include:
MCPSTACK_API_URLMCPSTACK_ORG_IDMCPSTACK_ACCESS_TOKENMCPSTACK_API_KEYMCPSTACK_DISABLE_KEYCHAINMCPSTACK_OUTPUTNO_COLORmcpstack servers list
mcpstack servers get support-api
mcpstack tools list support-api
mcpstack smoke tools-list support-apiUse this workflow to verify a server before attaching it to an agent or external MCP client.
Use custom domain commands to validate ownership, prepare routing records, finalize, inspect, and remove a customer-owned MCP hostname from a hosted server.
See Set up a custom MCP domain for the full staged workflow, DNS records, status meanings, and troubleshooting.
mcpstack servers custom-domain validate support-api \
--hostname mcp.example.com \
--environment prod \
--json
mcpstack servers custom-domain confirm-ownership support-api --environment prod --json
mcpstack servers custom-domain get support-api --environment prod --json
mcpstack servers custom-domain finalize support-api --environment prod --json
mcpstack smoke tools-list support-api --environment prod --json
mcpstack servers custom-domain delete support-api --environment prod --yesThe validate response includes the ownership TXT record to create at your DNS provider. After it resolves, run confirm-ownership; MCP Stack then prepares the routing CNAME and TLS-validation TXT records. Add those records, wait for propagation, then run finalize. The canonical hosted MCP URL remains available while the custom domain is pending.
mcpstack gateways list
mcpstack gateways get gw_support
mcpstack gateways logs gw_supportGateway commands are useful when OAuth succeeds in the browser but tool calls still fail. Look for missing scopes, invalid audience, expired grants, or runtime errors.
mcpstack agents list
mcpstack agents get ag_support
mcpstack agents usage ag_support --jsonUse agent commands to audit configuration and embed usage without opening the dashboard.
Manage embedded user budgets from service-account automation or an operator terminal:
mcpstack agents budget defaults ag_support --monthly-usd 10000 --default-user-usd 5 --json
mcpstack agents budget set ag_support --user customer_abc --monthly-usd 5 --json
mcpstack agents budget get ag_support --user customer_abc --json
mcpstack agents budget delete ag_support --user customer_abc --yesUse the API for production signup and billing hooks. Use the CLI for imports, spot checks, and operational tasks. See Embedded agent budgets for identity mapping, service-account auth, and budget-exhausted runtime behavior.
mcpstack org list --json
mcpstack members list --json
mcpstack api-keys list --jsonOrganization billing and AI credits are managed in the dashboard. Use the Billing and AI credits guide for checkout and ledger workflows.
| Area | Common commands |
|---|---|
| Auth | auth login, auth status, auth service-account login |
| Organizations | org list, members list, api-keys list |
| Servers | servers list, servers get, tools list, smoke tools-list, servers checks |
| Custom domains | servers custom-domain validate, confirm-ownership, finalize, get, delete |
| Gateways | gateways list, gateways get, gateways logs |
| Agents | agents list, agents get, agents usage, agents budget set, agents budget get, agents budget defaults |
| Logs | logs stream, operations list |
For the compact canonical map, see CLI Reference.
#!/usr/bin/env bash
set -euo pipefail
mcpstack auth service-account login --key "$MCPSTACK_API_KEY"
mcpstack servers get "$MCPSTACK_SERVER_ID" --json
mcpstack smoke tools-list "$MCPSTACK_SERVER_ID" --jsonFor interactive use, run auth login. For CI, use service-account auth and JSON output. When debugging, add --verbose and --debug-http, and reduce to the smallest command that reproduces the issue.