#!/usr/bin/env node import { Server } from "@modelcontextprotocol/sdk/server/index.js"; /** * ONE registry, TWO transports. * * `server` was a module-level singleton because stdio is the only transport * that has ever existed here. A hosted endpoint needs its own instance per * process (and, in stateless HTTP, potentially per request), so construction * moves into a factory and both entry points call it. * * THE POINT OF THE FACTORY is not reuse, it is preventing DRIFT. A second, * hand-written tool list for the HTTP surface would diverge within weeks and * the divergence would be invisible: hosted users would silently get a * different product from stdio users. `tests/transport-parity.test.mjs` pins * that both transports expose byte-identical tool definitions. */ export declare function createServer(): Server; declare const server: Server<{ method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; } | undefined; }, { method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; } | undefined; }, { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; /** Every tool this server implements. ONE registry — the hosted list is * derived from it, never written separately. * * transport_parity.test.mjs exists because "a second file with its own tool * list diverges within weeks, and the divergence is INVISIBLE: hosted users * silently get a different product, and nothing goes red." That reasoning is * still right, and it is why this is a filter over one array rather than two * arrays. What the parity test now pins is that the hosted set is a SUBSET * whose shared definitions are byte-identical — a visible, tested divergence * instead of an accidental one. */ export declare const ALL_TOOLS: ({ readonly name: "list_specs"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly filter: { readonly type: "string"; readonly description: string; }; }; readonly additionalProperties: false; }; } | { readonly name: "list_workflows"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly spec_id: { readonly type: "string"; readonly description: "The spec_id returned by import_spec."; }; readonly spec_slug: { readonly type: "string"; readonly description: string; }; }; readonly additionalProperties: false; }; } | { readonly name: "validate_integration"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly providers: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: string; }; readonly app_base_url: { readonly type: "string"; readonly description: string; }; readonly session_id: { readonly type: "string"; readonly description: string; }; }; readonly additionalProperties: false; }; } | { readonly name: "list_runs"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly sandbox_id: { readonly type: "string"; readonly description: "The sandbox_id returned by import_spec."; }; readonly limit: { readonly type: "number"; readonly description: "Max number of runs to return (default 20, server may cap)."; }; }; readonly required: readonly ["sandbox_id"]; readonly additionalProperties: false; }; } | { readonly name: "list_scenarios"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly sandbox_id: { readonly type: "string"; readonly description: "The sandbox_id returned by quickrun, run_workflow or import_spec."; }; }; readonly required: readonly ["sandbox_id"]; readonly additionalProperties: false; }; } | { readonly name: "set_scenario"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly sandbox_id: { readonly type: "string"; readonly description: "The sandbox to arm. From quickrun, run_workflow or import_spec."; }; readonly scenario: { readonly type: "string"; readonly description: string; }; }; readonly required: readonly ["sandbox_id", "scenario"]; readonly additionalProperties: false; }; } | { readonly name: "run_workflow"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly sandbox_id: { readonly type: "string"; readonly description: "The sandbox_id returned by import_spec."; }; readonly workflow_name: { readonly type: "string"; readonly description: string; }; readonly scenario: { readonly type: "string"; readonly description: string; }; }; readonly required: readonly ["sandbox_id", "workflow_name"]; readonly additionalProperties: false; }; } | { readonly name: "run_all_workflows"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly sandbox_id: { readonly type: "string"; readonly description: "The sandbox_id returned by import_spec."; }; readonly workflow_names: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: string; }; }; readonly required: readonly ["sandbox_id"]; readonly additionalProperties: false; }; } | { name: string; description: string; inputSchema: { type: string; properties: { intent: { type: string; description: string; }; hints: { type: string; description: string; properties: { spec: { type: string; description: string; }; workflow: { type: string; description: string; }; scenario: { type: string; description: string; }; }; }; }; required: string[]; }; } | { name: string; description: string; inputSchema: { type: string; properties: { intent: { type: string; description: string; }; session_id: { type: string; description: string; }; user_response: { type: string; description: string; }; context: { type: string; description: string; }; }; }; } | { readonly name: "verify_behavior"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly bug_pattern_id: { readonly type: "string"; readonly description: string; }; readonly prompt: { readonly type: "string"; readonly description: string; }; readonly sandbox_id: { readonly type: "string"; readonly description: string; }; readonly flow_run_id: { readonly type: "string"; readonly description: string; }; }; readonly required: readonly ["bug_pattern_id"]; readonly additionalProperties: false; }; } | { name: string; description: string; inputSchema: { type: string; properties: { sandbox_id: { type: string; description: string; }; flow_run_id: { type: string; description: string; }; bug_pattern_id: { type: string; description: string; }; summary: { type: string; description: string; }; proofs: { type: string; description: string; items: { type: string; properties: { name: { type: string; }; request: { type: string; properties: { method: { type: string; }; path: { type: string; }; body: {}; }; }; before: { type: string; properties: { status: { type: string; }; body: {}; error: { type: string; }; }; }; after: { type: string; properties: { status: { type: string; }; body: {}; error: { type: string; }; }; }; }; required: string[]; }; }; }; required: string[]; }; } | { readonly name: "quickrun"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly spec_slug: { readonly type: "string"; readonly description: "The bundled spec slug from guide (e.g. 'stripe'). Lowercase."; }; readonly workflow_name: { readonly type: "string"; readonly description: "The workflow id from guide (e.g. 'accept_payment')."; }; readonly scenario: { readonly type: "string"; readonly description: string; }; }; readonly required: readonly ["spec_slug", "workflow_name"]; readonly additionalProperties: false; }; } | { readonly name: "find_bugs"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly path: { readonly type: "string"; readonly description: string; }; readonly spec: { readonly type: "string"; readonly description: string; }; readonly timeout_s: { readonly type: "number"; readonly description: "OPTIONAL. Analysis budget in seconds (default 300, max 600)."; }; }; readonly additionalProperties: false; }; } | { readonly name: "fix_bug"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly bug: { readonly type: "string"; readonly description: string; }; readonly fix_pattern: { readonly type: "string"; readonly description: string; }; readonly path: { readonly type: "string"; readonly description: string; }; readonly spec: { readonly type: "string"; readonly description: "OPTIONAL. Grounding hint for the integration (e.g. 'stripe')."; }; readonly timeout_s: { readonly type: "number"; readonly description: "OPTIONAL. Fix budget in seconds (default 300, max 600)."; }; }; readonly required: readonly ["bug"]; readonly additionalProperties: false; }; } | { readonly name: "prove_fix"; readonly description: string; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly diff: { readonly type: "string"; readonly description: "The unified diff returned by fix_bug."; }; readonly bug: { readonly type: "string"; readonly description: "The finding being fixed — used to select FetchSandbox's scenario."; }; readonly scenario: { readonly type: "string"; readonly description: "OPTIONAL. Explicit scenario id, if known."; }; readonly sandbox_id: { readonly type: "string"; readonly description: string; }; readonly path: { readonly type: "string"; readonly description: string; }; readonly timeout_s: { readonly type: "number"; readonly description: "OPTIONAL. Budget in seconds (default 300)."; }; }; readonly required: readonly ["diff"]; readonly additionalProperties: false; }; })[]; /** What a browser-based app builder is shown. MEASURED, not guessed. * * Hosted callers were being offered 17 tools of which FOUR CANNOT WORK: * find_bugs, fix_bug and prove_fix read the filesystem and throw, and * import_spec now redirects. Worse, find_bugs opens "FIRST STEP for any * API-integration bug — reach for this the moment a user reports a symptom", * so the loudest routing claim in the whole list belonged to a tool a Lovable * agent can never call. * * The rest were near-duplicates competing for the same slot: three ways to run * a workflow, four ways to list something. Selection accuracy is measured to * peak at 5–8 tools and degrade past 10–15, and closely-related tools are the * worst case — which is exactly the shape we had. * * Nothing here was removed on taste. Across every hosted session ever served, * exactly seven tools have been called: quickrun, coach, run_workflow, guide, * list_workflows, verify_behavior, submit_proof. Everything dropped below has * zero hosted calls, all time. * * set_scenario and list_scenarios are dropped despite being "the moat": both * require a sandbox_id, list_workflows now returns the scenarios anyway, and * NEITHER HAS EVER BEEN CALLED BY ANY CLIENT, ONCE, in 5,200+ calls. Arming is * reachable through quickrun/run_workflow's `scenario` argument, which is how * the 1.72% of runs that do inject a failure got there. * * STDIO IS UNTOUCHED. Claude Code and Cursor keep all of ALL_TOOLS, byte for * byte: they have a filesystem, they compose tools correctly, and they have a * human in the loop. */ export declare const HOSTED_TOOL_NAMES: Set; export declare function registerHandlers(server: Server): void; export { server };