CLI vs MCP vs SDK

STACK has three client surfaces. They are not tiers of the same thing. Each one is built for a different driver doing a different job. Pick by who is at the wheel.

MCP server

Driver: an LLM assistant (Claude Code, Cursor, any MCP client). Use it for setup and exploration in natural language.

  • Endpoint: mcp.getstack.run, over OAuth.
  • Auto-discovered stack_* tools the assistant calls on your behalf.
  • Best for: "register this agent and issue it a read-only Slack passport" without leaving your editor.

SDK

Driver: the agent's own code. Use it on the runtime hot path, in-process.

  • Packages: @getstackrun/sdk (JS/TS), getstack (Python).
  • Typed wrapper over every REST route, plus one thing the raw API cannot give you: offline passport verification (verifyPassportOffline) with no network call at verify time.
  • Best for: an agent that verifies passports, issues sub-passports, or streams LLM calls through the gateway as part of its normal execution.

CLI

Driver: a human operator in a terminal. Use it for ops, scripts, and CI.

  • Invocation: npx @getstackrun/cli <command>.
  • A near-complete mirror of the operator surface: agents, passports, services, drop-offs, skills, identity, team, detectors, notifications, and more.
  • Two things it is uniquely good at: a live audit-log tail (monitor --follow) and scriptable credential retrieval (service credential <provider>) for CI and .env-style workflows.
  • Best for: an operator setting up or running an account from a shell, or a CI job that needs a scoped, audited, revocable credential.

Which one do I use?

  • Setting things up by talking to an assistant → MCP.
  • Writing agent code that runs at request time → SDK.
  • Working from a terminal, a script, or CI → CLI.

The three share one credential. npx @getstackrun/cli auth login writes ~/.stack/credentials.json, and both SDKs read it. Sign in once, all three work. The CLI signs in with a full read + write operator scope by default; set STACK_OAUTH_SCOPE to a read-only subset for monitoring-only sign-ins.

stack | docs