{
  "$schema": "https://raw.githubusercontent.com/modelcontextprotocol/specification/main/schema/schema.json",
  "name": "ashlr-stack",
  "description": "Static catalog of 19 tools declared by reviewed Stack source 0.2.1, a subset of CLI commands; the catalog version label is not an installed or published package claim. The stdio server dispatches CLI arguments and returns stdout plus any nonempty stderr as text, with isError reflecting command completion, not provider/client acceptance. It is a control plane, not a sandbox or redaction layer. Public CLI and MCP packages recorded at 0.1.1 require Bun 1.2 or newer on PATH even when launched via npm/npx. Both stack and ashlr-stack-mcp commands are needed; STACK_BIN can override the CLI path. Adapt setup to your client and confirm the server working directory and actual advertised tools. Project-scoped tools accept an optional absolute cwd so a server started outside the project can target it; resources always read the server working directory. Resources are conditional on existing cwd files and return raw text. Provider configuration may contain literal $(phantom reveal NAME) strings; Stack supplies no general expansion step, so actual client/provider credential setup remains necessary.",
  "version": "0.2.0",
  "homepage": "https://stack.ashlr.ai",
  "repository": "https://github.com/ashlrai/ashlr-stack",
  "license": "MIT",
  "install": {
    "command": "npx",
    "args": ["-y", "-p", "@ashlr/stack@0.1.1", "-p", "ashlr-stack-mcp@0.1.1", "ashlr-stack-mcp"],
    "mcpConfigSnippet": {
      "mcpServers": {
        "stack": {
          "command": "npx",
          "args": ["-y", "-p", "@ashlr/stack@0.1.1", "-p", "ashlr-stack-mcp@0.1.1", "ashlr-stack-mcp"]
        }
      }
    }
  },
  "tools": [
    {
      "name": "stack_init",
      "description": "Scaffold .stack.toml in the current directory; a selected template may also run provider setup.",
      "cli": "stack init --noInteractive [--template <name>] [--force]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "template": { "type": "string", "description": "Optional starter template name." },
          "force": { "type": "boolean", "description": "Overwrite an existing .stack.toml." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_import",
      "description": "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).",
      "cli": "stack import --json [--from <path>] [--dryRun]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "from": { "type": "string", "description": "Path to the .env file (default: .env)." },
          "dryRun": { "type": "boolean", "description": "Preview without writing." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_scan",
      "description": "Detect providers this repo uses by reading package.json / requirements.txt / config files.",
      "cli": "stack scan [--path <dir>] [--confidence low|medium|high]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "path": { "type": "string", "description": "Directory to scan (default: cwd)." },
          "confidence": { "type": "string", "enum": ["low", "medium", "high"], "description": "Minimum confidence (default: medium)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_add",
      "description": "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.",
      "cli": "stack add <service> [--use <id>]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "service": { "type": "string", "description": "Service name (e.g. supabase, neon, vercel)." },
          "use": { "type": "string", "description": "Existing resource id to attach to." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["service"]
      }
    },
    {
      "name": "stack_remove",
      "description": "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.",
      "cli": "stack remove <service> --json [--keepRemote]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "service": { "type": "string", "description": "Service name." },
          "keepRemote": { "type": "boolean", "description": "Accepted and forwarded compatibility flag; the CLI keeps upstream resources in every removal mode." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["service"]
      }
    },
    {
      "name": "stack_list",
      "description": "List services configured in this stack.",
      "cli": "stack list [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.list/v1)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_info",
      "description": "Inspect configured resource, auth kind, secret-name inventory and MCP metadata; attempt a healthcheck when the provider supports one.",
      "cli": "stack info <service> [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "service": { "type": "string", "description": "Service name." },
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.info/v1)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["service"]
      }
    },
    {
      "name": "stack_status",
      "description": "Show Phantom + services + config at a glance.",
      "cli": "stack status [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.status/v1)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_env_show",
      "description": "Show which declared secrets are present in the Phantom vault (masked).",
      "cli": "stack env show [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.env/v1, names only)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_env_diff",
      "description": "Report which declared secrets are missing from the Phantom vault.",
      "cli": "stack env diff [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.env-diff/v1, names and declaring service only); still an error result when any are missing." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_doctor",
      "description": "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.",
      "cli": "stack doctor [--fix] [--all] [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "fix": { "type": "boolean", "description": "Attempt auto-remediation." },
          "all": { "type": "boolean", "description": "Run across every registered project." },
          "json": { "type": "boolean", "description": "Machine-readable JSON output." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_sync",
      "description": "Forward a deployment-platform sync request to phantom sync; inspect the installed Phantom command support and result separately.",
      "cli": "stack sync --platform <name>",
      "inputSchema": {
        "type": "object",
        "properties": {
          "platform": { "type": "string", "enum": ["vercel", "railway", "fly"] },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["platform"]
      }
    },
    {
      "name": "stack_providers",
      "description": "List the curated source provider catalog by category; inclusion does not attest complete provisioning or active credentials.",
      "cli": "stack providers [--category <category>] [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "category": { "type": "string", "description": "Only this category, any case (e.g. ai, database, payments)." },
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.providers/v1)." }
        },
        "required": []
      }
    },
    {
      "name": "stack_projects_list",
      "description": "List projects recorded in the local Stack registry; this is not a filesystem-wide discovery scan.",
      "cli": "stack projects list [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.projects/v1)." }
        },
        "required": []
      }
    },
    {
      "name": "stack_deps",
      "description": "Show the service dependency graph for the current stack.",
      "cli": "stack deps [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.deps/v1)." },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": []
      }
    },
    {
      "name": "stack_templates_list",
      "description": "List available starter stack templates and the services each one adds.",
      "cli": "stack templates list [--json]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "json": { "type": "boolean", "description": "Machine-readable JSON (schema ashlr.stack.templates/v1): each template with its services, providers and secret names." }
        },
        "required": []
      }
    },
    {
      "name": "stack_upgrade",
      "description": "Check npm for a newer @ashlr/stack release. Returns ashlr.stack.upgrade/v1 JSON (current, latest, status, install command); installs nothing.",
      "cli": "stack upgrade --json",
      "inputSchema": { "type": "object", "properties": {}, "required": [] }
    },
    {
      "name": "stack_recommend",
      "description": "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.",
      "cli": "stack recommend \"<query>\" --json [--k <n>] [--category <name>] [--save]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Natural-language description of the project / stack need."
          },
          "k": {
            "type": "number",
            "description": "Max top-level hits to return (default 6)."
          },
          "category": {
            "type": "string",
            "description": "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": {
            "type": "boolean",
            "description": "When true, also freeze the result to .stack/recipes/<id>.toml so you can run stack_apply. Returns the recipe id in the response."
          },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["query"]
      }
    },
    {
      "name": "stack_apply",
      "description": "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.",
      "cli": "stack apply <recipe_id> [--noWire]",
      "inputSchema": {
        "type": "object",
        "properties": {
          "recipe_id": {
            "type": "string",
            "description": "Recipe id (filename stem in .stack/recipes/)."
          },
          "no_wire": {
            "type": "boolean",
            "description": "Skip optional Phantom wiring and webhook stubs; provider credential writes remain."
          },
          "cwd": { "type": "string", "description": "Absolute path of the project directory to run in (default: the MCP server's working directory). Must be an existing directory." }
        },
        "required": ["recipe_id"]
      }
    }
  ],
  "resources": [
    {
      "uri": "stack://current/.stack.toml",
      "name": ".stack.toml (this project)",
      "description": "Project configuration text when the file exists in server cwd; Git commit state is not verified and reads are not redacted.",
      "mimeType": "application/toml"
    },
    {
      "uri": "stack://current/.stack.local.toml",
      "name": ".stack.local.toml (local instance)",
      "description": "Local instance data when the file exists in server cwd; inspect contents and project ignore rules before exposing raw text.",
      "mimeType": "application/toml"
    },
    {
      "uri": "stack://current/.mcp.json",
      "name": ".mcp.json (MCP wiring)",
      "description": "MCP configuration text when the file exists in server cwd; client loading and usable credentials are not verified.",
      "mimeType": "application/json"
    }
  ]
}
