fetchsandbox-mcp 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -23,10 +23,14 @@ import { listWorkflowsTool, runListWorkflows } from "./tools/list_workflows.js";
23
23
  import { listRunsTool, runListRuns } from "./tools/list_runs.js";
24
24
  import { runRunWorkflow, runWorkflowTool } from "./tools/run_workflow.js";
25
25
  import { runRunAllWorkflows, runAllWorkflowsTool } from "./tools/run_all_workflows.js";
26
- const VERSION = "0.3.2";
26
+ import { guideTool, runGuide } from "./tools/guide.js";
27
+ import { coachTool, runCoach } from "./tools/coach.js";
28
+ const VERSION = "0.3.4";
27
29
  const server = new Server({ name: "fetchsandbox", version: VERSION }, { capabilities: { tools: {} } });
28
30
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
29
31
  tools: [
32
+ coachTool, // listed FIRST — the conversational entry point
33
+ guideTool, // the deterministic single-shot router (still useful)
30
34
  listSpecsTool,
31
35
  importSpecTool,
32
36
  listWorkflowsTool,
@@ -41,6 +45,24 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
41
45
  let result;
42
46
  const a = (args ?? {});
43
47
  switch (name) {
48
+ case coachTool.name:
49
+ result = await runCoach({
50
+ intent: typeof a.intent === "string" ? a.intent : undefined,
51
+ session_id: typeof a.session_id === "string" ? a.session_id : undefined,
52
+ user_response: typeof a.user_response === "string" ? a.user_response : undefined,
53
+ context: (a.context && typeof a.context === "object")
54
+ ? a.context
55
+ : undefined,
56
+ });
57
+ break;
58
+ case guideTool.name:
59
+ result = await runGuide({
60
+ intent: typeof a.intent === "string" ? a.intent : "",
61
+ hints: (a.hints && typeof a.hints === "object")
62
+ ? a.hints
63
+ : undefined,
64
+ });
65
+ break;
44
66
  case listSpecsTool.name:
45
67
  result = await runListSpecs({
46
68
  filter: typeof a.filter === "string" ? a.filter : undefined,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"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pF,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;IACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * `coach` — server-side conversational orchestrator.
3
+ *
4
+ * v0.1 of the MCP-only integration coach (replaces the curl-pipe-to-bash
5
+ * skill install for the conversational flow). The LLM calls `coach` once
6
+ * per turn; the server tracks session state and tells the LLM what to
7
+ * say to the user + what tool (if any) to call next.
8
+ *
9
+ * Call shapes:
10
+ * - First turn: { intent: "<user's ask>" }
11
+ * - Subsequent: { session_id, user_response: "<user's reply>" }
12
+ *
13
+ * The server holds the 7-step state machine (intake → comprehend →
14
+ * elicit → route → prove → propose → done). The LLM is a thin relay:
15
+ * say the `message_for_user`, then act on `next_action`:
16
+ * - "wait_for_user" — say the message, wait for the user's reply,
17
+ * call coach again with their reply
18
+ * - "call_tool" — say the message, call the named `tool_call`
19
+ * with the args, optionally fold the result back
20
+ * into the next coach turn
21
+ * - "done" — say the message, end the integration session
22
+ */
23
+ export interface CoachInput {
24
+ intent?: string;
25
+ session_id?: string;
26
+ user_response?: string;
27
+ context?: Record<string, unknown>;
28
+ }
29
+ export interface CoachOption {
30
+ label: string;
31
+ value: string;
32
+ description?: string;
33
+ }
34
+ export interface CoachResponse {
35
+ session_id: string;
36
+ step: string;
37
+ message_for_user: string;
38
+ next_action: "wait_for_user" | "call_tool" | "done";
39
+ question?: string;
40
+ options?: CoachOption[];
41
+ default_option?: string;
42
+ allow_freeform?: boolean;
43
+ tool_call?: {
44
+ tool: string;
45
+ args: Record<string, unknown>;
46
+ };
47
+ diff?: Record<string, unknown>;
48
+ compliance_notes?: Array<{
49
+ severity: string;
50
+ note: string;
51
+ }>;
52
+ }
53
+ export declare const coachTool: {
54
+ name: string;
55
+ description: string;
56
+ inputSchema: {
57
+ type: string;
58
+ properties: {
59
+ intent: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ session_id: {
64
+ type: string;
65
+ description: string;
66
+ };
67
+ user_response: {
68
+ type: string;
69
+ description: string;
70
+ };
71
+ context: {
72
+ type: string;
73
+ description: string;
74
+ };
75
+ };
76
+ };
77
+ };
78
+ export declare function runCoach(input: CoachInput): Promise<CoachResponse>;
@@ -0,0 +1,63 @@
1
+ import { postJson } from "../client.js";
2
+ export const coachTool = {
3
+ name: "coach",
4
+ description: "Conversational integration coach for FetchSandbox. Server-side " +
5
+ "orchestrator that walks the user through adding an API integration " +
6
+ "(payments / email / auth / etc.) — intake the goal, elicit " +
7
+ "domain-aware discovery questions from the spec's brain.yaml, route " +
8
+ "to the right workflow, prove the contract via FetchSandbox, surface " +
9
+ "compliance notes. Call this BEFORE any other FetchSandbox tool when " +
10
+ "the user has an open-ended 'help me add X', 'integrate X', 'test my X " +
11
+ "integration' ask. " +
12
+ "BEHAVIOR — strict, do exactly this each turn: " +
13
+ "(1) Say `message_for_user` to the user (verbatim or lightly " +
14
+ "paraphrased to fit your voice — but don't add new content). " +
15
+ "(2) If `next_action=wait_for_user` AND `options` is present + " +
16
+ "non-empty: USE YOUR CLIENT'S NATIVE QUESTION-PICKER TOOL (in " +
17
+ "Cursor / Claude Code this is `AskUserQuestion`) to render the " +
18
+ "lettered picker with the `question` text, the `options[].label` " +
19
+ "as rows, `default_option` as default, and an 'Other...' freeform " +
20
+ "row when `allow_freeform=true`. When the user picks or types, " +
21
+ "call coach again with `{session_id, user_response: <picked " +
22
+ "value or freeform text>}`. " +
23
+ "(3) If `next_action=wait_for_user` AND no `options`: just wait " +
24
+ "for free text. " +
25
+ "(4) If `next_action=call_tool`: invoke `tool_call.tool` with " +
26
+ "`tool_call.args`, then call coach again with the result in " +
27
+ "`context`. " +
28
+ "(5) If `next_action=done`: end the session. " +
29
+ "The state machine is server-side — DON'T try to predict the next " +
30
+ "step or skip ahead; let the server drive.",
31
+ inputSchema: {
32
+ type: "object",
33
+ properties: {
34
+ intent: {
35
+ type: "string",
36
+ description: "User's free-form integration ask, on the FIRST call only. " +
37
+ "Pass through verbatim — the server's intent router benefits " +
38
+ "from the full phrasing.",
39
+ },
40
+ session_id: {
41
+ type: "string",
42
+ description: "Returned by a previous coach call. Required on every call " +
43
+ "after the first.",
44
+ },
45
+ user_response: {
46
+ type: "string",
47
+ description: "The user's reply to the previous coach turn's question. " +
48
+ "Required when the previous turn returned `next_action: " +
49
+ "wait_for_user`.",
50
+ },
51
+ context: {
52
+ type: "object",
53
+ description: "Optional context the LLM brings to the turn — e.g. a " +
54
+ "summary of the user's repo (if you ran an introspect step), " +
55
+ "or the result of a previously-instructed `tool_call`.",
56
+ },
57
+ },
58
+ },
59
+ };
60
+ export async function runCoach(input) {
61
+ return postJson("/api/mcp/coach", input);
62
+ }
63
+ //# sourceMappingURL=coach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coach.js","sourceRoot":"","sources":["../../src/tools/coach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAuDxC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,WAAW,EACT,iEAAiE;QACjE,qEAAqE;QACrE,6DAA6D;QAC7D,qEAAqE;QACrE,sEAAsE;QACtE,sEAAsE;QACtE,wEAAwE;QACxE,oBAAoB;QACpB,gDAAgD;QAChD,8DAA8D;QAC9D,8DAA8D;QAC9D,gEAAgE;QAChE,+DAA+D;QAC/D,gEAAgE;QAChE,kEAAkE;QAClE,mEAAmE;QACnE,gEAAgE;QAChE,6DAA6D;QAC7D,6BAA6B;QAC7B,iEAAiE;QACjE,iBAAiB;QACjB,+DAA+D;QAC/D,6DAA6D;QAC7D,aAAa;QACb,8CAA8C;QAC9C,mEAAmE;QACnE,2CAA2C;IAC7C,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4DAA4D;oBAC5D,8DAA8D;oBAC9D,yBAAyB;aAC5B;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4DAA4D;oBAC5D,kBAAkB;aACrB;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,0DAA0D;oBAC1D,yDAAyD;oBACzD,iBAAiB;aACpB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uDAAuD;oBACvD,8DAA8D;oBAC9D,uDAAuD;aAC1D;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAiB;IAC9C,OAAO,QAAQ,CAAgB,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Guided integration router — Phase 1.
3
+ *
4
+ * Maps a developer's free-form intent (e.g. "test my stripe integration"
5
+ * or "help me set up Paddle subscriptions") to a concrete spec + workflow
6
+ * + optional failure scenario. Used when the user doesn't name an exact
7
+ * workflow but wants the right Tier-1 default for their goal.
8
+ *
9
+ * Phase 1 is routing-only — returns the resolved triple without running
10
+ * the workflow. Sessions, branching, evidence canvas come in Phase 2+
11
+ * (see docs/guided-integration-experience-2026-05-20.md).
12
+ *
13
+ * Calls POST /api/mcp/route on the backend. The backend reads the
14
+ * spec configs deterministically — no LLM in the routing path, so demos
15
+ * are reproducible.
16
+ */
17
+ export interface GuideInput {
18
+ intent: string;
19
+ hints?: {
20
+ spec?: string;
21
+ workflow?: string;
22
+ scenario?: string;
23
+ };
24
+ }
25
+ export interface GuideResponse {
26
+ spec: string | null;
27
+ workflow: string | null;
28
+ scenario: string | null;
29
+ confidence: number;
30
+ reasoning: string;
31
+ matched_signals: string[];
32
+ /**
33
+ * Phase 1.5: when the routed spec has a brain.yaml (currently stripe
34
+ * only — Tier-1 specs will be backfilled), the first discovery
35
+ * question is included so the LLM client can ask the dev WITHOUT a
36
+ * second router round-trip. Shape mirrors the brain.yaml schema:
37
+ * { id, question, options: [{value, label, implies?}], default? }
38
+ * or for tiered questions:
39
+ * { id, question, tiers: [{label, scenarios}], default_tier? }
40
+ * Null when no brain exists for the spec.
41
+ */
42
+ next_question?: Record<string, unknown> | null;
43
+ }
44
+ export declare const guideTool: {
45
+ name: string;
46
+ description: string;
47
+ inputSchema: {
48
+ type: string;
49
+ properties: {
50
+ intent: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ hints: {
55
+ type: string;
56
+ description: string;
57
+ properties: {
58
+ spec: {
59
+ type: string;
60
+ description: string;
61
+ };
62
+ workflow: {
63
+ type: string;
64
+ description: string;
65
+ };
66
+ scenario: {
67
+ type: string;
68
+ description: string;
69
+ };
70
+ };
71
+ };
72
+ };
73
+ required: string[];
74
+ };
75
+ };
76
+ export declare function runGuide(input: GuideInput): Promise<GuideResponse>;
@@ -0,0 +1,46 @@
1
+ import { postJson } from "../client.js";
2
+ export const guideTool = {
3
+ name: "guide",
4
+ description: "Resolve a developer's free-form integration intent (e.g. 'test my " +
5
+ "stripe integration', 'help me set up Paddle subscriptions', 'I'm " +
6
+ "getting card_declined errors on Stripe') to the right proof-grade " +
7
+ "Tier-1 workflow + failure scenario. Use this BEFORE run_workflow " +
8
+ "when the user names a spec or a domain (payments, email, phone) " +
9
+ "but not an exact workflow ID — the router picks the spec's " +
10
+ "Tier-1 default deterministically, so the same prompt always hits " +
11
+ "the same proof-verified flow. Returns {spec, workflow, scenario, " +
12
+ "confidence, reasoning, next_question}. If confidence ≥ 0.75, " +
13
+ "follow up with run_workflow using the returned spec + workflow. " +
14
+ "If confidence < 0.75, ask the user a clarifying question (the " +
15
+ "reasoning field explains why the match was weak). If " +
16
+ "next_question is non-null, ask the user THAT question first " +
17
+ "(it's a domain-aware discovery question from the spec's brain — " +
18
+ "e.g. 'Where are your customers based?' — and its answer picks " +
19
+ "the right test data + scenarios for the run).",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {
23
+ intent: {
24
+ type: "string",
25
+ description: "The developer's free-form prompt as they typed it. Don't " +
26
+ "pre-process or shorten — the router benefits from the full " +
27
+ "phrasing (capture timing, geo cues, failure mode language).",
28
+ },
29
+ hints: {
30
+ type: "object",
31
+ description: "Optional caller-supplied overrides. Each field short-circuits " +
32
+ "the corresponding detection step.",
33
+ properties: {
34
+ spec: { type: "string", description: "Force a specific spec slug." },
35
+ workflow: { type: "string", description: "Force a specific workflow_id." },
36
+ scenario: { type: "string", description: "Force a specific failure scenario name." },
37
+ },
38
+ },
39
+ },
40
+ required: ["intent"],
41
+ },
42
+ };
43
+ export async function runGuide(input) {
44
+ return postJson("/api/mcp/route", input);
45
+ }
46
+ //# sourceMappingURL=guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide.js","sourceRoot":"","sources":["../../src/tools/guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAgDxC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,WAAW,EACT,oEAAoE;QACpE,mEAAmE;QACnE,oEAAoE;QACpE,mEAAmE;QACnE,kEAAkE;QAClE,6DAA6D;QAC7D,mEAAmE;QACnE,mEAAmE;QACnE,+DAA+D;QAC/D,kEAAkE;QAClE,gEAAgE;QAChE,uDAAuD;QACvD,8DAA8D;QAC9D,kEAAkE;QAClE,gEAAgE;QAChE,+CAA+C;IACjD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,2DAA2D;oBAC3D,6DAA6D;oBAC7D,6DAA6D;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gEAAgE;oBAChE,mCAAmC;gBACrC,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;oBACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;oBAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;iBACrF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAiB;IAC9C,OAAO,QAAQ,CAAgB,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAC1D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fetchsandbox-mcp",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "mcpName": "io.github.fetchsandbox/mcp",
5
5
  "description": "Turn any OpenAPI spec into a working sandbox your AI agent can use. MCP server for Claude Code, Cursor, and any other MCP-compatible LLM IDE.",
6
6
  "license": "MIT",