fetchsandbox-mcp 0.4.10 → 0.5.0
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 +82 -224
- package/dist/auth.d.ts +10 -0
- package/dist/auth.js +67 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +8 -1
- package/dist/client.js.map +1 -1
- package/dist/index.js +141 -127
- package/dist/index.js.map +1 -1
- package/dist/signin.d.ts +35 -0
- package/dist/signin.js +152 -0
- package/dist/signin.js.map +1 -0
- package/dist/tools/find_bugs.d.ts +4 -0
- package/dist/tools/find_bugs.js +20 -0
- package/dist/tools/find_bugs.js.map +1 -1
- package/dist/tools/prove_fix.d.ts +2 -0
- package/dist/tools/prove_fix.js +3 -0
- package/dist/tools/prove_fix.js.map +1 -1
- package/package.json +11 -6
package/README.md
CHANGED
|
@@ -2,24 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
<a href="https://www.producthunt.com/products/fetchsandbox?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-fetchsandbox-mcp" target="_blank" rel="noopener noreferrer"><img alt="FetchSandbox MCP - The MCP that proves your AI's integration fixes work | Product Hunt" width="250" height="54" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1223147&theme=light"></a>
|
|
4
4
|
|
|
5
|
+
MCP server for [FetchSandbox](https://fetchsandbox.com).
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
Your agent writes an integration. This checks whether it actually works — against
|
|
8
|
+
a sandbox that behaves like the real provider, including the failures: retried
|
|
9
|
+
webhooks, declined cards, rate limits, auth errors.
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
When it finds a bug, it can propose a fix and then prove it: the same failure is
|
|
12
|
+
run against your code before and after the diff. Green only if it reproduced
|
|
13
|
+
first and stopped after. You get a receipt URL either way.
|
|
9
14
|
|
|
10
|
-
##
|
|
15
|
+
## Install
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Plug it into your IDE once, and any time you ask your agent "let me try the Stripe API" or "show me the GitHub issue lifecycle," it can do that — for real, end-to-end.
|
|
15
|
-
|
|
16
|
-
## Install — by agent
|
|
17
|
-
|
|
18
|
-
The MCP runs as a stdio process spawned by your IDE. There's nothing to install globally — `npx` runs the latest published version on demand. Pick your tool below, paste the snippet, restart.
|
|
19
|
-
|
|
20
|
-
### Claude Desktop
|
|
21
|
-
|
|
22
|
-
File: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
|
|
17
|
+
Same stdio command everywhere. `npx` fetches the current version, so there's
|
|
18
|
+
nothing to install.
|
|
23
19
|
|
|
24
20
|
```json
|
|
25
21
|
{
|
|
@@ -32,250 +28,112 @@ File: `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
|
|
|
32
28
|
}
|
|
33
29
|
```
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
| Client | File |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Claude Code | `~/.claude/settings.json`, or `.mcp.json` in the repo |
|
|
34
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
35
|
+
| Cursor | `~/.cursor/mcp.json`, or `.cursor/mcp.json` in the repo |
|
|
36
|
+
| Zed | `~/.config/zed/settings.json`, under `context_servers` |
|
|
37
|
+
| Codex | `~/.codex/config.toml`, as `[mcp_servers.fetchsandbox]` |
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
Restart the client afterwards. Anything else that speaks MCP takes the same
|
|
40
|
+
command and args.
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
## Using it
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"mcpServers": {
|
|
44
|
-
"fetchsandbox": {
|
|
45
|
-
"command": "npx",
|
|
46
|
-
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
44
|
+
Describe the problem the way you'd describe it to a colleague. You don't need to
|
|
45
|
+
name a tool.
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
> Customers are reporting more seats than they bought after a Paddle payment.
|
|
48
|
+
> Can you find out why?
|
|
53
49
|
|
|
54
|
-
|
|
50
|
+
The agent works through: route the symptom, reproduce it against the provider
|
|
51
|
+
sandbox, read your code, get a fix, prove the fix on your code. Each step hands
|
|
52
|
+
back what the next one needs.
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
One thing worth knowing, because it's easy to get backwards: `prove_fix` needs
|
|
55
|
+
the **unfixed** tree. Run it before you write the diff to disk, or there's no
|
|
56
|
+
bug left to reproduce and no proof to be had.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
"mcpServers": {
|
|
61
|
-
"fetchsandbox": {
|
|
62
|
-
"command": "npx",
|
|
63
|
-
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Restart Cursor.
|
|
70
|
-
|
|
71
|
-
### Cline (VS Code extension)
|
|
58
|
+
## Accounts
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
You don't need one to start. Install it, ask a question, and everything runs.
|
|
74
61
|
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
The first time a run produces something worth keeping — a receipt, or a set of
|
|
63
|
+
findings — you'll get a short code and a link. Signing in takes about twenty
|
|
64
|
+
seconds and does two things: the evidence behind your receipts stops being
|
|
65
|
+
archived after 15 days, and the runs from that machine collect in one place.
|
|
66
|
+
You'll be asked at most once a day, and never once you're signed in.
|
|
77
67
|
|
|
78
|
-
|
|
68
|
+
For CI, or anywhere a browser isn't available, set a key instead:
|
|
79
69
|
|
|
80
|
-
### Continue.dev
|
|
81
|
-
|
|
82
|
-
File: `~/.continue/config.yaml`
|
|
83
|
-
|
|
84
|
-
```yaml
|
|
85
|
-
mcpServers:
|
|
86
|
-
- name: fetchsandbox
|
|
87
|
-
command: npx
|
|
88
|
-
args:
|
|
89
|
-
- -y
|
|
90
|
-
- fetchsandbox-mcp@latest
|
|
91
70
|
```
|
|
92
|
-
|
|
93
|
-
Restart your IDE.
|
|
94
|
-
|
|
95
|
-
### Codex CLI (OpenAI)
|
|
96
|
-
|
|
97
|
-
File: `~/.codex/config.toml`
|
|
98
|
-
|
|
99
|
-
```toml
|
|
100
|
-
[mcp_servers.fetchsandbox]
|
|
101
|
-
command = "npx"
|
|
102
|
-
args = ["-y", "fetchsandbox-mcp@latest"]
|
|
71
|
+
FETCHSANDBOX_API_KEY=fsk_...
|
|
103
72
|
```
|
|
104
73
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
### Zed
|
|
108
|
-
|
|
109
|
-
File: `~/.config/zed/settings.json`
|
|
110
|
-
|
|
111
|
-
```json
|
|
112
|
-
{
|
|
113
|
-
"context_servers": {
|
|
114
|
-
"fetchsandbox": {
|
|
115
|
-
"command": {
|
|
116
|
-
"path": "npx",
|
|
117
|
-
"args": ["-y", "fetchsandbox-mcp@latest"]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### GitHub Copilot
|
|
125
|
-
|
|
126
|
-
GitHub Copilot doesn't currently support the Model Context Protocol. Track [github/copilot#feedback](https://github.com/orgs/community/discussions) for updates. In the meantime, run any MCP-compatible chat (Claude Code, Cursor, Cline) alongside Copilot.
|
|
127
|
-
|
|
128
|
-
### Anything else (Roo, Goose, etc.)
|
|
129
|
-
|
|
130
|
-
If your agent speaks MCP, it accepts a stdio command. Use:
|
|
131
|
-
|
|
132
|
-
- Command: `npx`
|
|
133
|
-
- Args: `["-y", "fetchsandbox-mcp@latest"]`
|
|
134
|
-
|
|
135
|
-
## Try it now
|
|
136
|
-
|
|
137
|
-
After restarting your agent, paste any of these prompts. Every prompt
|
|
138
|
-
starts with the `./fetchsandbox` dispatch prefix — that's the routing
|
|
139
|
-
signal. The brain matches your symptom to a workflow + scenario,
|
|
140
|
-
reproduces it deterministically, and returns a public receipt URL as
|
|
141
|
-
proof. **Variant prefixes also accepted:** `/fetchsandbox`,
|
|
142
|
-
`@fetchsandbox`, `fs:`.
|
|
143
|
-
|
|
144
|
-
### Stripe — investigate a webhook bug
|
|
145
|
-
|
|
146
|
-
> `./fetchsandbox stripe webhook bug in prod — payments getting marked paid 2-3 times. fix it with proof.`
|
|
147
|
-
|
|
148
|
-
The brain matches the `webhook_duplicate_side_effect` pattern. The
|
|
149
|
-
agent reproduces the bug via `accept_payment` + `webhook_retries`
|
|
150
|
-
scenario, applies the fix from the brain's `fix_pattern`, re-runs to
|
|
151
|
-
confirm, and surfaces the brain's `check_for` items as the audit list.
|
|
152
|
-
Receipt URL is the proof artifact.
|
|
153
|
-
|
|
154
|
-
### Stripe — silent card decline
|
|
155
|
-
|
|
156
|
-
> `./fetchsandbox stripe checkout fails silently when cards are declined — investigate and fix.`
|
|
157
|
-
|
|
158
|
-
Brain matches `card_decline_not_handled` → reproduces via
|
|
159
|
-
`payment_declined` scenario → recommends the wrap-in-try/except fix
|
|
160
|
-
pattern with `decline_code` surfacing.
|
|
161
|
-
|
|
162
|
-
### Stripe — webhook signature security
|
|
163
|
-
|
|
164
|
-
> `./fetchsandbox stripe webhook security audit failed — anyone can post to the endpoint. fix it.`
|
|
165
|
-
|
|
166
|
-
Brain matches `webhook_signature_unverified` → reproduces via
|
|
167
|
-
`auth_failure` scenario → recommends the `stripe.Webhook.construct_event`
|
|
168
|
-
fix with `STRIPE_WEBHOOK_SECRET` env sourcing.
|
|
169
|
-
|
|
170
|
-
### Build a new integration
|
|
171
|
-
|
|
172
|
-
> `./fetchsandbox help me integrate resend for transactional email`
|
|
173
|
-
|
|
174
|
-
Brain surfaces Resend's discovery questions (SPF/DKIM, bounce
|
|
175
|
-
handling, etc.), routes to the right send-email workflow, and walks
|
|
176
|
-
the implementation against a curated Resend sandbox.
|
|
177
|
-
|
|
178
|
-
### Any other API
|
|
179
|
-
|
|
180
|
-
> `./fetchsandbox <your question or bug report about any API>`
|
|
181
|
-
|
|
182
|
-
For Stripe, Resend, Clerk, Privy, Surge, AgentMail, Twilio, PayPal,
|
|
183
|
-
Paddle, GitHub, OpenAI, Pinecone, Datadog, and 19 others, the brain
|
|
184
|
-
routes via curated knowledge. For specs we don't have curated configs
|
|
185
|
-
for, the engine auto-enumerates `create + verify` workflows for every
|
|
186
|
-
detected resource. Honest about what it shows: UUIDs instead of
|
|
187
|
-
vendor-style IDs, generic enum values instead of API-specific ones —
|
|
188
|
-
but the request/response shape and template substitution between steps
|
|
189
|
-
still work.
|
|
74
|
+
The key is written to `~/.fetchsandbox/credentials.json` when you sign in from
|
|
75
|
+
an editor; the environment variable always wins.
|
|
190
76
|
|
|
191
77
|
## Tools
|
|
192
78
|
|
|
193
|
-
|
|
79
|
+
Start with `guide`. It picks the right ones for what you asked.
|
|
194
80
|
|
|
195
|
-
|
|
196
|
-
uncommitted, or private — no public git URL needed) and ships it to FetchSandbox,
|
|
197
|
-
which audits it against known API-integration failure classes (auth, webhooks,
|
|
198
|
-
payments, idempotency, data handling, validation) and returns the bugs it finds.
|
|
81
|
+
**Finding and fixing**
|
|
199
82
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
Get a proposed fix for a specific bug. Returns a `git diff` grounded in the
|
|
208
|
-
known remediation for that failure class — it does **not** modify your files, so
|
|
209
|
-
review and apply it yourself.
|
|
210
|
-
|
|
211
|
-
```
|
|
212
|
-
bug: "the finding to fix (from find_bugs)"
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### `prove_fix`
|
|
216
|
-
|
|
217
|
-
Prove a fix on your real code — the gate. Ships the still-buggy project plus the
|
|
218
|
-
diff; FetchSandbox runs its failure scenario against the buggy **and** fixed code
|
|
219
|
-
in a sandbox and returns green **only** on a measured buggy→fixed flip (never a
|
|
220
|
-
self-report), with a shareable receipt URL.
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
diff: "the diff from fix_bug"
|
|
224
|
-
bug: "the finding being fixed"
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### `import_spec`
|
|
228
|
-
|
|
229
|
-
Ingest an OpenAPI 3.x spec and get a sandbox you can call. Pass either a public URL or pasted content.
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
url: "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"
|
|
233
|
-
content: "<paste OpenAPI JSON or YAML here>"
|
|
234
|
-
name: "Optional friendly name"
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
Returns `spec_id`, `sandbox_id`, `base_url` (proxy that serves real-shaped responses), `workflows_preview` (first 10), `matched_bundled` (true if we matched a curated config), and a `dashboard_url` to view everything in the browser.
|
|
83
|
+
| Tool | What it does | Arguments |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `guide` | Routes a symptom to a spec, workflow and known failure class | `intent*`, `hints` |
|
|
86
|
+
| `find_bugs` | Audits your project against known integration failure classes. Local and private code is fine — nothing needs to be pushed | `path`, `spec`, `timeout_s` |
|
|
87
|
+
| `fix_bug` | Returns a `git diff` for one finding. Doesn't touch your files | `bug*`, `fix_pattern`, `path`, `spec`, `timeout_s` |
|
|
88
|
+
| `prove_fix` | Runs the failure against your code before and after the diff. Green only on a measured flip | `diff*`, `bug`, `scenario`, `sandbox_id`, `path`, `timeout_s` |
|
|
238
89
|
|
|
239
|
-
|
|
90
|
+
**Running the sandbox**
|
|
240
91
|
|
|
241
|
-
|
|
92
|
+
| Tool | What it does | Arguments |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `quickrun` | Runs a workflow against a bundled spec in one call. Returns `sandbox_id` and `flow_run_id` | `spec_slug*`, `workflow_name*`, `scenario` |
|
|
95
|
+
| `verify_behavior` | Shows a failure class on reference handlers — buggy vs fixed | `bug_pattern_id*`, `prompt`, `sandbox_id`, `flow_run_id` |
|
|
96
|
+
| `run_workflow` | Runs one workflow on a sandbox you already have | `sandbox_id*`, `workflow_name*`, `scenario` |
|
|
97
|
+
| `run_all_workflows` | Runs several in one call | `sandbox_id*`, `workflow_names` |
|
|
98
|
+
| `list_workflows` | Workflows available for a spec | `spec_id*` |
|
|
99
|
+
| `list_runs` | Past runs for a sandbox | `sandbox_id*`, `limit` |
|
|
242
100
|
|
|
243
|
-
|
|
244
|
-
spec_id: "<id from import_spec>"
|
|
245
|
-
```
|
|
101
|
+
**Bringing your own spec**
|
|
246
102
|
|
|
247
|
-
|
|
103
|
+
| Tool | What it does | Arguments |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| `list_specs` | Specs already available | `filter` |
|
|
106
|
+
| `import_spec` | Ingests an OpenAPI 3.x spec by URL or pasted content. Returns a callable sandbox | `url`, `content`, `name` |
|
|
107
|
+
| `submit_proof` | Publishes a receipt for a run | `sandbox_id`, `flow_run_id`, `bug_pattern_id`, `summary`, `proofs` |
|
|
108
|
+
| `coach` | Multi-turn help building an integration | `intent`, `session_id`, `user_response`, `context` |
|
|
248
109
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
```
|
|
252
|
-
sandbox_id: "<id from import_spec>"
|
|
253
|
-
workflow_name: "<id or name from list_workflows>"
|
|
254
|
-
```
|
|
110
|
+
`*` = required.
|
|
255
111
|
|
|
256
112
|
## Configuration
|
|
257
113
|
|
|
258
114
|
| Env var | Default | Purpose |
|
|
259
115
|
|---|---|---|
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
116
|
+
| `FETCHSANDBOX_API_KEY` | none | Sign in without a browser. Overrides the stored credentials |
|
|
117
|
+
| `FETCHSANDBOX_BASE_URL` | `https://fetchsandbox.com` | Point at a different backend |
|
|
118
|
+
| `FETCHSANDBOX_TELEMETRY` | on | Set to `0` to turn off |
|
|
262
119
|
|
|
263
|
-
|
|
120
|
+
Telemetry records an opaque per-machine id (a random UUID in
|
|
121
|
+
`~/.fetchsandbox/session.json`), the tool name, latency, and whether the call
|
|
122
|
+
succeeded. Not spec content, not request bodies, not credentials. It's how we
|
|
123
|
+
count sessions and see which APIs people bring.
|
|
264
124
|
|
|
265
|
-
|
|
125
|
+
Once you sign in, calls are also attributed to your account — that is the point
|
|
126
|
+
of signing in, and it is what lets your runs appear in one place.
|
|
266
127
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
128
|
+
`FETCHSANDBOX_TELEMETRY=0` stops the per-machine id being sent, so calls are no
|
|
129
|
+
longer linked to your machine. It does not make a call invisible: the server
|
|
130
|
+
still records that a tool ran, because it is the thing running it. And if you
|
|
131
|
+
are signed in, your key identifies you regardless — that is what a key is. To
|
|
132
|
+
be unattributed, don't sign in.
|
|
272
133
|
|
|
273
134
|
## License
|
|
274
135
|
|
|
275
136
|
MIT — see [LICENSE](LICENSE).
|
|
276
137
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- [FetchSandbox](https://fetchsandbox.com)
|
|
280
|
-
- [Source code](https://github.com/fetchsandbox/mcp)
|
|
281
|
-
- [Issues](https://github.com/fetchsandbox/mcp/issues)
|
|
138
|
+
- [fetchsandbox.com](https://fetchsandbox.com)
|
|
139
|
+
- [Source](https://github.com/fetchsandbox/mcp) · [Issues](https://github.com/fetchsandbox/mcp/issues)
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Credentials {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
email: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
}
|
|
6
|
+
/** The durable per-machine id. Reuses session.ts rather than minting a second. */
|
|
7
|
+
export declare function installId(): string | undefined;
|
|
8
|
+
export declare function readCredentials(): Credentials | null;
|
|
9
|
+
export declare function writeCredentials(c: Credentials): void;
|
|
10
|
+
export declare function clearCredentials(): void;
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credentials for the MCP client.
|
|
3
|
+
*
|
|
4
|
+
* WHY A DEVICE FLOW AND NOT A PROMPT
|
|
5
|
+
* ----------------------------------
|
|
6
|
+
* This server speaks JSON-RPC over stdio. stdout IS the protocol channel, so
|
|
7
|
+
* printing a login prompt corrupts it, and there is no TTY to read a password
|
|
8
|
+
* from — the process is a child of Cursor or Claude Code. It cannot open a
|
|
9
|
+
* browser either.
|
|
10
|
+
*
|
|
11
|
+
* So sign-in happens somewhere else and this process waits: it returns a short
|
|
12
|
+
* code inside a TOOL RESULT, the agent shows that to the human, and we poll
|
|
13
|
+
* until it is approved. Same shape as `gh auth login`, different plumbing.
|
|
14
|
+
*
|
|
15
|
+
* The install id is deliberately the EXISTING session id from session.ts — a
|
|
16
|
+
* randomUUID persisted at ~/.fetchsandbox/session.json since long before this
|
|
17
|
+
* file existed. Minting a second machine identifier would have split every
|
|
18
|
+
* metric across two ids for no gain.
|
|
19
|
+
*/
|
|
20
|
+
import { mkdirSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
|
|
21
|
+
import { homedir } from "node:os";
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
import { getSessionId } from "./session.js";
|
|
24
|
+
const DIR = join(homedir(), ".fetchsandbox");
|
|
25
|
+
const CREDS_FILE = join(DIR, "credentials.json");
|
|
26
|
+
let cached;
|
|
27
|
+
/** The durable per-machine id. Reuses session.ts rather than minting a second. */
|
|
28
|
+
export function installId() {
|
|
29
|
+
return getSessionId();
|
|
30
|
+
}
|
|
31
|
+
export function readCredentials() {
|
|
32
|
+
if (cached !== undefined)
|
|
33
|
+
return cached;
|
|
34
|
+
// An env var wins, so CI and containers never need a writable home dir.
|
|
35
|
+
const fromEnv = process.env.FETCHSANDBOX_API_KEY;
|
|
36
|
+
if (fromEnv) {
|
|
37
|
+
cached = { apiKey: fromEnv, email: "", createdAt: "" };
|
|
38
|
+
return cached;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(readFileSync(CREDS_FILE, "utf8"));
|
|
42
|
+
cached =
|
|
43
|
+
typeof parsed?.apiKey === "string" && parsed.apiKey
|
|
44
|
+
? { apiKey: parsed.apiKey, email: parsed.email ?? "", createdAt: parsed.createdAt ?? "" }
|
|
45
|
+
: null;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
cached = null;
|
|
49
|
+
}
|
|
50
|
+
return cached;
|
|
51
|
+
}
|
|
52
|
+
export function writeCredentials(c) {
|
|
53
|
+
try {
|
|
54
|
+
mkdirSync(DIR, { recursive: true });
|
|
55
|
+
writeFileSync(CREDS_FILE, JSON.stringify(c, null, 2));
|
|
56
|
+
// 0600. A long-lived key must not be world-readable on a shared machine.
|
|
57
|
+
chmodSync(CREDS_FILE, 0o600);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Best-effort: an unwritable home means re-authing next run, not a crash.
|
|
61
|
+
}
|
|
62
|
+
cached = c;
|
|
63
|
+
}
|
|
64
|
+
export function clearCredentials() {
|
|
65
|
+
cached = null;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,eAAe,CAAC,CAAC;AAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,kB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/B,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;IAC5E,CAAC;IACD,MAAM,GAAG,CAAC,CAAC;AACb,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare class ToolError extends Error {
|
|
|
3
3
|
constructor(message: string, status?: number);
|
|
4
4
|
}
|
|
5
5
|
export declare function getBaseUrl(): string;
|
|
6
|
+
export declare function buildHeaders(extra?: Record<string, string>): Record<string, string>;
|
|
6
7
|
export declare function postJson<T>(path: string, body: unknown): Promise<T>;
|
|
7
8
|
export declare function postJsonLong<T>(path: string, body: unknown, timeoutMs?: number): Promise<T>;
|
|
8
9
|
export declare function getJson<T>(path: string): Promise<T>;
|
package/dist/client.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* agent as readable text instead of a stack trace.
|
|
9
9
|
*/
|
|
10
10
|
import { detectIde, getSessionId } from "./session.js";
|
|
11
|
+
import { readCredentials } from "./auth.js";
|
|
11
12
|
import { VERSION } from "./version.js";
|
|
12
13
|
const DEFAULT_BASE_URL = "https://fetchsandbox.com";
|
|
13
14
|
const REQUEST_TIMEOUT_MS = 30_000;
|
|
@@ -27,7 +28,7 @@ export class ToolError extends Error {
|
|
|
27
28
|
export function getBaseUrl() {
|
|
28
29
|
return (process.env.FETCHSANDBOX_BASE_URL || DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
29
30
|
}
|
|
30
|
-
function buildHeaders(extra) {
|
|
31
|
+
export function buildHeaders(extra) {
|
|
31
32
|
const ide = detectIde();
|
|
32
33
|
const headers = {
|
|
33
34
|
"user-agent": `fetchsandbox-mcp/${VERSION} (node ${process.version}; ide=${ide})`,
|
|
@@ -38,6 +39,12 @@ function buildHeaders(extra) {
|
|
|
38
39
|
if (sid)
|
|
39
40
|
headers["x-mcp-session-id"] = sid;
|
|
40
41
|
headers["x-mcp-client"] = ide;
|
|
42
|
+
// The session id IS the install id (see auth.ts) and the backend already
|
|
43
|
+
// reads that header everywhere, so a key is the only thing to add. Absent
|
|
44
|
+
// credentials send nothing and the request behaves exactly as it did before.
|
|
45
|
+
const creds = readCredentials();
|
|
46
|
+
if (creds?.apiKey)
|
|
47
|
+
headers["authorization"] = `Bearer ${creds.apiKey}`;
|
|
41
48
|
return headers;
|
|
42
49
|
}
|
|
43
50
|
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,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,wEAAwE;AACxE,gEAAgE;AAChE,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,UAAU,UAAU;IACxB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client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,CAAM,CAAC;AACjC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,17 +18,18 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
18
18
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
19
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
20
20
|
import { ToolError, getBaseUrl } from "./client.js";
|
|
21
|
+
import { withSignIn } from "./signin.js";
|
|
21
22
|
import { detectIde } from "./session.js";
|
|
22
23
|
import { importSpecTool, runImportSpec } from "./tools/import_spec.js";
|
|
23
24
|
import { listSpecsTool, runListSpecs } from "./tools/list_specs.js";
|
|
24
25
|
import { listWorkflowsTool, runListWorkflows } from "./tools/list_workflows.js";
|
|
25
26
|
import { listRunsTool, runListRuns } from "./tools/list_runs.js";
|
|
26
27
|
import { runRunWorkflow, runWorkflowTool } from "./tools/run_workflow.js";
|
|
27
|
-
import { runRunAllWorkflows, runAllWorkflowsTool } from "./tools/run_all_workflows.js";
|
|
28
|
+
import { runRunAllWorkflows, runAllWorkflowsTool, } from "./tools/run_all_workflows.js";
|
|
28
29
|
import { guideTool, runGuide } from "./tools/guide.js";
|
|
29
30
|
import { coachTool, runCoach } from "./tools/coach.js";
|
|
30
|
-
import { verifyBehaviorTool, runVerifyBehavior } from "./tools/verify_behavior.js";
|
|
31
|
-
import { submitProofTool, runSubmitProof } from "./tools/submit_proof.js";
|
|
31
|
+
import { verifyBehaviorTool, runVerifyBehavior, } from "./tools/verify_behavior.js";
|
|
32
|
+
import { submitProofTool, runSubmitProof, } from "./tools/submit_proof.js";
|
|
32
33
|
import { quickrunTool, runQuickrun } from "./tools/quickrun.js";
|
|
33
34
|
import { findBugsTool, runFindBugs } from "./tools/find_bugs.js";
|
|
34
35
|
import { fixBugTool, runFixBug } from "./tools/fix_bug.js";
|
|
@@ -56,126 +57,131 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
56
57
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
57
58
|
const { name, arguments: args } = req.params;
|
|
58
59
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
? a.
|
|
69
|
-
: undefined,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
60
|
+
// withSignIn re-runs this on the one occasion it can succeed the second
|
|
61
|
+
// time: a 401 that the human has since resolved in a browser.
|
|
62
|
+
const result = await withSignIn(async () => {
|
|
63
|
+
let result;
|
|
64
|
+
const a = (args ?? {});
|
|
65
|
+
switch (name) {
|
|
66
|
+
case coachTool.name:
|
|
67
|
+
result = await runCoach({
|
|
68
|
+
intent: typeof a.intent === "string" ? a.intent : undefined,
|
|
69
|
+
session_id: typeof a.session_id === "string" ? a.session_id : undefined,
|
|
70
|
+
user_response: typeof a.user_response === "string" ? a.user_response : undefined,
|
|
71
|
+
context: a.context && typeof a.context === "object"
|
|
72
|
+
? a.context
|
|
73
|
+
: undefined,
|
|
74
|
+
});
|
|
75
|
+
break;
|
|
76
|
+
case findBugsTool.name:
|
|
77
|
+
result = await runFindBugs({
|
|
78
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
79
|
+
spec: typeof a.spec === "string" ? a.spec : undefined,
|
|
80
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
81
|
+
});
|
|
82
|
+
break;
|
|
83
|
+
case fixBugTool.name:
|
|
84
|
+
result = await runFixBug({
|
|
85
|
+
bug: typeof a.bug === "string" ? a.bug : "",
|
|
86
|
+
fix_pattern: typeof a.fix_pattern === "string" ? a.fix_pattern : undefined,
|
|
87
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
88
|
+
spec: typeof a.spec === "string" ? a.spec : undefined,
|
|
89
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
90
|
+
});
|
|
91
|
+
break;
|
|
92
|
+
case proveFixTool.name:
|
|
93
|
+
result = await runProveFix({
|
|
94
|
+
diff: typeof a.diff === "string" ? a.diff : "",
|
|
95
|
+
bug: typeof a.bug === "string" ? a.bug : undefined,
|
|
96
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
97
|
+
path: typeof a.path === "string" ? a.path : undefined,
|
|
98
|
+
timeout_s: typeof a.timeout_s === "number" ? a.timeout_s : undefined,
|
|
99
|
+
});
|
|
100
|
+
break;
|
|
101
|
+
case guideTool.name:
|
|
102
|
+
result = await runGuide({
|
|
103
|
+
intent: typeof a.intent === "string" ? a.intent : "",
|
|
104
|
+
// A caller-supplied context beats the automatic repo scan — an
|
|
105
|
+
// explicit statement of what the repo integrates is a fact, not a
|
|
106
|
+
// guess, and the dispatcher must not drop it on the floor.
|
|
107
|
+
context: a.context && typeof a.context === "object"
|
|
108
|
+
? a.context
|
|
109
|
+
: undefined,
|
|
110
|
+
hints: a.hints && typeof a.hints === "object"
|
|
111
|
+
? a.hints
|
|
112
|
+
: undefined,
|
|
113
|
+
});
|
|
114
|
+
break;
|
|
115
|
+
case quickrunTool.name:
|
|
116
|
+
result = await runQuickrun({
|
|
117
|
+
spec_slug: typeof a.spec_slug === "string" ? a.spec_slug : "",
|
|
118
|
+
workflow_name: typeof a.workflow_name === "string" ? a.workflow_name : "",
|
|
119
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
case listSpecsTool.name:
|
|
123
|
+
result = await runListSpecs({
|
|
124
|
+
filter: typeof a.filter === "string" ? a.filter : undefined,
|
|
125
|
+
});
|
|
126
|
+
break;
|
|
127
|
+
case importSpecTool.name:
|
|
128
|
+
result = await runImportSpec({
|
|
129
|
+
url: typeof a.url === "string" ? a.url : undefined,
|
|
130
|
+
content: typeof a.content === "string" ? a.content : undefined,
|
|
131
|
+
name: typeof a.name === "string" ? a.name : undefined,
|
|
132
|
+
});
|
|
133
|
+
break;
|
|
134
|
+
case listWorkflowsTool.name:
|
|
135
|
+
result = await runListWorkflows({
|
|
136
|
+
spec_id: typeof a.spec_id === "string" ? a.spec_id : "",
|
|
137
|
+
});
|
|
138
|
+
break;
|
|
139
|
+
case listRunsTool.name:
|
|
140
|
+
result = await runListRuns({
|
|
141
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
142
|
+
limit: typeof a.limit === "number" ? a.limit : undefined,
|
|
143
|
+
});
|
|
144
|
+
break;
|
|
145
|
+
case runWorkflowTool.name:
|
|
146
|
+
result = await runRunWorkflow({
|
|
147
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
148
|
+
workflow_name: typeof a.workflow_name === "string" ? a.workflow_name : "",
|
|
149
|
+
// scenario was dropped here (schema + runRunWorkflow both support it),
|
|
150
|
+
// silently forcing the happy path — the exact "agent skipped the proof"
|
|
151
|
+
// failure this product exists to prevent. Forward it. (2026-07-15)
|
|
152
|
+
scenario: typeof a.scenario === "string" ? a.scenario : undefined,
|
|
153
|
+
});
|
|
154
|
+
break;
|
|
155
|
+
case runAllWorkflowsTool.name:
|
|
156
|
+
result = await runRunAllWorkflows({
|
|
157
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
158
|
+
workflow_names: Array.isArray(a.workflow_names)
|
|
159
|
+
? a.workflow_names.filter((x) => typeof x === "string")
|
|
160
|
+
: undefined,
|
|
161
|
+
});
|
|
162
|
+
break;
|
|
163
|
+
case verifyBehaviorTool.name:
|
|
164
|
+
result = await runVerifyBehavior({
|
|
165
|
+
bug_pattern_id: typeof a.bug_pattern_id === "string" ? a.bug_pattern_id : "",
|
|
166
|
+
prompt: typeof a.prompt === "string" ? a.prompt : undefined,
|
|
167
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : undefined,
|
|
168
|
+
flow_run_id: typeof a.flow_run_id === "string" ? a.flow_run_id : undefined,
|
|
169
|
+
});
|
|
170
|
+
break;
|
|
171
|
+
case submitProofTool.name:
|
|
172
|
+
result = await runSubmitProof({
|
|
173
|
+
sandbox_id: typeof a.sandbox_id === "string" ? a.sandbox_id : "",
|
|
174
|
+
flow_run_id: typeof a.flow_run_id === "string" ? a.flow_run_id : "",
|
|
175
|
+
bug_pattern_id: typeof a.bug_pattern_id === "string" ? a.bug_pattern_id : "",
|
|
176
|
+
summary: typeof a.summary === "string" ? a.summary : undefined,
|
|
177
|
+
proofs: Array.isArray(a.proofs) ? a.proofs : [],
|
|
178
|
+
});
|
|
179
|
+
break;
|
|
180
|
+
default:
|
|
181
|
+
throw new ToolError(`Unknown tool: ${name}`);
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
});
|
|
179
185
|
return {
|
|
180
186
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
181
187
|
};
|
|
@@ -191,12 +197,19 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
191
197
|
function friendlyError(toolName, msg, err) {
|
|
192
198
|
// Surface common backend errors as agent-readable hints instead of raw HTTP.
|
|
193
199
|
const status = err instanceof ToolError ? err.status : undefined;
|
|
200
|
+
// A 401 carries the sign-in instructions verbatim — pass them straight
|
|
201
|
+
// through rather than wrapping them in "Error:" and a hint.
|
|
202
|
+
if (status === 401)
|
|
203
|
+
return msg;
|
|
194
204
|
const m = msg.toLowerCase();
|
|
195
|
-
if (m.includes("not a valid openapi spec") ||
|
|
205
|
+
if (m.includes("not a valid openapi spec") ||
|
|
206
|
+
m.includes("missing 'openapi'")) {
|
|
196
207
|
return (`Error: that file isn't an OpenAPI 3.x spec — it's missing the top-level "openapi" key. ` +
|
|
197
208
|
`If you have a Swagger 2.0 spec, convert it first (e.g. with swagger-converter). Original: ${msg}`);
|
|
198
209
|
}
|
|
199
|
-
if (m.includes("non-public ip") ||
|
|
210
|
+
if (m.includes("non-public ip") ||
|
|
211
|
+
m.includes("loopback") ||
|
|
212
|
+
m.includes("did not resolve")) {
|
|
200
213
|
return (`Error: that URL can't be fetched — it's either non-public, points to a private network, or doesn't resolve. ` +
|
|
201
214
|
`Public OpenAPI URLs (raw.githubusercontent.com, vendor docs portals) work; localhost and internal hosts don't. ` +
|
|
202
215
|
`Original: ${msg}`);
|
|
@@ -209,7 +222,7 @@ function friendlyError(toolName, msg, err) {
|
|
|
209
222
|
`For GitHub, use the raw.githubusercontent.com URL, not the github.com page URL. Original: ${msg}`);
|
|
210
223
|
}
|
|
211
224
|
if (m.includes("exceeds") && m.includes("mb cap")) {
|
|
212
|
-
return
|
|
225
|
+
return `Error: spec is too large. Hard cap is 20 MB. Original: ${msg}`;
|
|
213
226
|
}
|
|
214
227
|
if (m.includes("workflow") && m.includes("not found")) {
|
|
215
228
|
return (`Error: that workflow name isn't recognized. Call list_workflows(spec_id=...) first to see ` +
|
|
@@ -266,7 +279,8 @@ let invokedAsCli = false;
|
|
|
266
279
|
try {
|
|
267
280
|
invokedAsCli =
|
|
268
281
|
!!process.argv[1] &&
|
|
269
|
-
realpathSync(process.argv[1]) ===
|
|
282
|
+
realpathSync(process.argv[1]) ===
|
|
283
|
+
realpathSync(fileURLToPath(import.meta.url));
|
|
270
284
|
}
|
|
271
285
|
catch {
|
|
272
286
|
invokedAsCli = false;
|
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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C,CAAC;AACL,CAAC"}
|
package/dist/signin.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Credentials } from "./auth.js";
|
|
2
|
+
interface DeviceCodeResponse {
|
|
3
|
+
device_code: string;
|
|
4
|
+
user_code: string;
|
|
5
|
+
verification_uri: string;
|
|
6
|
+
expires_in: number;
|
|
7
|
+
interval: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function startDeviceFlow(): Promise<DeviceCodeResponse>;
|
|
10
|
+
/** Human-facing instructions. This is what the agent shows in the IDE. */
|
|
11
|
+
export declare function signInMessage(d: DeviceCodeResponse): string;
|
|
12
|
+
/** One redemption attempt. `null` means "not yet", a throw means "start over". */
|
|
13
|
+
export declare function redeemOnce(d: DeviceCodeResponse): Promise<Credentials | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Wait out a sign-in the human has already been shown. Resolves with
|
|
16
|
+
* credentials, or `null` if they are still not done — never throws on "pending",
|
|
17
|
+
* because "not finished yet" is a normal answer, not an error.
|
|
18
|
+
*/
|
|
19
|
+
export declare function awaitApproval(d: DeviceCodeResponse): Promise<Credentials | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Run a tool call, handling "you need an account" without ever blocking on a
|
|
22
|
+
* code the human has not seen.
|
|
23
|
+
*
|
|
24
|
+
* First 401 -> start a flow and return the code IMMEDIATELY. The agent shows
|
|
25
|
+
* it; nothing is gained by waiting, because until that message is
|
|
26
|
+
* on screen there is nobody to approve anything.
|
|
27
|
+
* Later 401 -> they have seen it, so wait out the browser round trip, then
|
|
28
|
+
* retry the call once.
|
|
29
|
+
*
|
|
30
|
+
* If the backend has no device endpoints (an old deployment, or a client newer
|
|
31
|
+
* than the server) the original error is re-thrown untouched, so a version skew
|
|
32
|
+
* degrades to exactly today's behaviour instead of a hard wall.
|
|
33
|
+
*/
|
|
34
|
+
export declare function withSignIn<T>(call: () => Promise<T>): Promise<T>;
|
|
35
|
+
export {};
|
package/dist/signin.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sign-in handshake, run from inside a tool call.
|
|
3
|
+
*
|
|
4
|
+
* The whole design constraint is that this process cannot talk to the human.
|
|
5
|
+
* It can only RETURN something the agent will show them. So:
|
|
6
|
+
*
|
|
7
|
+
* 1. ask the backend for a code
|
|
8
|
+
* 2. return a message containing the URL and the code
|
|
9
|
+
* 3. the agent shows it; the human signs in on the website
|
|
10
|
+
* 4. poll until approved, write the key, carry on
|
|
11
|
+
*
|
|
12
|
+
* Step 4 blocks the tool call. That is intentional and it is why the poll has
|
|
13
|
+
* a hard ceiling: an agent left waiting forever is worse than a clear failure,
|
|
14
|
+
* and the human can always re-run the tool to start again.
|
|
15
|
+
*/
|
|
16
|
+
import { buildHeaders, getBaseUrl, ToolError } from "./client.js";
|
|
17
|
+
import { installId, readCredentials, writeCredentials } from "./auth.js";
|
|
18
|
+
import { detectIde } from "./session.js";
|
|
19
|
+
// Only ever used on a RETRY, when the human has already been shown the code and
|
|
20
|
+
// is mid-sign-in. Long enough to cover a browser round trip, short enough that
|
|
21
|
+
// an agent is never left hanging on someone who walked away.
|
|
22
|
+
const GRACE_POLL_MS = 45_000;
|
|
23
|
+
async function post(path, body) {
|
|
24
|
+
const res = await fetch(`${getBaseUrl()}${path}`, {
|
|
25
|
+
method: "POST",
|
|
26
|
+
// Same headers as every other call: the audit trail ties a sign-in to the
|
|
27
|
+
// install and the editor it came from, which is the whole point of it.
|
|
28
|
+
headers: buildHeaders({ "content-type": "application/json" }),
|
|
29
|
+
body: JSON.stringify(body),
|
|
30
|
+
});
|
|
31
|
+
let json = {};
|
|
32
|
+
try {
|
|
33
|
+
json = await res.json();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
/* an empty or non-JSON body is handled by the caller via status */
|
|
37
|
+
}
|
|
38
|
+
return { status: res.status, json: json };
|
|
39
|
+
}
|
|
40
|
+
export async function startDeviceFlow() {
|
|
41
|
+
const { status, json } = await post("/api/auth/device/code", {
|
|
42
|
+
client_name: detectIde(),
|
|
43
|
+
install_id: installId(),
|
|
44
|
+
});
|
|
45
|
+
if (status !== 200 || !json?.user_code) {
|
|
46
|
+
throw new ToolError("Could not start sign-in. Check your connection and try again.", status);
|
|
47
|
+
}
|
|
48
|
+
return json;
|
|
49
|
+
}
|
|
50
|
+
/** Human-facing instructions. This is what the agent shows in the IDE. */
|
|
51
|
+
export function signInMessage(d) {
|
|
52
|
+
const url = `${d.verification_uri}?code=${encodeURIComponent(d.user_code)}`;
|
|
53
|
+
return [
|
|
54
|
+
"FetchSandbox needs a free account before it can run this.",
|
|
55
|
+
"",
|
|
56
|
+
` 1. Open ${url}`,
|
|
57
|
+
` 2. Sign in — no password, we email you a link`,
|
|
58
|
+
"",
|
|
59
|
+
`Your code is ${d.user_code}. It expires in ${Math.round(d.expires_in / 60)} minutes.`,
|
|
60
|
+
"I'll wait here and continue as soon as you're done.",
|
|
61
|
+
].join("\n");
|
|
62
|
+
}
|
|
63
|
+
/** One redemption attempt. `null` means "not yet", a throw means "start over". */
|
|
64
|
+
export async function redeemOnce(d) {
|
|
65
|
+
const { status, json } = await post("/api/auth/device/token", { device_code: d.device_code, install_id: installId() });
|
|
66
|
+
if (status === 200 && json.api_key) {
|
|
67
|
+
const creds = {
|
|
68
|
+
apiKey: json.api_key,
|
|
69
|
+
email: json.email ?? "",
|
|
70
|
+
createdAt: new Date().toISOString(),
|
|
71
|
+
};
|
|
72
|
+
writeCredentials(creds);
|
|
73
|
+
return creds;
|
|
74
|
+
}
|
|
75
|
+
const err = json?.detail?.error;
|
|
76
|
+
// "authorization_pending" is the ONLY status that means keep waiting.
|
|
77
|
+
if (err && err !== "authorization_pending") {
|
|
78
|
+
throw new ToolError(err === "expired_token"
|
|
79
|
+
? "That sign-in code expired. Run this again to get a new one."
|
|
80
|
+
: "That sign-in could not be completed. Run this again to start over.");
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Wait out a sign-in the human has already been shown. Resolves with
|
|
86
|
+
* credentials, or `null` if they are still not done — never throws on "pending",
|
|
87
|
+
* because "not finished yet" is a normal answer, not an error.
|
|
88
|
+
*/
|
|
89
|
+
export async function awaitApproval(d) {
|
|
90
|
+
const intervalMs = Math.max(2, d.interval || 5) * 1000;
|
|
91
|
+
const deadline = Date.now() + GRACE_POLL_MS;
|
|
92
|
+
// Try immediately: on a retry the approval has usually already landed.
|
|
93
|
+
let creds = await redeemOnce(d);
|
|
94
|
+
while (!creds && Date.now() < deadline) {
|
|
95
|
+
await new Promise((r) => setTimeout(r, intervalMs));
|
|
96
|
+
creds = await redeemOnce(d);
|
|
97
|
+
}
|
|
98
|
+
return creds;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A sign-in started on an earlier tool call and not yet finished. In memory
|
|
102
|
+
* only: this process outlives every individual call, and if it does restart we
|
|
103
|
+
* simply start a new flow.
|
|
104
|
+
*/
|
|
105
|
+
let pending = null;
|
|
106
|
+
/**
|
|
107
|
+
* Run a tool call, handling "you need an account" without ever blocking on a
|
|
108
|
+
* code the human has not seen.
|
|
109
|
+
*
|
|
110
|
+
* First 401 -> start a flow and return the code IMMEDIATELY. The agent shows
|
|
111
|
+
* it; nothing is gained by waiting, because until that message is
|
|
112
|
+
* on screen there is nobody to approve anything.
|
|
113
|
+
* Later 401 -> they have seen it, so wait out the browser round trip, then
|
|
114
|
+
* retry the call once.
|
|
115
|
+
*
|
|
116
|
+
* If the backend has no device endpoints (an old deployment, or a client newer
|
|
117
|
+
* than the server) the original error is re-thrown untouched, so a version skew
|
|
118
|
+
* degrades to exactly today's behaviour instead of a hard wall.
|
|
119
|
+
*/
|
|
120
|
+
export async function withSignIn(call) {
|
|
121
|
+
// Cheap, non-blocking: an approval that landed between calls is picked up here.
|
|
122
|
+
if (pending && !readCredentials()?.apiKey) {
|
|
123
|
+
const creds = await redeemOnce(pending).catch(() => null);
|
|
124
|
+
if (creds)
|
|
125
|
+
pending = null;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
return await call();
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
if (!(e instanceof ToolError) || e.status !== 401)
|
|
132
|
+
throw e;
|
|
133
|
+
if (pending) {
|
|
134
|
+
const creds = await awaitApproval(pending).catch(() => null);
|
|
135
|
+
if (creds) {
|
|
136
|
+
pending = null;
|
|
137
|
+
return await call();
|
|
138
|
+
}
|
|
139
|
+
throw new ToolError(signInMessage(pending), 401);
|
|
140
|
+
}
|
|
141
|
+
let started;
|
|
142
|
+
try {
|
|
143
|
+
started = await startDeviceFlow();
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
throw e; // no device endpoints — behave as before
|
|
147
|
+
}
|
|
148
|
+
pending = started;
|
|
149
|
+
throw new ToolError(signInMessage(started), 401);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=signin.js.map
|
|
@@ -0,0 +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;AAEzC,gFAAgF;AAChF,+EAA+E;AAC/E,6DAA6D;AAC7D,MAAM,aAAa,GAAG,MAAM,CAAC;AAU7B,KAAK,UAAU,IAAI,CAAI,IAAY,EAAE,IAAa;IAChD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE;QAChD,MAAM,EAAE,MAAM;QACd,0EAA0E;QAC1E,uEAAuE;QACvE,OAAO,EAAE,YAAY,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAA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B,MAAM,IAAI,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -28,6 +28,10 @@ export declare const findBugsTool: {
|
|
|
28
28
|
export declare function runFindBugs(input: FindBugsInput): Promise<{
|
|
29
29
|
available: boolean;
|
|
30
30
|
bugs: string | null;
|
|
31
|
+
next_actions?: unknown;
|
|
32
|
+
prove_instructions?: unknown;
|
|
31
33
|
engine: string;
|
|
32
34
|
packed_bytes: number;
|
|
35
|
+
/** Backend-authored sign-in line. Declared here or tsc drops it. */
|
|
36
|
+
notice?: string;
|
|
33
37
|
}>;
|
package/dist/tools/find_bugs.js
CHANGED
|
@@ -52,6 +52,10 @@ export const findBugsTool = {
|
|
|
52
52
|
additionalProperties: false,
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
|
+
// THE RETURN TYPE IS THE WHITELIST. Every field the agent will ever see has to
|
|
56
|
+
// be named here, so a field added anywhere upstream is dropped by omission and
|
|
57
|
+
// the compiler calls the addition an error rather than the loss. That is how
|
|
58
|
+
// next_actions survived three hops and died at the fourth.
|
|
55
59
|
export async function runFindBugs(input) {
|
|
56
60
|
const dir = input.path && input.path.trim() ? input.path.trim() : process.cwd();
|
|
57
61
|
const { b64, bytes } = packDirToBase64(dir);
|
|
@@ -75,6 +79,22 @@ export async function runFindBugs(input) {
|
|
|
75
79
|
return {
|
|
76
80
|
available: true,
|
|
77
81
|
bugs: raw.bugs ?? null,
|
|
82
|
+
// THE FOURTH WHITELIST, and the one that undid the other three. Phalanx ->
|
|
83
|
+
// backend -> /jobs -> HERE -> the agent. The backend comment at hop three
|
|
84
|
+
// reads "Adding next_actions in _work() and forwarding it in the client was
|
|
85
|
+
// not enough" -- someone traced three hops and fixed them, and this return
|
|
86
|
+
// silently discarded the result. This tool's own description twelve lines
|
|
87
|
+
// above promises "the response carries next_actions telling you exactly
|
|
88
|
+
// what" and then did not carry them.
|
|
89
|
+
//
|
|
90
|
+
// Measured 2026-09-09: five personas, next_actions absent from every
|
|
91
|
+
// find_bugs result, quickrun called zero times. The routing existed at every
|
|
92
|
+
// layer except the one the agent reads.
|
|
93
|
+
next_actions: raw.next_actions ?? undefined,
|
|
94
|
+
// THE FIFTH WHITELIST. Every field the backend adds must be named
|
|
95
|
+
// here or it is invisible — this is what hid next_actions for weeks.
|
|
96
|
+
notice: raw.notice ?? undefined,
|
|
97
|
+
prove_instructions: raw.prove_instructions ?? undefined,
|
|
78
98
|
engine: raw.engine ?? "fetchsandbox",
|
|
79
99
|
packed_bytes: bytes,
|
|
80
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find_bugs.js","sourceRoot":"","sources":["../../src/tools/find_bugs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAe5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,4EAA4E;QAC5E,4EAA4E;QAC5E,2EAA2E;QAC3E,4EAA4E;QAC5E,yDAAyD;QACzD,yEAAyE;QACzE,6EAA6E;QAC7E,6EAA6E;QAC7E,4EAA4E;QAC5E,4EAA4E;QAC5E,yEAAyE;QACzE,4EAA4E;QAC5E,2EAA2E;QAC3E,wDAAwD;IAC1D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,qEAAqE;oBACrE,iEAAiE;aACpE;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;oBACnE,oEAAoE;oBACpE,wBAAwB;aAC3B;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAA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EAAE;QACF,qEAAqE;QACrE,6EAA6E;QAC7E,wCAAwC;QACxC,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,SAAS;QAC3C,kEAAkE;QAClE,qEAAqE;QACrE,MAAM,EAAG,GAAG,CAAC,MAAiB,IAAI,SAAS;QAC3C,kBAAkB,EAAE,GAAG,CAAC,kBAAkB,IAAI,SAAS;QACvD,MAAM,EAAG,GAAG,CAAC,MAAiB,IAAI,cAAc;QAChD,YAAY,EAAE,KAAK;KACpB,CAAC;AACJ,CAAC"}
|
package/dist/tools/prove_fix.js
CHANGED
|
@@ -103,6 +103,9 @@ export async function runProveFix(input) {
|
|
|
103
103
|
scenario: raw.scenario,
|
|
104
104
|
receipt_url: raw.receipt_url,
|
|
105
105
|
engine: raw.engine ?? "fetchsandbox",
|
|
106
|
+
// THE FIFTH WHITELIST. Every field the backend adds must be named
|
|
107
|
+
// here or it is invisible — this is what hid next_actions for weeks.
|
|
108
|
+
notice: raw.notice ?? undefined,
|
|
106
109
|
};
|
|
107
110
|
}
|
|
108
111
|
//# sourceMappingURL=prove_fix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove_fix.js","sourceRoot":"","sources":["../../src/tools/prove_fix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAW5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,2EAA2E;QAC3E,oDAAoD;QACpD,6EAA6E;QAC7E,2EAA2E;QAC3E,4EAA4E;QAC5E,uEAAuE;QACvE,yEAAyE;QACzE,4EAA4E;QAC5E,cAAc;QACd,2EAA2E;QAC3E,6EAA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C,KAAK,EAAE,GAAG,CAAC,KAA2B;QACtC,UAAU,EAAE,GAAG,CAAC,UAAiC;QACjD,QAAQ,EAAE,GAAG,CAAC,QAA+B;QAC7C,MAAM,EAAE,GAAG,CAAC,MAA4B;QACxC,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,WAAW,EAAE,GAAG,CAAC,WAAiC;QAClD,MAAM,EAAG,GAAG,CAAC,MAAiB,IAAI,cAAc;QAChD,kEAAkE;QAClE,qEAAqE;QACrE,MAAM,EAAG,GAAG,CAAC,MAAiB,IAAI,SAAS;KAC5C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fetchsandbox-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"mcpName": "io.github.fetchsandbox/mcp",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "The verification engine for AI agents. Runs your integration against every service it touches with failures injected on purpose, then proves a fix: the same scenario fails on the old code and passes on the new, with a receipt.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "FetchSandbox",
|
|
8
8
|
"homepage": "https://fetchsandbox.com",
|
|
@@ -16,12 +16,17 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"mcp",
|
|
18
18
|
"model-context-protocol",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
19
|
+
"verification",
|
|
20
|
+
"agent-verification",
|
|
21
|
+
"integration-testing",
|
|
22
|
+
"webhook-testing",
|
|
23
|
+
"idempotency",
|
|
24
|
+
"api-sandbox",
|
|
25
|
+
"stripe",
|
|
26
|
+
"paddle",
|
|
22
27
|
"claude",
|
|
23
28
|
"cursor",
|
|
24
|
-
"
|
|
29
|
+
"openapi"
|
|
25
30
|
],
|
|
26
31
|
"type": "module",
|
|
27
32
|
"main": "dist/index.js",
|