Skip to content
Integrations

MCP integration

Configure Stack's stdio MCP server, inspect its CLI tools, and understand the provider configuration it writes.

Two directions of MCP

Stack is both a producer and a consumer of MCP:

  • Producer: Stack itself is an MCP server (ashlr-stack-mcp). The source declares 19 tools, a subset of CLI commands, including stack add and stack doctor.
  • Consumer: When you stack add a service that has its own MCP server (Supabase, PostHog, Sentry, GitHub, Linear), Stack may merge that server's configuration into your project's .mcp.json. An entry alone does not establish usable credentials or a loaded client.

Installing Stack as an MCP server

The repository includes a Claude Code plugin. In Claude Code, add the marketplace and install its Stack plugin:

/plugin marketplace add ashlrai/ashlr-stack
/plugin install stack@ashlr

Or configure the stdio server in your MCP client. It also needs the stack CLI on PATH, or an absolute CLI path in STACK_BIN. The dual-package example below supplies both commands through npx.

Published CLI and MCP packages are currently 0.1.1 and require Bun 1.2 or newer on PATH, including when installed through npm or launched with npx. This reference describes source 0.2.1, which is not a published-version claim. The example pins those public versions; check the tools advertised by your installed server.

Example stdio configuration

{
  "mcpServers": {
    "ashlr-stack": {
      "command": "npx",
      "args": ["-y", "-p", "@ashlr/stack@0.1.1", "-p", "ashlr-stack-mcp@0.1.1", "ashlr-stack-mcp"]
    }
  }
}

Client configuration

Claude Code, Cursor, Windsurf and Zed have their own configuration locations and formats. Adapt the stdio command and arguments to your client's MCP settings; this JSON example does not define a universal global config file.

Project selection

Stack uses the server process's working directory. Confirm that your client launches it in the intended project; the snippet does not set that directory.

Already have both commands installed? With ashlr-stack-mcp and stack on PATH, you can use "command": "ashlr-stack-mcp" directly. STACK_BIN overrides the CLI path; it does not install the CLI or select the project directory.

Tools — 19 total

The table describes the reviewed source contract; installed versions may differ. Check the tools your server actually advertises. Each declared tool dispatches CLI arguments from its input schema. The server spawns stack <args> with NO_COLOR=1 and CI=1. It returns stdout and any nonempty stderr as text, with isError reflecting command completion. The server is a control plane, not a sandbox or redaction layer; results are not universally JSON.

stack_init stack init --noInteractive [--template <name>] [--force]

Scaffold .stack.toml in the current directory; a selected template may also run provider setup.

Input Type Description
template string Optional starter template name.
force boolean Overwrite an existing .stack.toml.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_import stack import --json [--from <path>] [--dryRun]

Import nonempty new variables from an .env file into Phantom and record detected services; existing vault names are left unchanged. Returns ashlr.stack.import/v1 JSON naming what was stored, skipped and wired (names only, never values).

Input Type Description
from string Path to the .env file (default: .env).
dryRun boolean Preview without writing.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_scan stack scan [--path <dir>] [--confidence low|medium|high]

Detect providers this repo uses by reading package.json / requirements.txt / config files.

Input Type Description
path string Directory to scan (default: cwd).
confidence string Minimum confidence: low, medium, or high (default: medium).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_add stack add <service> [--use <id>]

Run provider-specific service setup or attach an existing resource, then record returned secret slots and optional MCP configuration. Credentials and client/provider acceptance must be checked separately.

Input Type Description
service req string Service name (e.g. supabase, neon, vercel).
use string Existing resource id to attach to.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_remove stack remove <service> --json [--keepRemote]

Remove local service configuration and its MCP entry, and attempt Phantom secret cleanup. Returns JSON (ashlr.stack.remove/v1); `secrets_kept` lists names Phantom left stored, which headless runs always do, for the user to remove with `phantom remove` in a terminal. Upstream resources are kept.

Input Type Description
service req string Service name.
keepRemote boolean Accepted and forwarded flag; this CLI performs local removal without upstream deletion either way.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_list stack list [--json]

List services configured in this stack.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.list/v1).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_info stack info <service> [--json]

Inspect configured resource, auth kind, secret-name inventory and MCP metadata; attempt a healthcheck when the provider supports one.

Input Type Description
service req string Service name.
json boolean Machine-readable JSON (schema ashlr.stack.info/v1).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_status stack status [--json]

Show Phantom + services + config at a glance.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.status/v1).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_env_show stack env show [--json]

Show which declared secrets are present in the Phantom vault (masked).

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.env/v1, names only).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_env_diff stack env diff [--json]

Report which declared secrets are missing from the Phantom vault.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.env-diff/v1, names and declaring service only); still an error result when any are missing.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_doctor stack doctor [--fix] [--all] [--json]

Inspect the configured-service health report. --fix attempts supported remediation; stored vault names can cause repairs to be skipped, and name presence is not credential validity.

Input Type Description
fix boolean Attempt auto-remediation.
all boolean Run across every registered project.
json boolean Machine-readable JSON output.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_sync stack sync --platform <name>

