Choose runtime auth mode
Decide between Public API, Static Headers, and MCP Stack Gateway for generated OpenAPI MCP servers.
Runtime auth is how the generated MCP runtime reaches the upstream API. MCP Stack exposes three modes in the dashboard wizard: Public API, Static Headers, and Gateway.
Use Gateway when the access boundary is user-scoped. Use Static Headers only for fixed upstream credentials.
Choose Public API when the runtime does not need to inject credentials.
Good fits:
Hosted runtime behavior:
# No upstream auth variables are injected.
mcpstack servers create --openapi-url https://api.example.com/openapi.jsonChoose Static Headers when every upstream request should include the same fixed header.
Good fits:
Example generated runtime configuration:
UPSTREAM_BASE_URL=https://api.example.com
UPSTREAM_HEADERS='{"X-API-Key":"${SUPPORT_API_KEY}","X-Tenant-Id":"demo"}'Do not use Static Headers for user OAuth. A shared Authorization value means every user would call the upstream API as the same identity.
Choose Gateway when the upstream API is protected by OAuth, OpenID Connect, or bearer tokens that should represent the real user.
Gateway needs:
Example CLI setup:
mcpstack servers create \
--name support-api \
--openapi-url https://api.example.com/openapi.json
mcpstack gateways create \
--name support-api-gateway \
--provider auth0 \
--auth-server-url https://auth.example.com \
--client-id support-api-mcp \
--resource https://api.example.com \
--scopes "openid profile email tickets.read tickets.write"
mcpstack servers gateway attach <server-id> --gateway <gateway-id>The dashboard wizard reads OpenAPI security schemes and recommends a mode:
| OpenAPI signal | Typical recommendation |
|---|---|
| No security scheme | Public API |
apiKey in header/query/cookie | Static Headers |
http bearer | Gateway when user-scoped, Static Headers only if fixed |
oauth2 | Gateway |
openIdConnect | Gateway |
Auto-detection is a recommendation, not a substitute for product judgment. If the upstream access token changes by user, choose Gateway.
Before creating the server:
Use this decision rule:
Public API means no upstream credentials. Static Headers means one fixed upstream credential. Gateway means user-scoped OAuth, OIDC, bearer access, public MCP discovery, and downstream grant storage.