fetchsandbox-mcp 0.5.6 → 0.5.7
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/client.js +14 -4
- package/dist/client.js.map +1 -1
- package/dist/http.d.ts +1 -0
- package/dist/http.js +249 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +200 -159
- package/dist/index.js.map +1 -1
- package/dist/request_context.d.ts +30 -0
- package/dist/request_context.js +74 -0
- package/dist/request_context.js.map +1 -0
- package/dist/signin.js +30 -0
- package/dist/signin.js.map +1 -1
- package/dist/tools/scenarios.d.ts +56 -0
- package/dist/tools/scenarios.js +115 -0
- package/dist/tools/scenarios.js.map +1 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { detectIde, getSessionId } from "./session.js";
|
|
11
11
|
import { readCredentials } from "./auth.js";
|
|
12
|
+
import { currentIdentity } from "./request_context.js";
|
|
12
13
|
import { VERSION } from "./version.js";
|
|
13
14
|
const DEFAULT_BASE_URL = "https://fetchsandbox.com";
|
|
14
15
|
const REQUEST_TIMEOUT_MS = 30_000;
|
|
@@ -42,13 +43,22 @@ export function buildHeaders(extra) {
|
|
|
42
43
|
const sid = getSessionId();
|
|
43
44
|
if (sid)
|
|
44
45
|
headers["x-mcp-session-id"] = sid;
|
|
45
|
-
|
|
46
|
+
// A hosted request knows its platform from Origin; stdio knows its editor
|
|
47
|
+
// from env. Whichever is present is the truthful answer.
|
|
48
|
+
headers["x-mcp-client"] = currentIdentity()?.platform || ide;
|
|
46
49
|
// The session id IS the install id (see auth.ts) and the backend already
|
|
47
50
|
// reads that header everywhere, so a key is the only thing to add. Absent
|
|
48
51
|
// credentials send nothing and the request behaves exactly as it did before.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
//
|
|
53
|
+
// ORDER MATTERS. A hosted request carries its OWN caller's key in the async
|
|
54
|
+
// context, and that must beat anything cached on disk or in the module —
|
|
55
|
+
// otherwise one tenant's key serves another tenant's request. stdio and CI
|
|
56
|
+
// never enter a request scope, so they fall through to exactly the source
|
|
57
|
+
// they used before. See request_context.ts for the leak this prevents.
|
|
58
|
+
const perRequest = currentIdentity()?.apiKey;
|
|
59
|
+
const apiKey = perRequest || readCredentials()?.apiKey;
|
|
60
|
+
if (apiKey)
|
|
61
|
+
headers["authorization"] = `Bearer ${apiKey}`;
|
|
52
62
|
return headers;
|
|
53
63
|
}
|
|
54
64
|
async function readErrorMessage(res) {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,wEAAwE;AACxE,gEAAgE;AAChE,6EAA6E;AAC7E,gFAAgF;AAChF,8EAA8E;AAC9E,yEAAyE;AACzE,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAChD,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,MAAM,CAAU;IAChB,YAAY,OAAe,EAAE,MAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,MAAM,UAA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,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,SAAS,CAAC,MAAM,gBAAgB,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1E,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;IACjC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,SAAS;YAAE,MAAM,CAAC,CAAC;QACpC,IAAK,CAAW,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACvC,MAAM,IAAI,SAAS,CACjB,2BAA2B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,IAAI,EAAE,CAC5E,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,yBAAyB,IAAI,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAI,IAAY;IAC3C,MAAM,GAAG,GAAG,GAAG,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC;IACrC,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAChF,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAM,CAAC;AACjC,CAAC"}
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/http.js
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HOSTED entry point. Same tools, same handlers, over streamable HTTP.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS
|
|
5
|
+
*
|
|
6
|
+
* Lovable, Bolt, Replit and Base44 all require a remote MCP URL. None of them
|
|
7
|
+
* can spawn a local process, so `npx fetchsandbox-mcp` — the only transport we
|
|
8
|
+
* had — means those users literally cannot add us. Verified 2026-09-19 against
|
|
9
|
+
* each platform's own documentation, and by sending a real MCP `initialize` to
|
|
10
|
+
* /mcp, /api/mcp, /sse and /api/mcp/sse, which answered 405/404/404/404.
|
|
11
|
+
*
|
|
12
|
+
* All four accept a static bearer or header instead of OAuth, so this one
|
|
13
|
+
* build serves all four and OAuth stays a later, directory-specific concern.
|
|
14
|
+
*
|
|
15
|
+
* WHAT IT IS NOT
|
|
16
|
+
*
|
|
17
|
+
* Not a second implementation. It imports `createServer` and
|
|
18
|
+
* `registerHandlers` from index.ts, so the 14 tool definitions, their
|
|
19
|
+
* annotations and their dispatch are the SAME objects stdio uses. A
|
|
20
|
+
* hand-written tool list here would drift within weeks and the drift would be
|
|
21
|
+
* invisible — hosted users silently getting a different product. The parity
|
|
22
|
+
* test pins it.
|
|
23
|
+
*
|
|
24
|
+
* STATELESS, DELIBERATELY
|
|
25
|
+
*
|
|
26
|
+
* `sessionIdGenerator: undefined`. Every piece of state we have already lives
|
|
27
|
+
* server-side and is addressed by `sandbox_id`, which the tools pass
|
|
28
|
+
* explicitly. There is nothing for a session to hold. Stateless means no
|
|
29
|
+
* session store, no sticky routing, and horizontal scale for free; stateful
|
|
30
|
+
* would add a failure mode for state we do not have.
|
|
31
|
+
*
|
|
32
|
+
* AUTH FORWARDS, IT NEVER DECIDES
|
|
33
|
+
*
|
|
34
|
+
* The caller's Authorization header is passed through to the backend, which
|
|
35
|
+
* runs IdentityMiddleware and RequireAuthMiddleware exactly as it does for the
|
|
36
|
+
* stdio client. This process holds no user table and validates no key. One
|
|
37
|
+
* source of truth for auth, so a hosted caller and a local caller can never
|
|
38
|
+
* get different answers about who may spend.
|
|
39
|
+
*/
|
|
40
|
+
import { randomUUID } from "node:crypto";
|
|
41
|
+
import { createServer as createHttpServer } from "node:http";
|
|
42
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
43
|
+
import { createServer, registerHandlers } from "./index.js";
|
|
44
|
+
import { withRequestIdentity } from "./request_context.js";
|
|
45
|
+
import { VERSION } from "./version.js";
|
|
46
|
+
const PORT = Number(process.env.PORT || 8787);
|
|
47
|
+
const PATH = process.env.MCP_HTTP_PATH || "/mcp/v1";
|
|
48
|
+
/**
|
|
49
|
+
* Bind LOOPBACK by default.
|
|
50
|
+
*
|
|
51
|
+
* The MCP security guidance is explicit: an HTTP MCP server running locally
|
|
52
|
+
* binds 127.0.0.1, not 0.0.0.0, or any process on the network can drive it.
|
|
53
|
+
* In a container the orchestrator needs 0.0.0.0, so it is overridable — but
|
|
54
|
+
* the default is the safe one, because the unsafe default is the one people
|
|
55
|
+
* ship by accident.
|
|
56
|
+
*/
|
|
57
|
+
const HOST = process.env.MCP_HTTP_HOST || "127.0.0.1";
|
|
58
|
+
/**
|
|
59
|
+
* Hard ceiling on a single tool call.
|
|
60
|
+
*
|
|
61
|
+
* Measured 2026-09-19: verify_behavior took 53.9s against prod and returned
|
|
62
|
+
* 504 on a first attempt; Cloudflare cuts at ~100s. A request with no ceiling
|
|
63
|
+
* of our own becomes a zombie holding a connection until the edge kills it,
|
|
64
|
+
* and the caller sees an opaque gateway error instead of ours. Ending it
|
|
65
|
+
* ourselves, just inside the edge's limit, means the agent gets a JSON-RPC
|
|
66
|
+
* error it can act on.
|
|
67
|
+
*/
|
|
68
|
+
const REQUEST_TIMEOUT_MS = Number(process.env.MCP_REQUEST_TIMEOUT_MS || 90_000);
|
|
69
|
+
/**
|
|
70
|
+
* Origins allowed to drive this endpoint.
|
|
71
|
+
*
|
|
72
|
+
* The MCP spec requires an HTTP server to validate Origin: without it a
|
|
73
|
+
* hostile page in a user's browser can drive a local or credentialed MCP
|
|
74
|
+
* server (DNS rebinding). A request with no Origin at all is a server-to-
|
|
75
|
+
* server call and is allowed — that is how every one of these platforms
|
|
76
|
+
* actually calls us.
|
|
77
|
+
*/
|
|
78
|
+
const ALLOWED_ORIGINS = (process.env.MCP_ALLOWED_ORIGINS ||
|
|
79
|
+
"https://lovable.dev,https://bolt.new,https://replit.com,https://app.base44.com,https://fetchsandbox.com")
|
|
80
|
+
.split(",").map((s) => s.trim()).filter(Boolean);
|
|
81
|
+
/**
|
|
82
|
+
* Which platform is calling.
|
|
83
|
+
*
|
|
84
|
+
* `detectIde()` reads process ENV VARS, which the editor sets when it spawns
|
|
85
|
+
* the stdio client. A container has no such env, so every hosted request
|
|
86
|
+
* would report the same thing and Lovable, Bolt and Replit would land in one
|
|
87
|
+
* undifferentiated bucket — you could not tell which platform retains.
|
|
88
|
+
*
|
|
89
|
+
* Origin is the signal we already validate, so it costs nothing to reuse. The
|
|
90
|
+
* backend records `x-mcp-client` today, so setting it here splits retention by
|
|
91
|
+
* platform with no telemetry change at all.
|
|
92
|
+
*/
|
|
93
|
+
function callerPlatform(req) {
|
|
94
|
+
const origin = (req.headers.origin || "").toLowerCase();
|
|
95
|
+
const ua = String(req.headers["user-agent"] || "").toLowerCase();
|
|
96
|
+
const hay = origin + " " + ua;
|
|
97
|
+
for (const [needle, name] of [
|
|
98
|
+
["lovable", "lovable"], ["bolt.new", "bolt"], ["stackblitz", "bolt"],
|
|
99
|
+
["replit", "replit"], ["base44", "base44"],
|
|
100
|
+
["claude", "claude"], ["cursor", "cursor"], ["openai", "chatgpt"],
|
|
101
|
+
]) {
|
|
102
|
+
if (hay.includes(needle))
|
|
103
|
+
return name;
|
|
104
|
+
}
|
|
105
|
+
// Honest default. "unknown" is a real answer; guessing a platform would
|
|
106
|
+
// put made-up rows in the retention split.
|
|
107
|
+
return "hosted-unknown";
|
|
108
|
+
}
|
|
109
|
+
function originAllowed(req) {
|
|
110
|
+
const origin = req.headers.origin;
|
|
111
|
+
if (!origin)
|
|
112
|
+
return true; // server-to-server, no browser
|
|
113
|
+
return ALLOWED_ORIGINS.includes(origin);
|
|
114
|
+
}
|
|
115
|
+
function json(res, status, body) {
|
|
116
|
+
const payload = JSON.stringify(body);
|
|
117
|
+
res.writeHead(status, { "content-type": "application/json" });
|
|
118
|
+
res.end(payload);
|
|
119
|
+
}
|
|
120
|
+
/** A JSON-RPC error, which is what an MCP client can actually parse. */
|
|
121
|
+
function rpcError(res, status, code, message, data) {
|
|
122
|
+
res.writeHead(status, { "content-type": "application/json" });
|
|
123
|
+
res.end(JSON.stringify({ jsonrpc: "2.0", id: null,
|
|
124
|
+
error: { code, message, ...(data ? { data } : {}) } }));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A FRESH server + transport per request. This is what stateless actually means.
|
|
128
|
+
*
|
|
129
|
+
* The first version connected one server to one transport at startup and
|
|
130
|
+
* reused both. `initialize` worked; the very next `tools/call` returned 500 in
|
|
131
|
+
* 0ms — the transport had already been consumed by the previous exchange and
|
|
132
|
+
* rejected the new one before any tool ran. A shared transport is a single
|
|
133
|
+
* request/response pair, not a server.
|
|
134
|
+
*
|
|
135
|
+
* Per-request construction is cheap (the tool definitions are module-level
|
|
136
|
+
* objects; only the wiring is rebuilt) and it is what makes round-robin load
|
|
137
|
+
* balancing correct: no instance holds anything another instance would need.
|
|
138
|
+
*/
|
|
139
|
+
/** The caller's bearer, or "" — never a cached or on-disk key. */
|
|
140
|
+
function bearerOf(req) {
|
|
141
|
+
const h = req.headers.authorization || "";
|
|
142
|
+
const [scheme, ...rest] = h.split(" ");
|
|
143
|
+
return scheme?.toLowerCase() === "bearer" ? rest.join(" ").trim() : "";
|
|
144
|
+
}
|
|
145
|
+
async function handleMcp(req, res, reqId) {
|
|
146
|
+
const server = createServer();
|
|
147
|
+
registerHandlers(server);
|
|
148
|
+
const transport = new StreamableHTTPServerTransport({
|
|
149
|
+
sessionIdGenerator: undefined, // stateless: no session ids, no affinity
|
|
150
|
+
});
|
|
151
|
+
// Close both when the response ends, or every request leaks a server.
|
|
152
|
+
res.on("close", () => { void transport.close(); void server.close(); });
|
|
153
|
+
await server.connect(transport);
|
|
154
|
+
// EVERY tool call for this request runs inside this identity. buildHeaders()
|
|
155
|
+
// reads it at the single chokepoint, so no tool can accidentally reach for a
|
|
156
|
+
// shared credential. Absent bearer => no key => the backend answers 401,
|
|
157
|
+
// which is the correct, fail-closed outcome for a hosted caller.
|
|
158
|
+
await withRequestIdentity({ apiKey: bearerOf(req), requestId: reqId, platform: callerPlatform(req) }, () => transport.handleRequest(req, res));
|
|
159
|
+
}
|
|
160
|
+
async function main() {
|
|
161
|
+
const http = createHttpServer(async (req, res) => {
|
|
162
|
+
const started = Date.now();
|
|
163
|
+
const reqId = randomUUID().slice(0, 8);
|
|
164
|
+
const url = new URL(req.url || "/", `http://${req.headers.host || "localhost"}`);
|
|
165
|
+
// ONE LINE PER REQUEST, to stderr.
|
|
166
|
+
//
|
|
167
|
+
// A hosted endpoint whose failures are invisible is one nobody can trust.
|
|
168
|
+
// This repo already records the cost of that: mcp telemetry had no way to
|
|
169
|
+
// reach a user for months, so "who is failing" was unanswerable while both
|
|
170
|
+
// halves of the data existed. Structured, greppable, no PII — method, path,
|
|
171
|
+
// status, duration.
|
|
172
|
+
const done = (status, note = "") => {
|
|
173
|
+
process.stderr.write(`[mcp-http] id=${reqId} ${req.method} ${url.pathname} ` +
|
|
174
|
+
`status=${status} ms=${Date.now() - started} ` +
|
|
175
|
+
`client=${callerPlatform(req)}${note ? " " + note : ""}\n`);
|
|
176
|
+
};
|
|
177
|
+
res.on("finish", () => done(res.statusCode));
|
|
178
|
+
// Liveness, deliberately OUTSIDE the MCP path so a health checker never
|
|
179
|
+
// has to speak the protocol.
|
|
180
|
+
if (url.pathname === "/healthz") {
|
|
181
|
+
// Outside the MCP path on purpose: a readiness probe must never have to
|
|
182
|
+
// speak the protocol, and a load balancer must be able to check liveness
|
|
183
|
+
// without a valid session or key.
|
|
184
|
+
return json(res, 200, { ok: true, version: VERSION, path: PATH });
|
|
185
|
+
}
|
|
186
|
+
if (url.pathname !== PATH) {
|
|
187
|
+
return json(res, 404, {
|
|
188
|
+
error: "not found",
|
|
189
|
+
hint: `the MCP endpoint is ${PATH}`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
// Reverse proxies buffer by default, which holds a streamed response until
|
|
193
|
+
// it completes — turning an incremental stream into a long silence and
|
|
194
|
+
// then a gateway timeout. Cloudflare sits in front of this and cuts at
|
|
195
|
+
// ~100s, which is how verify_behavior produced a 504 at 54s. Telling the
|
|
196
|
+
// proxy not to buffer is the half we control from here; the nginx side
|
|
197
|
+
// needs proxy_buffering off.
|
|
198
|
+
res.setHeader("X-Accel-Buffering", "no");
|
|
199
|
+
if (!originAllowed(req)) {
|
|
200
|
+
// Refuse rather than silently serve: a rejected origin is a security
|
|
201
|
+
// event, and a 403 that says why is easier to debug than a hang.
|
|
202
|
+
return json(res, 403, {
|
|
203
|
+
error: "origin not allowed",
|
|
204
|
+
origin: req.headers.origin,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
// A ceiling of our own, just inside the edge's. Without it a stuck tool
|
|
208
|
+
// holds the connection until Cloudflare kills it and the agent gets an
|
|
209
|
+
// opaque 504 instead of an error it can reason about.
|
|
210
|
+
const killer = setTimeout(() => {
|
|
211
|
+
if (!res.headersSent) {
|
|
212
|
+
rpcError(res, 504, -32001, `tool call exceeded ${REQUEST_TIMEOUT_MS}ms`, { request_id: reqId, hint: "long tools return a job_id; poll it instead" });
|
|
213
|
+
done(504, "timeout");
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
res.destroy();
|
|
217
|
+
}
|
|
218
|
+
}, REQUEST_TIMEOUT_MS);
|
|
219
|
+
killer.unref?.();
|
|
220
|
+
try {
|
|
221
|
+
await handleMcp(req, res, reqId);
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
// Never leak a stack to a caller; log it where an operator can see it.
|
|
225
|
+
const id = randomUUID().slice(0, 8);
|
|
226
|
+
process.stderr.write(`[fetchsandbox-mcp-http] ${id} ${String(err)}\n`);
|
|
227
|
+
if (!res.headersSent) {
|
|
228
|
+
rpcError(res, 500, -32603, "internal error", { request_id: id });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
clearTimeout(killer);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
// Zombie connections are the other way a hosted server degrades quietly:
|
|
236
|
+
// sockets accumulate, the process looks healthy, and new requests queue.
|
|
237
|
+
http.headersTimeout = REQUEST_TIMEOUT_MS + 10_000;
|
|
238
|
+
http.requestTimeout = REQUEST_TIMEOUT_MS + 10_000;
|
|
239
|
+
http.keepAliveTimeout = 65_000; // above a typical 60s LB idle timeout
|
|
240
|
+
http.listen(PORT, HOST, () => {
|
|
241
|
+
process.stderr.write(`[fetchsandbox-mcp-http ${VERSION}] listening on ${HOST}:${PORT}${PATH} ` +
|
|
242
|
+
`(stateless; timeout ${REQUEST_TIMEOUT_MS}ms; origins ${ALLOWED_ORIGINS.length})\n`);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
main().catch((err) => {
|
|
246
|
+
process.stderr.write(`[fetchsandbox-mcp-http] fatal: ${String(err)}\n`);
|
|
247
|
+
process.exit(1);
|
|
248
|
+
});
|
|
249
|
+
//# sourceMappingURL=http.js.map
|
package/dist/http.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AAE9F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,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protocol/sdk/server/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* ONE registry, TWO transports.
|
|
5
|
+
*
|
|
6
|
+
* `server` was a module-level singleton because stdio is the only transport
|
|
7
|
+
* that has ever existed here. A hosted endpoint needs its own instance per
|
|
8
|
+
* process (and, in stateless HTTP, potentially per request), so construction
|
|
9
|
+
* moves into a factory and both entry points call it.
|
|
10
|
+
*
|
|
11
|
+
* THE POINT OF THE FACTORY is not reuse, it is preventing DRIFT. A second,
|
|
12
|
+
* hand-written tool list for the HTTP surface would diverge within weeks and
|
|
13
|
+
* the divergence would be invisible: hosted users would silently get a
|
|
14
|
+
* different product from stdio users. `tests/transport-parity.test.mjs` pins
|
|
15
|
+
* that both transports expose byte-identical tool definitions.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createServer(): Server;
|
|
3
18
|
declare const server: Server<{
|
|
4
19
|
method: string;
|
|
5
20
|
params?: {
|
|
@@ -34,4 +49,5 @@ declare const server: Server<{
|
|
|
34
49
|
} | undefined;
|
|
35
50
|
} | undefined;
|
|
36
51
|
}>;
|
|
52
|
+
export declare function registerHandlers(server: Server): void;
|
|
37
53
|
export { server };
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { importSpecTool, runImportSpec } from "./tools/import_spec.js";
|
|
|
24
24
|
import { listSpecsTool, runListSpecs } from "./tools/list_specs.js";
|
|
25
25
|
import { listWorkflowsTool, runListWorkflows } from "./tools/list_workflows.js";
|
|
26
26
|
import { listRunsTool, runListRuns } from "./tools/list_runs.js";
|
|
27
|
+
import { listScenariosTool, runListScenarios, setScenarioTool, runSetScenario, } from "./tools/scenarios.js";
|
|
27
28
|
import { runRunWorkflow, runWorkflowTool } from "./tools/run_workflow.js";
|
|
28
29
|
import { runRunAllWorkflows, runAllWorkflowsTool, } from "./tools/run_all_workflows.js";
|
|
29
30
|
import { guideTool, runGuide } from "./tools/guide.js";
|
|
@@ -35,7 +36,25 @@ import { findBugsTool, runFindBugs } from "./tools/find_bugs.js";
|
|
|
35
36
|
import { fixBugTool, runFixBug } from "./tools/fix_bug.js";
|
|
36
37
|
import { proveFixTool, runProveFix } from "./tools/prove_fix.js";
|
|
37
38
|
import { VERSION } from "./version.js";
|
|
38
|
-
|
|
39
|
+
/**
|
|
40
|
+
* ONE registry, TWO transports.
|
|
41
|
+
*
|
|
42
|
+
* `server` was a module-level singleton because stdio is the only transport
|
|
43
|
+
* that has ever existed here. A hosted endpoint needs its own instance per
|
|
44
|
+
* process (and, in stateless HTTP, potentially per request), so construction
|
|
45
|
+
* moves into a factory and both entry points call it.
|
|
46
|
+
*
|
|
47
|
+
* THE POINT OF THE FACTORY is not reuse, it is preventing DRIFT. A second,
|
|
48
|
+
* hand-written tool list for the HTTP surface would diverge within weeks and
|
|
49
|
+
* the divergence would be invisible: hosted users would silently get a
|
|
50
|
+
* different product from stdio users. `tests/transport-parity.test.mjs` pins
|
|
51
|
+
* that both transports expose byte-identical tool definitions.
|
|
52
|
+
*/
|
|
53
|
+
export function createServer() {
|
|
54
|
+
return new Server({ name: "fetchsandbox", version: VERSION }, { capabilities: { tools: {} } });
|
|
55
|
+
}
|
|
56
|
+
const server = createServer();
|
|
57
|
+
registerHandlers(server);
|
|
39
58
|
/**
|
|
40
59
|
* Behaviour hints for each tool, per the MCP spec.
|
|
41
60
|
*
|
|
@@ -67,6 +86,7 @@ const ANNOTATIONS = {
|
|
|
67
86
|
list_specs: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
68
87
|
list_workflows: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
69
88
|
list_runs: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
89
|
+
list_scenarios: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
70
90
|
find_bugs: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
71
91
|
// Proposes a diff. It does not apply it — applying is the agent's job.
|
|
72
92
|
fix_bug: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
@@ -79,170 +99,191 @@ const ANNOTATIONS = {
|
|
|
79
99
|
verify_behavior: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
80
100
|
// Writes to a receipt page that anyone with the link can read.
|
|
81
101
|
submit_proof: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
102
|
+
// Arming a failure changes what EVERY caller of that sandbox sees until it
|
|
103
|
+
// is put back, so it is a write. Not destructive — nothing is lost, and
|
|
104
|
+
// set_scenario('default') restores it — but an agent must not call it
|
|
105
|
+
// speculatively, which is exactly what readOnlyHint: true would invite.
|
|
106
|
+
set_scenario: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
82
107
|
};
|
|
83
108
|
/** Attach the hint for a tool, leaving the tool definitions themselves alone. */
|
|
84
109
|
function annotated(tool) {
|
|
85
110
|
const a = ANNOTATIONS[tool.name];
|
|
86
111
|
return a ? { ...tool, annotations: a } : tool;
|
|
87
112
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
? a.
|
|
122
|
-
: undefined,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
});
|
|
113
|
+
export function registerHandlers(server) {
|
|
114
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
115
|
+
tools: [
|
|
116
|
+
annotated(coachTool), // listed FIRST — the conversational entry point
|
|
117
|
+
annotated(findBugsTool), // investigate: find production bugs in the user's own code
|
|
118
|
+
annotated(fixBugTool), // fix: grounded remediation → git diff proposal
|
|
119
|
+
annotated(proveFixTool), // prove: run FS's scenario buggy vs fixed → honest-green gate
|
|
120
|
+
annotated(guideTool), // the deterministic single-shot router (still useful)
|
|
121
|
+
annotated(quickrunTool), // run a bundled spec by slug — no import_spec/sandbox needed
|
|
122
|
+
annotated(listSpecsTool),
|
|
123
|
+
annotated(importSpecTool),
|
|
124
|
+
annotated(listWorkflowsTool),
|
|
125
|
+
annotated(runAllWorkflowsTool),
|
|
126
|
+
annotated(runWorkflowTool),
|
|
127
|
+
annotated(verifyBehaviorTool),
|
|
128
|
+
annotated(submitProofTool), // attach the REAL app's before/after to the receipt
|
|
129
|
+
annotated(listRunsTool),
|
|
130
|
+
// The moat, exposed: discover the failures, then inject one.
|
|
131
|
+
annotated(listScenariosTool),
|
|
132
|
+
annotated(setScenarioTool),
|
|
133
|
+
],
|
|
134
|
+
}));
|
|
135
|
+
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
136
|
+
const { name, arguments: args } = req.params;
|
|
137
|
+
try {
|
|
138
|
+
// withSignIn re-runs this on the one occasion it can succeed the second
|
|
139
|
+
// time: a 401 that the human has since resolved in a browser.
|
|
140
|
+
const result = await withSignIn(async () => {
|
|
141
|
+
let result;
|
|
142
|
+
const a = (args ?? {});
|
|
143
|
+
switch (name) {
|
|
144
|
+
case coachTool.name:
|
|
145
|
+
result = await runCoach({
|
|
146
|
+
intent: typeof a.intent === "string" ? a.intent : undefined,
|
|
147
|
+
session_id: typeof a.session_id === "string" ? a.session_id : undefined,
|
|
148
|
+
user_response: typeof a.user_response === "string" ? a.user_response : undefined,
|
|
149
|
+
context: a.context && typeof a.context === "object"
|
|
150
|
+
? a.context
|
|
151
|
+
: undefined,
|
|
152
|
+
});
|
|
153
|
+
break;
|
|
154
|
+
case findBugsTool.name:
|
|
155
|
+
result = await runFindBugs({
|
|
156
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
157
|
+
spec: typeof a.spec === "string" ? a.spec : undefined,
|
|
158
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
159
|
+
});
|
|
160
|
+
break;
|
|
161
|
+
case fixBugTool.name:
|
|
162
|
+
result = await runFixBug({
|
|
163
|
+
bug: typeof a.bug === "string" ? a.bug : "",
|
|
164
|
+
fix_pattern: typeof a.fix_pattern === "string" ? a.fix_pattern : undefined,
|
|
165
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
166
|
+
spec: typeof a.spec === "string" ? a.spec : undefined,
|
|
167
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
168
|
+
});
|
|
169
|
+
break;
|
|
170
|
+
case proveFixTool.name:
|
|
171
|
+
result = await runProveFix({
|
|
172
|
+
diff: typeof a.diff === "string" ? a.diff : "",
|
|
173
|
+
bug: typeof a.bug === "string" ? a.bug : undefined,
|
|
174
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
175
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
176
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
177
|
+
});
|
|
178
|
+
break;
|
|
179
|
+
case guideTool.name:
|
|
180
|
+
result = await runGuide({
|
|
181
|
+
intent: typeof a.intent === "string" ? a.intent : "",
|
|
182
|
+
// A caller-supplied context beats the automatic repo scan — an
|
|
183
|
+
// explicit statement of what the repo integrates is a fact, not a
|
|
184
|
+
// guess, and the dispatcher must not drop it on the floor.
|
|
185
|
+
context: a.context && typeof a.context === "object"
|
|
186
|
+
? a.context
|
|
187
|
+
: undefined,
|
|
188
|
+
hints: a.hints && typeof a.hints === "object"
|
|
189
|
+
? a.hints
|
|
190
|
+
: undefined,
|
|
191
|
+
});
|
|
192
|
+
break;
|
|
193
|
+
case quickrunTool.name:
|
|
194
|
+
result = await runQuickrun({
|
|
195
|
+
spec_slug: typeof a.spec_slug === "string" ? a.spec_slug : "",
|
|
196
|
+
workflow_name: typeof a.workflow_name === "string" ? a.workflow_name : "",
|
|
197
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
198
|
+
});
|
|
199
|
+
break;
|
|
200
|
+
case listSpecsTool.name:
|
|
201
|
+
result = await runListSpecs({
|
|
202
|
+
filter: typeof a.filter === "string" ? a.filter : undefined,
|
|
203
|
+
});
|
|
204
|
+
break;
|
|
205
|
+
case importSpecTool.name:
|
|
206
|
+
result = await runImportSpec({
|
|
207
|
+
url: typeof a.url === "string" ? a.url : undefined,
|
|
208
|
+
content: typeof a.content === "string" ? a.content : undefined,
|
|
209
|
+
name: typeof a.name === "string" ? a.name : undefined,
|
|
210
|
+
});
|
|
211
|
+
break;
|
|
212
|
+
case listWorkflowsTool.name:
|
|
213
|
+
result = await runListWorkflows({
|
|
214
|
+
spec_id: typeof a.spec_id === "string" ? a.spec_id : "",
|
|
215
|
+
});
|
|
216
|
+
break;
|
|
217
|
+
case listRunsTool.name:
|
|
218
|
+
result = await runListRuns({
|
|
219
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
220
|
+
limit: typeof a.limit === "number" ? a.limit : undefined,
|
|
221
|
+
});
|
|
222
|
+
break;
|
|
223
|
+
case listScenariosTool.name:
|
|
224
|
+
result = await runListScenarios({
|
|
225
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
226
|
+
});
|
|
227
|
+
break;
|
|
228
|
+
case setScenarioTool.name:
|
|
229
|
+
result = await runSetScenario({
|
|
230
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
231
|
+
scenario: typeof a.scenario === "string" ? a.scenario : "",
|
|
232
|
+
});
|
|
233
|
+
break;
|
|
234
|
+
case runWorkflowTool.name:
|
|
235
|
+
result = await runRunWorkflow({
|
|
236
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
237
|
+
workflow_name: typeof a.workflow_name === "string" ? a.workflow_name : "",
|
|
238
|
+
// scenario was dropped here (schema + runRunWorkflow both support it),
|
|
239
|
+
// silently forcing the happy path — the exact "agent skipped the proof"
|
|
240
|
+
// failure this product exists to prevent. Forward it. (2026-07-15)
|
|
241
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
242
|
+
});
|
|
243
|
+
break;
|
|
244
|
+
case runAllWorkflowsTool.name:
|
|
245
|
+
result = await runRunAllWorkflows({
|
|
246
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
247
|
+
workflow_names: Array.isArray(a.workflow_names)
|
|
248
|
+
? a.workflow_names.filter((x) => typeof x === "string")
|
|
249
|
+
: undefined,
|
|
250
|
+
});
|
|
251
|
+
break;
|
|
252
|
+
case verifyBehaviorTool.name:
|
|
253
|
+
result = await runVerifyBehavior({
|
|
254
|
+
bug_pattern_id: typeof a.bug_pattern_id === "string" ? a.bug_pattern_id : "",
|
|
255
|
+
prompt: typeof a.prompt === "string" ? a.prompt : undefined,
|
|
256
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : undefined,
|
|
257
|
+
flow_run_id: typeof a.flow_run_id === "string" ? a.flow_run_id : undefined,
|
|
258
|
+
});
|
|
259
|
+
break;
|
|
260
|
+
case submitProofTool.name:
|
|
261
|
+
result = await runSubmitProof({
|
|
262
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
263
|
+
flow_run_id: typeof a.flow_run_id === "string" ? a.flow_run_id : "",
|
|
264
|
+
bug_pattern_id: typeof a.bug_pattern_id === "string" ? a.bug_pattern_id : "",
|
|
265
|
+
summary: typeof a.summary === "string" ? a.summary : undefined,
|
|
266
|
+
proofs: Array.isArray(a.proofs) ? a.proofs : [],
|
|
267
|
+
});
|
|
268
|
+
break;
|
|
269
|
+
default:
|
|
270
|
+
throw new ToolError(`Unknown tool: ${name}`);
|
|
271
|
+
}
|
|
272
|
+
return result;
|
|
273
|
+
});
|
|
274
|
+
return {
|
|
275
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
catch (e) {
|
|
279
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
280
|
+
return {
|
|
281
|
+
content: [{ type: "text", text: friendlyError(name, msg, e) }],
|
|
282
|
+
isError: true,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
246
287
|
function friendlyError(toolName, msg, err) {
|
|
247
288
|
// Surface common backend errors as agent-readable hints instead of raw HTTP.
|
|
248
289
|
const status = err instanceof ToolError ? err.status : undefined;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAA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CAAC;AAAC,MAAM,CAAC;IACP,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC;AAED,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,30 @@
|
|
|
1
|
+
export interface RequestIdentity {
|
|
2
|
+
/** The bearer the caller presented. Never read from disk, never cached. */
|
|
3
|
+
apiKey: string;
|
|
4
|
+
/** For log correlation. Not sent upstream. */
|
|
5
|
+
requestId?: string;
|
|
6
|
+
/**
|
|
7
|
+
* The calling platform (lovable, bolt, replit, base44, …), from Origin.
|
|
8
|
+
* Sent upstream as x-mcp-client so retention can be split per platform —
|
|
9
|
+
* detectIde() cannot do this in a container, where there is no editor env.
|
|
10
|
+
*/
|
|
11
|
+
platform?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Run `fn` with this request's identity bound to the async context. */
|
|
14
|
+
export declare function withRequestIdentity<T>(id: RequestIdentity, fn: () => Promise<T>): Promise<T>;
|
|
15
|
+
/**
|
|
16
|
+
* The identity of the in-flight request, or undefined outside one.
|
|
17
|
+
*
|
|
18
|
+
* `undefined` is the normal case for stdio and CI — it is how those keep their
|
|
19
|
+
* existing behaviour rather than a failure.
|
|
20
|
+
*/
|
|
21
|
+
export declare function currentIdentity(): RequestIdentity | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* True when this process is the hosted transport.
|
|
24
|
+
*
|
|
25
|
+
* Gates the device flow. `withSignIn` calls writeCredentials on success, and
|
|
26
|
+
* on a shared server that write IS the leak — one user's browser sign-in
|
|
27
|
+
* would become every user's credential. A hosted caller presents a key the
|
|
28
|
+
* platform already holds; it never completes a browser flow on our box.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isHosted(): boolean;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-request identity, for the HOSTED transport only.
|
|
3
|
+
*
|
|
4
|
+
* THE BUG THIS EXISTS TO PREVENT, found 2026-09-20 before shipping.
|
|
5
|
+
*
|
|
6
|
+
* `auth.ts` caches credentials in a module-level variable and writes them to
|
|
7
|
+
* ~/.fetchsandbox/credentials.json. That is exactly right for stdio, where the
|
|
8
|
+
* process belongs to one developer on their own machine, and for CI, where the
|
|
9
|
+
* job is one tenant with one key in the environment.
|
|
10
|
+
*
|
|
11
|
+
* It is a cross-tenant credential leak in a shared container. User A completes
|
|
12
|
+
* a device flow (or simply calls a tool), their key lands in the module cache
|
|
13
|
+
* and on disk, and every subsequent request FROM EVERY OTHER USER picks it up
|
|
14
|
+
* — spending A's quota, against A's account, attributed to A. One server, many
|
|
15
|
+
* agents, and no isolation at all.
|
|
16
|
+
*
|
|
17
|
+
* THE SHAPE OF THE FIX
|
|
18
|
+
*
|
|
19
|
+
* There is exactly one place credentials are read for an outbound call:
|
|
20
|
+
* `buildHeaders()` in client.ts. So identity becomes request-scoped at that
|
|
21
|
+
* single chokepoint, resolved in priority order:
|
|
22
|
+
*
|
|
23
|
+
* request context -> FETCHSANDBOX_API_KEY -> ~/.fetchsandbox
|
|
24
|
+
* (hosted) (CI/CD) (a developer's machine)
|
|
25
|
+
*
|
|
26
|
+
* Each deployment shape keeps the source that is correct for it, and stdio and
|
|
27
|
+
* CI are byte-identical to before because neither ever enters a request scope.
|
|
28
|
+
*
|
|
29
|
+
* WHY AsyncLocalStorage AND NOT A PARAMETER
|
|
30
|
+
*
|
|
31
|
+
* Threading a credential through all 16 tools and every call site is more
|
|
32
|
+
* explicit, and it is the shape that drifts: a seventeenth tool forgets the
|
|
33
|
+
* argument and nothing goes red. One chokepoint cannot be forgotten.
|
|
34
|
+
*
|
|
35
|
+
* The tradeoff is real and worth naming: the context is implicit, so a tool
|
|
36
|
+
* that spawns a DETACHED async task loses it. That fails CLOSED — no key, the
|
|
37
|
+
* backend answers 401 — which is the safe direction, but it is a sharp edge.
|
|
38
|
+
*
|
|
39
|
+
* WHY WE DO NOT VALIDATE THE KEY HERE
|
|
40
|
+
*
|
|
41
|
+
* This process forwards; the backend decides. It runs IdentityMiddleware and
|
|
42
|
+
* RequireAuthMiddleware exactly as it does for the stdio client, so a hosted
|
|
43
|
+
* caller and a local caller can never get different answers about who may
|
|
44
|
+
* spend. It is also not the "token passthrough" anti-pattern: these are our
|
|
45
|
+
* own fsk_ keys going to our own backend, not a third party's token forwarded
|
|
46
|
+
* somewhere it was never issued for.
|
|
47
|
+
*/
|
|
48
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
49
|
+
const storage = new AsyncLocalStorage();
|
|
50
|
+
/** Run `fn` with this request's identity bound to the async context. */
|
|
51
|
+
export function withRequestIdentity(id, fn) {
|
|
52
|
+
return storage.run(id, fn);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The identity of the in-flight request, or undefined outside one.
|
|
56
|
+
*
|
|
57
|
+
* `undefined` is the normal case for stdio and CI — it is how those keep their
|
|
58
|
+
* existing behaviour rather than a failure.
|
|
59
|
+
*/
|
|
60
|
+
export function currentIdentity() {
|
|
61
|
+
return storage.getStore();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* True when this process is the hosted transport.
|
|
65
|
+
*
|
|
66
|
+
* Gates the device flow. `withSignIn` calls writeCredentials on success, and
|
|
67
|
+
* on a shared server that write IS the leak — one user's browser sign-in
|
|
68
|
+
* would become every user's credential. A hosted caller presents a key the
|
|
69
|
+
* platform already holds; it never completes a browser flow on our box.
|
|
70
|
+
*/
|
|
71
|
+
export function isHosted() {
|
|
72
|
+
return process.env.FS_MCP_HOSTED === "1";
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=request_context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request_context.js","sourceRoot":"","sources":["../src/request_context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAerD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAmB,CAAC;AAEzD,wEAAwE;AACxE,MAAM,UAAU,mBAAmB,CAAI,EAAmB,EAAE,EAAoB;IAC9E,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG,CAAC;AAC3C,CAAC"}
|
package/dist/signin.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { buildHeaders, getBaseUrl, ToolError } from "./client.js";
|
|
17
17
|
import { installId, readCredentials, writeCredentials } from "./auth.js";
|
|
18
18
|
import { detectIde } from "./session.js";
|
|
19
|
+
import { isHosted } from "./request_context.js";
|
|
19
20
|
// Only ever used on a RETRY, when the human has already been shown the code and
|
|
20
21
|
// is mid-sign-in. Long enough to cover a browser round trip, short enough that
|
|
21
22
|
// an agent is never left hanging on someone who walked away.
|
|
@@ -118,6 +119,35 @@ let pending = null;
|
|
|
118
119
|
* degrades to exactly today's behaviour instead of a hard wall.
|
|
119
120
|
*/
|
|
120
121
|
export async function withSignIn(call) {
|
|
122
|
+
// HOSTED: no device flow, ever. It ends in writeCredentials(), which on a
|
|
123
|
+
// shared container turns one user's browser sign-in into every user's
|
|
124
|
+
// credential. A hosted caller presents a key its platform already holds, so
|
|
125
|
+
// a 401 must surface as a 401 and say how to fix it — not start a flow that
|
|
126
|
+
// would poison the process for everyone else.
|
|
127
|
+
if (isHosted()) {
|
|
128
|
+
try {
|
|
129
|
+
return await call();
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
if (e instanceof ToolError && e.status === 401) {
|
|
133
|
+
// Point at /keys, NOT /device. The device page asks for a code that a
|
|
134
|
+
// CLI printed and never displays a key — a hosted caller has neither,
|
|
135
|
+
// so sending them there was a dead end dressed as an instruction.
|
|
136
|
+
// /keys signs in with Google or GitHub and hands over a pasteable key.
|
|
137
|
+
//
|
|
138
|
+
// Written for the AGENT to relay, because on a hosted connector the
|
|
139
|
+
// agent is the only thing that reads this. Hence the plain sentence a
|
|
140
|
+
// non-developer can act on rather than a header-shaped instruction.
|
|
141
|
+
throw new ToolError("FetchSandbox needs a free API key for this step. Ask the user to " +
|
|
142
|
+
"open https://fetchsandbox.com/keys, sign in with Google or GitHub, " +
|
|
143
|
+
"click 'Create a key', and paste the key that appears into this " +
|
|
144
|
+
"connector's authentication field (as a bearer token). Everything " +
|
|
145
|
+
"already run so far — the sandbox and any failure scenario — keeps " +
|
|
146
|
+
"working; only this step needs the key.", 401);
|
|
147
|
+
}
|
|
148
|
+
throw e;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
121
151
|
// Cheap, non-blocking: an approval that landed between calls is picked up here.
|
|
122
152
|
if (pending && !readCredentials()?.apiKey) {
|
|
123
153
|
const creds = await redeemOnce(pending).catch(() => null);
|
package/dist/signin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signin.js","sourceRoot":"","sources":["../src/signin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAoB,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"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AO,GAAG,OAAO,CAAC;QAClB,MAAM,IAAI,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface ListScenariosInput {
|
|
2
|
+
sandbox_id: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ListScenariosResponse {
|
|
5
|
+
sandbox_id: string;
|
|
6
|
+
active_scenario: string;
|
|
7
|
+
scenarios: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare const listScenariosTool: {
|
|
13
|
+
readonly name: "list_scenarios";
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
readonly type: "object";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly sandbox_id: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "The sandbox_id returned by quickrun, run_workflow or import_spec.";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly required: readonly ["sandbox_id"];
|
|
24
|
+
readonly additionalProperties: false;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare function runListScenarios(input: ListScenariosInput): Promise<ListScenariosResponse>;
|
|
28
|
+
export interface SetScenarioInput {
|
|
29
|
+
sandbox_id: string;
|
|
30
|
+
scenario: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SetScenarioResponse {
|
|
33
|
+
sandbox_id: string;
|
|
34
|
+
active_scenario: string;
|
|
35
|
+
next_step: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const setScenarioTool: {
|
|
38
|
+
readonly name: "set_scenario";
|
|
39
|
+
readonly description: string;
|
|
40
|
+
readonly inputSchema: {
|
|
41
|
+
readonly type: "object";
|
|
42
|
+
readonly properties: {
|
|
43
|
+
readonly sandbox_id: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
readonly description: "The sandbox to arm. From quickrun, run_workflow or import_spec.";
|
|
46
|
+
};
|
|
47
|
+
readonly scenario: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
readonly required: readonly ["sandbox_id", "scenario"];
|
|
53
|
+
readonly additionalProperties: false;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare function runSetScenario(input: SetScenarioInput): Promise<SetScenarioResponse>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The failure-injection tools. This is the product, exposed.
|
|
3
|
+
*
|
|
4
|
+
* FetchSandbox's claim is not "we mock your API" — it is "we break your
|
|
5
|
+
* integration on purpose and tell you whether the code survived". Until now an
|
|
6
|
+
* agent could not do that. `quickrun`, `run_workflow` and `prove_fix` each
|
|
7
|
+
* accept a `scenario` argument, but nothing LISTS the scenarios and nothing
|
|
8
|
+
* ARMS one on a sandbox the agent already has. The parameter descriptions
|
|
9
|
+
* named two examples in prose ("e.g. webhook_retries, payment_declined") while
|
|
10
|
+
* paddle alone ships ten, so an agent could only use a failure it happened to
|
|
11
|
+
* guess.
|
|
12
|
+
*
|
|
13
|
+
* That gap mattered most for exactly the audience we are building for.
|
|
14
|
+
* Measured 2026-09-20 from 47 r/lovable posts, these are real titles:
|
|
15
|
+
*
|
|
16
|
+
* "If your Lovable app works, run these failure tests before taking payments"
|
|
17
|
+
* "Before adding another Lovable feature, break one important action on purpose"
|
|
18
|
+
* "6 things that broke when my Lovable apps got their first real users"
|
|
19
|
+
*
|
|
20
|
+
* Those builders are already doing this by hand. `list_scenarios` +
|
|
21
|
+
* `set_scenario` is the difference between "the agent can run our demos" and
|
|
22
|
+
* "the agent can break the thing it just built, deliberately, and watch."
|
|
23
|
+
*/
|
|
24
|
+
import { getJson, postJson, ToolError } from "../client.js";
|
|
25
|
+
export const listScenariosTool = {
|
|
26
|
+
name: "list_scenarios",
|
|
27
|
+
description: "List the FAILURE SCENARIOS this sandbox can inject on demand — the " +
|
|
28
|
+
"specific ways the real provider misbehaves in production. Call this " +
|
|
29
|
+
"BEFORE claiming an integration works. A checkout that passes on the " +
|
|
30
|
+
"happy path tells you almost nothing; the bugs that reach customers are " +
|
|
31
|
+
"declined cards, webhooks delivered twice or out of order, expired " +
|
|
32
|
+
"tokens, rate limits and slow networks. " +
|
|
33
|
+
"Typical names: payment_declined, insufficient_funds, webhook_retries, " +
|
|
34
|
+
"flaky_webhooks, replayed_old_signed_event, signed_event_with_mutated_body, " +
|
|
35
|
+
"auth_failure, rate_limited, slow_network — but they differ per provider, " +
|
|
36
|
+
"which is why you list them instead of guessing. " +
|
|
37
|
+
"Returns each scenario's name and what it does. Arm one with set_scenario, " +
|
|
38
|
+
"then re-run the same request and check the app still behaves correctly.",
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: "object",
|
|
41
|
+
properties: {
|
|
42
|
+
sandbox_id: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "The sandbox_id returned by quickrun, run_workflow or import_spec.",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
required: ["sandbox_id"],
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export async function runListScenarios(input) {
|
|
52
|
+
if (!input.sandbox_id)
|
|
53
|
+
throw new ToolError("sandbox_id is required.");
|
|
54
|
+
const sb = await getJson(`/api/sandboxes/${encodeURIComponent(input.sandbox_id)}`);
|
|
55
|
+
const scenarios = (sb.scenarios || []).map((s) => typeof s === "string"
|
|
56
|
+
? { name: s, description: "" }
|
|
57
|
+
: { name: s.name || "", description: s.description || "" }).filter((s) => s.name);
|
|
58
|
+
return {
|
|
59
|
+
sandbox_id: input.sandbox_id,
|
|
60
|
+
active_scenario: sb.active_scenario || "default",
|
|
61
|
+
scenarios,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export const setScenarioTool = {
|
|
65
|
+
name: "set_scenario",
|
|
66
|
+
description: "ARM a failure scenario on a sandbox, so the next requests hit the " +
|
|
67
|
+
"provider misbehaving instead of the happy path. This is how you find out " +
|
|
68
|
+
"whether the integration you just wrote actually survives production. " +
|
|
69
|
+
"Use it like this: run the flow once on 'default' and confirm it works, " +
|
|
70
|
+
"call set_scenario with a failure from list_scenarios, run the SAME flow " +
|
|
71
|
+
"again, then check the end state is still correct — not that the call " +
|
|
72
|
+
"merely returned. A declined payment must not produce a confirmed order; " +
|
|
73
|
+
"a webhook delivered twice must not charge twice or send two emails. " +
|
|
74
|
+
"Set scenario to 'default' to return the sandbox to normal. " +
|
|
75
|
+
"The scenario stays armed until you change it, and it affects every " +
|
|
76
|
+
"caller of that sandbox — so put it back when you are done.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
sandbox_id: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "The sandbox to arm. From quickrun, run_workflow or import_spec.",
|
|
83
|
+
},
|
|
84
|
+
scenario: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "A scenario name from list_scenarios, or 'default' to restore " +
|
|
87
|
+
"normal behaviour. Guessing a name that does not exist fails — list first.",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
required: ["sandbox_id", "scenario"],
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
export async function runSetScenario(input) {
|
|
95
|
+
if (!input.sandbox_id)
|
|
96
|
+
throw new ToolError("sandbox_id is required.");
|
|
97
|
+
if (!input.scenario)
|
|
98
|
+
throw new ToolError("scenario is required.");
|
|
99
|
+
const res = await postJson(`/api/sandboxes/${encodeURIComponent(input.sandbox_id)}/scenario`, { scenario: input.scenario });
|
|
100
|
+
const active = res.active_scenario || input.scenario;
|
|
101
|
+
return {
|
|
102
|
+
sandbox_id: input.sandbox_id,
|
|
103
|
+
active_scenario: active,
|
|
104
|
+
// The instruction matters as much as the result. An agent that arms a
|
|
105
|
+
// failure and then only checks the HTTP status has learned nothing: the
|
|
106
|
+
// point is whether the app's END STATE is still correct.
|
|
107
|
+
next_step: active === "default"
|
|
108
|
+
? "Sandbox restored to normal behaviour."
|
|
109
|
+
: `'${active}' is armed. Re-run the same flow now, then assert the END ` +
|
|
110
|
+
`STATE — not just the response. Check the order/subscription/email ` +
|
|
111
|
+
`did NOT proceed as if nothing went wrong. Call set_scenario with ` +
|
|
112
|
+
`'default' when finished.`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.js","sourceRoot":"","sources":["../../src/tools/scenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAqB5D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,qEAAqE;QACrE,sEAAsE;QACtE,sEAAsE;QACtE,yEAAyE;QACzE,oEAAoE;QACpE,yCAAyC;QACzC,wEAAwE;QACxE,6EAA6E;QAC7E,2EAA2E;QAC3E,kDAAkD;QAClD,4EAA4E;QAC5E,yEAAyE;IAC3E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;aACtE;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,oBAAoB,EAAE,KAAK;KAC5B;CACO,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACtE,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,kBAAkB,kBAA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KAAK,CAAC,UAAU;QAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,CAAC,QAAQ;QAAE,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;IAElE,MAAM,GAAG,GAAG,MAAM,QAAQ,CACxB,kBAAkB,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,EACjE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAC7B,CAAC;IACF,MAAM,MAAM,GAAG,GAAG,CAAC,eAAe,IAAI,KAAK,CAAC,QAAQ,CAAC;IACrD,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,eAAe,EAAE,MAAM;QACvB,sEAAsE;QACtE,wEAAwE;QACxE,yDAAyD;QACzD,SAAS,EACP,MAAM,KAAK,SAAS;YAClB,CAAC,CAAC,uCAAuC;YACzC,CAAC,CAAC,IAAI,MAAM,4DAA4D;gBACtE,oEAAoE;gBACpE,mEAAmE;gBACnE,0BAA0B;KACjC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fetchsandbox-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"mcpName": "io.github.fetchsandbox/mcp",
|
|
5
5
|
"description": "A deterministic verification engine for agents. Fires the edge cases your sandbox never sends, then proves a fix: the same scenario fails on the old code and passes on the new.",
|
|
6
6
|
"license": "MIT",
|