fetchsandbox-mcp 0.3.6 → 0.3.8
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/README.md +8 -8
- package/dist/client.js +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +28 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/verify_behavior.d.ts +65 -0
- package/dist/tools/verify_behavior.js +73 -0
- package/dist/tools/verify_behavior.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ File: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
|
26
26
|
"mcpServers": {
|
|
27
27
|
"fetchsandbox": {
|
|
28
28
|
"command": "npx",
|
|
29
|
-
"args": ["-y", "fetchsandbox-mcp"]
|
|
29
|
+
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -43,7 +43,7 @@ User-level (all projects): `~/.claude/settings.json`. Or project-level: `.mcp.js
|
|
|
43
43
|
"mcpServers": {
|
|
44
44
|
"fetchsandbox": {
|
|
45
45
|
"command": "npx",
|
|
46
|
-
"args": ["-y", "fetchsandbox-mcp"]
|
|
46
|
+
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -60,7 +60,7 @@ File: `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project)
|
|
|
60
60
|
"mcpServers": {
|
|
61
61
|
"fetchsandbox": {
|
|
62
62
|
"command": "npx",
|
|
63
|
-
"args": ["-y", "fetchsandbox-mcp"]
|
|
63
|
+
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -73,7 +73,7 @@ Restart Cursor.
|
|
|
73
73
|
Open the Cline panel → settings cog → MCP Servers → add a new server with:
|
|
74
74
|
|
|
75
75
|
- Command: `npx`
|
|
76
|
-
- Args: `-y fetchsandbox-mcp`
|
|
76
|
+
- Args: `-y fetchsandbox-mcp@latest`
|
|
77
77
|
|
|
78
78
|
Reload the VS Code window.
|
|
79
79
|
|
|
@@ -87,7 +87,7 @@ mcpServers:
|
|
|
87
87
|
command: npx
|
|
88
88
|
args:
|
|
89
89
|
- -y
|
|
90
|
-
- fetchsandbox-mcp
|
|
90
|
+
- fetchsandbox-mcp@latest
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
Restart your IDE.
|
|
@@ -99,7 +99,7 @@ File: `~/.codex/config.toml`
|
|
|
99
99
|
```toml
|
|
100
100
|
[mcp_servers.fetchsandbox]
|
|
101
101
|
command = "npx"
|
|
102
|
-
args = ["-y", "fetchsandbox-mcp"]
|
|
102
|
+
args = ["-y", "fetchsandbox-mcp@latest"]
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Restart Codex.
|
|
@@ -114,7 +114,7 @@ File: `~/.config/zed/settings.json`
|
|
|
114
114
|
"fetchsandbox": {
|
|
115
115
|
"command": {
|
|
116
116
|
"path": "npx",
|
|
117
|
-
"args": ["-y", "fetchsandbox-mcp"]
|
|
117
|
+
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -130,7 +130,7 @@ GitHub Copilot doesn't currently support the Model Context Protocol. Track [gith
|
|
|
130
130
|
If your agent speaks MCP, it accepts a stdio command. Use:
|
|
131
131
|
|
|
132
132
|
- Command: `npx`
|
|
133
|
-
- Args: `["-y", "fetchsandbox-mcp"]`
|
|
133
|
+
- Args: `["-y", "fetchsandbox-mcp@latest"]`
|
|
134
134
|
|
|
135
135
|
## Try it now
|
|
136
136
|
|
package/dist/client.js
CHANGED
|
@@ -29,7 +29,7 @@ export function getBaseUrl() {
|
|
|
29
29
|
function buildHeaders(extra) {
|
|
30
30
|
const ide = detectIde();
|
|
31
31
|
const headers = {
|
|
32
|
-
"user-agent": `fetchsandbox-mcp/0.3.
|
|
32
|
+
"user-agent": `fetchsandbox-mcp/0.3.8 (node ${process.version}; ide=${ide})`,
|
|
33
33
|
accept: "application/json",
|
|
34
34
|
...(extra ?? {}),
|
|
35
35
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
declare const server: Server<{
|
|
4
|
+
method: string;
|
|
5
|
+
params?: {
|
|
6
|
+
[x: string]: unknown;
|
|
7
|
+
_meta?: {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
progressToken?: string | number | undefined;
|
|
10
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
11
|
+
taskId: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
method: string;
|
|
17
|
+
params?: {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
_meta?: {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
progressToken?: string | number | undefined;
|
|
22
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
23
|
+
taskId: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
_meta?: {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
progressToken?: string | number | undefined;
|
|
32
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
33
|
+
taskId: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
} | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export { server };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Distribution: npx -y fetchsandbox-mcp.
|
|
14
14
|
*/
|
|
15
|
+
import { pathToFileURL } from "node:url";
|
|
15
16
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
16
17
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
17
18
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -25,7 +26,8 @@ import { runRunWorkflow, runWorkflowTool } from "./tools/run_workflow.js";
|
|
|
25
26
|
import { runRunAllWorkflows, runAllWorkflowsTool } from "./tools/run_all_workflows.js";
|
|
26
27
|
import { guideTool, runGuide } from "./tools/guide.js";
|
|
27
28
|
import { coachTool, runCoach } from "./tools/coach.js";
|
|
28
|
-
|
|
29
|
+
import { verifyBehaviorTool, runVerifyBehavior } from "./tools/verify_behavior.js";
|
|
30
|
+
const VERSION = "0.3.8";
|
|
29
31
|
const server = new Server({ name: "fetchsandbox", version: VERSION }, { capabilities: { tools: {} } });
|
|
30
32
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
31
33
|
tools: [
|
|
@@ -36,6 +38,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
36
38
|
listWorkflowsTool,
|
|
37
39
|
runAllWorkflowsTool,
|
|
38
40
|
runWorkflowTool,
|
|
41
|
+
verifyBehaviorTool,
|
|
39
42
|
listRunsTool,
|
|
40
43
|
],
|
|
41
44
|
}));
|
|
@@ -90,6 +93,10 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
90
93
|
result = await runRunWorkflow({
|
|
91
94
|
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
92
95
|
workflow_name: typeof a.workflow_name === "string" ? a.workflow_name : "",
|
|
96
|
+
// scenario was dropped here (schema + runRunWorkflow both support it),
|
|
97
|
+
// silently forcing the happy path — the exact "agent skipped the proof"
|
|
98
|
+
// failure this product exists to prevent. Forward it. (2026-07-15)
|
|
99
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
93
100
|
});
|
|
94
101
|
break;
|
|
95
102
|
case runAllWorkflowsTool.name:
|
|
@@ -100,6 +107,14 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
100
107
|
: undefined,
|
|
101
108
|
});
|
|
102
109
|
break;
|
|
110
|
+
case verifyBehaviorTool.name:
|
|
111
|
+
result = await runVerifyBehavior({
|
|
112
|
+
bug_pattern_id: typeof a.bug_pattern_id === "string" ? a.bug_pattern_id : "",
|
|
113
|
+
prompt: typeof a.prompt === "string" ? a.prompt : undefined,
|
|
114
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : undefined,
|
|
115
|
+
flow_run_id: typeof a.flow_run_id === "string" ? a.flow_run_id : undefined,
|
|
116
|
+
});
|
|
117
|
+
break;
|
|
103
118
|
default:
|
|
104
119
|
throw new ToolError(`Unknown tool: ${name}`);
|
|
105
120
|
}
|
|
@@ -163,8 +178,16 @@ async function main() {
|
|
|
163
178
|
const transport = new StdioServerTransport();
|
|
164
179
|
await server.connect(transport);
|
|
165
180
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
181
|
+
// Export the configured server so integration tests can drive it over an
|
|
182
|
+
// in-memory transport — the real Claude/Cursor call loop, minus the OS process.
|
|
183
|
+
export { server };
|
|
184
|
+
// Only auto-connect stdio when run as the actual CLI entrypoint
|
|
185
|
+
// (npx fetchsandbox-mcp), NOT when imported by a test.
|
|
186
|
+
const invokedAsCli = !!process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
187
|
+
if (invokedAsCli) {
|
|
188
|
+
main().catch((err) => {
|
|
189
|
+
process.stderr.write(`[fetchsandbox-mcp] fatal: ${err?.stack ?? err}\n`);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
170
193
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA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,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,2CAA2C;IAC3C,OAAO,YAAY,QAAQ,KAAK,GAAG,EAAE,CAAC;AACxC,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,kEAAkE;IAClE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qBAAqB,OAAO,kBAAkB,UAAU,EAAE,SAAS,SAAS,EAAE,KAAK,CACpF,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,yEAAyE;AACzE,gFAAgF;AAChF,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,gEAAgE;AAChE,uDAAuD;AACvD,MAAM,YAAY,GAChB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE/E,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behavioral proof — the "prove the fix" half of reproduce→prove.
|
|
3
|
+
*
|
|
4
|
+
* Given a bug_pattern that declares a `simulation:` block, the backend spawns
|
|
5
|
+
* two reference handler containers (a buggy one and a fixed one), fires the
|
|
6
|
+
* pattern's probes at both, and returns the side-by-side diff — e.g. the buggy
|
|
7
|
+
* handler double-charges on a duplicate webhook, the fixed one dedupes.
|
|
8
|
+
*
|
|
9
|
+
* Call this AFTER run_workflow reproduces a failure, to prove a known fix
|
|
10
|
+
* actually survives it (not just that the failure happened). Pass sandbox_id +
|
|
11
|
+
* flow_run_id from the run so the diff is saved onto that run's receipt.
|
|
12
|
+
*
|
|
13
|
+
* Calls POST /api/mcp/verify_behavior. The buggy/fixed handlers are
|
|
14
|
+
* FetchSandbox reference implementations, NOT the user's code — the diff proves
|
|
15
|
+
* the pattern is real and the brain's fix_pattern works; the user applies that
|
|
16
|
+
* fix_pattern to inherit the behavior.
|
|
17
|
+
*/
|
|
18
|
+
export interface VerifyBehaviorInput {
|
|
19
|
+
bug_pattern_id: string;
|
|
20
|
+
prompt?: string;
|
|
21
|
+
sandbox_id?: string;
|
|
22
|
+
flow_run_id?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface NormalizedVerifyResult {
|
|
25
|
+
pattern_id?: string;
|
|
26
|
+
mode?: string;
|
|
27
|
+
confirmed: boolean;
|
|
28
|
+
disclaimer?: string;
|
|
29
|
+
probes: Array<{
|
|
30
|
+
name?: string;
|
|
31
|
+
buggy_status?: number;
|
|
32
|
+
fixed_status?: number;
|
|
33
|
+
diff_observed: boolean;
|
|
34
|
+
verdict?: string;
|
|
35
|
+
}>;
|
|
36
|
+
duration_ms?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare const verifyBehaviorTool: {
|
|
39
|
+
readonly name: "verify_behavior";
|
|
40
|
+
readonly description: string;
|
|
41
|
+
readonly inputSchema: {
|
|
42
|
+
readonly type: "object";
|
|
43
|
+
readonly properties: {
|
|
44
|
+
readonly bug_pattern_id: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly description: string;
|
|
47
|
+
};
|
|
48
|
+
readonly prompt: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly description: string;
|
|
51
|
+
};
|
|
52
|
+
readonly sandbox_id: {
|
|
53
|
+
readonly type: "string";
|
|
54
|
+
readonly description: string;
|
|
55
|
+
};
|
|
56
|
+
readonly flow_run_id: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
readonly description: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly required: readonly ["bug_pattern_id"];
|
|
62
|
+
readonly additionalProperties: false;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export declare function runVerifyBehavior(input: VerifyBehaviorInput): Promise<NormalizedVerifyResult>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ToolError, postJson } from "../client.js";
|
|
2
|
+
export const verifyBehaviorTool = {
|
|
3
|
+
name: "verify_behavior",
|
|
4
|
+
description: "Prove a known fix survives a bug — the 'prove' half of reproduce→prove. " +
|
|
5
|
+
"The backend spawns a buggy AND a fixed reference handler and fires the " +
|
|
6
|
+
"bug_pattern's probes at both, returning the side-by-side diff (e.g. the " +
|
|
7
|
+
"buggy handler double-charges on a duplicate webhook, the fixed handler " +
|
|
8
|
+
"dedupes). Call this AFTER run_workflow reproduces a failure, when the " +
|
|
9
|
+
"matched bug_pattern has a simulation block, to show the fix actually " +
|
|
10
|
+
"holds — not just that the failure reproduced. Pass sandbox_id + " +
|
|
11
|
+
"flow_run_id from the run so the diff is saved onto that run's receipt " +
|
|
12
|
+
"URL. bug_pattern_id comes from guide's matched_bug_pattern. The buggy/" +
|
|
13
|
+
"fixed handlers are FetchSandbox reference implementations, NOT the user's " +
|
|
14
|
+
"code — apply the brain's fix_pattern to inherit the proven behavior.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
bug_pattern_id: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "The bug_pattern to prove (e.g. webhook_duplicate_side_effect). " +
|
|
21
|
+
"Comes from guide's matched_bug_pattern.id or the spec's brain.",
|
|
22
|
+
},
|
|
23
|
+
prompt: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "OPTIONAL. The user's own description of the symptom. For patterns " +
|
|
26
|
+
"that can originate in the handler OR the provider, this classifies " +
|
|
27
|
+
"which side to simulate. Omit to run both.",
|
|
28
|
+
},
|
|
29
|
+
sandbox_id: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "OPTIONAL. The sandbox from the run. Pass with flow_run_id to save " +
|
|
32
|
+
"the diff onto that run's receipt.",
|
|
33
|
+
},
|
|
34
|
+
flow_run_id: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "OPTIONAL. The flow_run_id returned by run_workflow. Pass with " +
|
|
37
|
+
"sandbox_id so the receipt URL renders the diff alongside the steps.",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: ["bug_pattern_id"],
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export async function runVerifyBehavior(input) {
|
|
45
|
+
if (!input.bug_pattern_id)
|
|
46
|
+
throw new ToolError("bug_pattern_id is required.");
|
|
47
|
+
const body = { bug_pattern_id: input.bug_pattern_id };
|
|
48
|
+
if (input.prompt && input.prompt.trim())
|
|
49
|
+
body.prompt = input.prompt.trim();
|
|
50
|
+
if (input.sandbox_id)
|
|
51
|
+
body.sandbox_id = input.sandbox_id;
|
|
52
|
+
if (input.flow_run_id)
|
|
53
|
+
body.flow_run_id = input.flow_run_id;
|
|
54
|
+
const raw = await postJson("/api/mcp/verify_behavior", body);
|
|
55
|
+
const probes = (raw.probes ?? []).map((p) => ({
|
|
56
|
+
name: p.name,
|
|
57
|
+
buggy_status: p.buggy_response?.status,
|
|
58
|
+
fixed_status: p.fixed_response?.status,
|
|
59
|
+
diff_observed: p.expected_diff_observed ?? false,
|
|
60
|
+
verdict: p.verdict,
|
|
61
|
+
}));
|
|
62
|
+
return {
|
|
63
|
+
pattern_id: raw.pattern_id,
|
|
64
|
+
mode: raw.mode,
|
|
65
|
+
// Full response bodies live on the receipt; the tool returns the verdict-
|
|
66
|
+
// level diff so the agent's transcript stays small.
|
|
67
|
+
confirmed: probes.length > 0 && probes.every((p) => p.diff_observed),
|
|
68
|
+
disclaimer: raw.disclaimer,
|
|
69
|
+
probes,
|
|
70
|
+
duration_ms: raw.duration_ms,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=verify_behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify_behavior.js","sourceRoot":"","sources":["../../src/tools/verify_behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA4DnD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,0EAA0E;QAC1E,yEAAyE;QACzE,0EAA0E;QAC1E,yEAAyE;QACzE,wEAAwE;QACxE,uEAAuE;QACvE,kEAAkE;QAClE,wEAAwE;QACxE,wEAAwE;QACxE,4EAA4E;QAC5E,sEAAsE;IACxE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,iEAAiE;oBACjE,gEAAgE;aACnE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,oEAAoE;oBACpE,qEAAqE;oBACrE,2CAA2C;aAC9C;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,oEAAoE;oBACpE,mCAAmC;aACtC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gEAAgE;oBAChE,qEAAqE;aACxE;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,CAAC;QAC5B,oBAAoB,EAAE,KAAK;KAC5B;CACO,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAA0B;IAE1B,IAAI,CAAC,KAAK,CAAC,cAAc;QAAE,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;IAC9E,MAAM,IAAI,GAA4B,EAAE,cAAc,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-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
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",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"build": "tsc",
|
|
38
38
|
"dev": "tsc --watch",
|
|
39
39
|
"start": "node dist/index.js",
|
|
40
|
-
"
|
|
40
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
41
|
+
"prepublishOnly": "npm run build && npm test"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@modelcontextprotocol/sdk": "^1.0.0"
|