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, includingstack addandstack doctor. - Consumer: When you
stack adda 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 0.3.10 CLI and MCP packages declare Node.js 20 or newer,
including when installed through npm or launched with npx. Check other versions’
manifests. The recorded public version is 0.3.10; this reference
describes source 0.3.11. The example pins the recorded public
version; check the tools advertised by your installed server.
Example stdio configuration
{
"mcpServers": {
"ashlr-stack": {
"command": "npx",
"args": [
"-y",
"-p",
"@ashlr/stack@0.3.10",
"-p",
"ashlr-stack-mcp@0.3.10",
"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.
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.
Local lane bridge (source only)
packages/mcp/src/local-lane.ts serves the Locus, Lexicon and Stack MCP
servers behind one loopback HTTP endpoint for local agent lanes. It is not in the npm
package, which bundles only src/server.ts, so run it from a clone with Bun:
bun packages/mcp/src/local-lane.ts serve [--port <n>] # prints the endpoint on stderr
bun packages/mcp/src/local-lane.ts smoke --json # one-shot health check -
It starts
locus-mcpandlexicon mcpfrom PATH and this package'ssrc/server.tsas stdio children, and republishes their tools as<server>__<tool>, for examplelexicon__list_terms. -
servelistens onhttp://127.0.0.1:<port>/mcp. Without--portit picks a free port. An upstream that fails to start is reported on stderr and left out. -
smokeexits 0 only when all three upstreams list tools and a read-onlylexicon__list_termscall succeeds. Run it directly, not throughbun run, which echoes the command into the JSON. -
It binds to 127.0.0.1, accepts only
127.0.0.1andlocalhostHost headers, and refuses requests that carry anOriginheader. It has no authentication: any local process can call it, including mutating tools such aslocus__locus_request_pinandstack__stack_add.
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 | Starter template name. |
force | boolean | Overwrite an existing .stack.toml. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 inside the project (default: .env). |
dryRun | boolean | Preview without writing. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 inside the project (default: cwd). |
confidence | string | Minimum confidence: low, medium, or high (default: medium). |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 | Existing absolute project directory; defaults to server cwd. |
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 | |
keepRemote | boolean | |
cwd | string | Existing absolute project directory; defaults to server cwd. |
stack_list stack list [--json] List services configured in this stack.
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.list/v1. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 | |
json | boolean | JSON: ashlr.stack.info/v1. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
stack_status stack status [--json] Show Phantom + services + config at a glance.
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.status/v1. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
stack_env_show stack env show [--json] Show which declared secrets are present in the Phantom vault (masked).
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.env/v1; names only. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
stack_env_diff stack env diff [--json] Report which declared secrets are missing from the Phantom vault.
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.env-diff/v1; names and service only. Missing secrets remain an error. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 | JSON output. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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 | Existing absolute project directory; defaults to server cwd. |
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 | JSON: 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 | JSON: ashlr.stack.projects/v1. |
stack_deps stack deps [--json] Show the service dependency graph for the current stack.
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.deps/v1. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
stack_templates_list stack templates list [--json] List available starter stack templates and the services each one adds.
| Input | Type | Description |
|---|---|---|
json | boolean | JSON: ashlr.stack.templates/v1; 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.
stack_recommend stack recommend "<query>" --json [--k <n>] [--category <name>] [--save] Rank curated providers by query, returning JSON as text without LLM inference. save:true writes a Recipe for stack_apply.
| 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 | Category (case-insensitive): Database, Deploy, Cloud, AI, Analytics, Observability, Errors, Payments, Code, Tickets, Email, Auth, FeatureFlags. Unknown values error. |
save | boolean | Save .stack/recipes/<id>.toml for stack_apply; returns recipe id. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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/, letters, numbers, underscores or hyphens). |
no_wire | boolean | Skip the Phantom vault check and webhook stubs. |
cwd | string | Existing absolute project directory; defaults to server cwd. |
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://current/.stack.local.toml application/toml stack://current/.mcp.json application/json 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. |
$(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 throughstack_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" }
}