Forward a deployment-platform sync request to phantom sync; inspect the installed Phantom command support and result separately.

Input Type Description
platform req string One of: vercel, railway, fly.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_providers stack providers [--category <category>] [--json]

List the curated source provider catalog by category; inclusion does not attest complete provisioning or active credentials.

Input Type Description
category string Only this category, any case (e.g. ai, database, payments).
json boolean Machine-readable JSON (schema ashlr.stack.providers/v1).
stack_projects_list stack projects list [--json]

List projects recorded in the local Stack registry; this is not a filesystem-wide discovery scan.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.projects/v1).
stack_deps stack deps [--json]

Show the service dependency graph for the current stack.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.deps/v1).
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_templates_list stack templates list [--json]

List available starter stack templates and the services each one adds.

Input Type Description
json boolean Machine-readable JSON (schema ashlr.stack.templates/v1): each template with its services, providers and secret names.
stack_upgrade stack upgrade --json

Check npm for a newer @ashlr/stack release. Returns ashlr.stack.upgrade/v1 JSON (current, latest, status, install command); installs nothing.

No inputs.
stack_recommend stack recommend "<query>" --json [--k <n>] [--category <name>] [--save]

Retrieve scored curated-provider matches and per-category ranking for a query. save:true writes a Recipe for a later stack_apply request. The CLI JSON payload is forwarded as text; this tool does not request LLM inference.

Input Type Description
query req string Natural-language description of the project / stack need.
k number Max top-level hits to return (default 6).
category string Optional filter to a source catalog category: Database, Deploy, Cloud, AI, Analytics, Observability, Errors, Payments, Code, Tickets, Email, Auth, FeatureFlags. The server input is a string, not an enforced enum.
save boolean Freeze the result to .stack/recipes/<id>.toml so you can run stack_apply.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.
stack_apply stack apply <recipe_id> [--noWire]

Apply a saved Recipe through provider setup, then report which declared secrets are in the Phantom vault and which are missing (names only; it never writes to the vault) and write webhook stubs. Inspect failures and skips. no_wire:true skips the vault check and stubs, not provider credential writes.

Input Type Description
recipe_id req string Recipe id (filename stem in .stack/recipes/).
no_wire boolean Skip optional Phantom wiring and webhook stubs.
cwd string Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory.

Resources

Up to three read-only resources are advertised when their files exist in the server's working directory. Reads return the file text. Confirm the intended project and inspect private configuration before exposing it; read-only does not mean redacted:

stack://current/.stack.toml application/toml
.stack.toml (this project)
Project configuration text when the file exists in server cwd; Git commit state is not verified and reads are not redacted.
stack://current/.stack.local.toml application/toml
.stack.local.toml (local instance)
Local instance data when the file exists in server cwd; inspect contents and project ignore rules before exposing raw text.
stack://current/.mcp.json application/json
.mcp.json (MCP wiring)
MCP configuration text when the file exists in server cwd; client loading and usable credentials are not verified.

Provider-side MCP servers

Several provider adapters may emit MCP entries during stack add. The table describes source configuration merged into .mcp.json, not verified installed packages, reachable endpoints or client acceptance:

Provider MCP transport Source configuration
supabase stdio (npx) @supabase/mcp-server-supabase@latest with --project-ref and a literal Phantom reveal placeholder in SUPABASE_ACCESS_TOKEN. The project ref selects a project; @latest is not a package pin.
posthog sse mcp.posthog.com/sse with the POSTHOG_PERSONAL_API_KEY represented by a literal Phantom reveal placeholder in the bearer header.
sentry stdio (npx) @sentry/mcp-server with a literal Phantom reveal placeholder in SENTRY_AUTH_TOKEN and SENTRY_HOST=https://sentry.io.
github stdio (npx) @modelcontextprotocol/server-github with GITHUB_PERSONAL_ACCESS_TOKEN containing a literal Phantom reveal placeholder.
linear stdio (npx) mcp-linear with a literal Phantom reveal placeholder in LINEAR_API_KEY.
Credential placeholders are literal. Stack writes strings such as $(phantom reveal NAME) unchanged; this writer supplies no general expansion or credential-resolution step. They do not establish usable credentials or secret-safe agent output. Phantom 0.7.9 retains trusted-terminal and value boundaries. Complete credential setup appropriate to your actual client and provider, then inspect their results separately.

Plugin slash commands

The Claude Code plugin supplies instructions for these six commands to invoke MCP tools. Inspect returned results; these instructions do not guarantee interactive setup or provider success:

  • /stack:add — request service setup through stack_add.
  • /stack:doctor — inspect the configured-service health report.
  • /stack:list, /stack:status — inspect configured services and status.
  • /stack:recommend, /stack:apply — retrieve providers and apply a saved recipe.

Illustrative tool request

This is an illustrative source tool request, not a recorded successful interaction. stack_add can contact a provider and create resources; it is not a preview. Inspect returned CLI text, local writes and provider results separately. An emitted MCP entry does not prove that a client loaded it or that its credentials work:

{
  "name": "stack_add",
  "arguments": { "service": "supabase" }
}