@principlebreach/scopedown-mcp 1.2.0 → 1.3.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 +2 -2
- package/package.json +1 -1
- package/src/server.js +45 -18
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Your session never leaves the browser. The agent talks to this server, the serve
|
|
|
30
30
|
| --- | --- |
|
|
31
31
|
| `status` | Connected browsers, signed-in accounts and their email aliases, what you allowed, drafts waiting |
|
|
32
32
|
| `get_email_alias` | Your platform email aliases for the test accounts programs ask for, and `username+tag@` addresses for several accounts |
|
|
33
|
-
| `list_programs` | Programs you can submit to; `private_only`, `query`, paging |
|
|
33
|
+
| `list_programs` | Programs you can submit to, public and private, each with `offers_bounties` and `submissions` on both platforms; `private_only`, `query`, paging |
|
|
34
34
|
| `get_program` | The program as agent-ready Markdown: key rules, scope tables, rewards, full policy, headed by your email alias for that platform |
|
|
35
35
|
| `check_scope` | Verdict per host, URL, IP or CIDR: in scope, out of scope, or not listed |
|
|
36
36
|
| `get_report_requirements` | What a report to this program needs: required fields, custom fields and their allowed values, assets, quota, and whether it is filed directly or finished in the platform's form |
|
|
@@ -40,7 +40,7 @@ Your session never leaves the browser. The agent talks to this server, the serve
|
|
|
40
40
|
| `draft_report` | A draft for you to review, with optional evidence files; validated against the program's scope |
|
|
41
41
|
| `attach_file`, `remove_attachment` | Evidence on a draft: images, video, logs, HAR, PDF, ZIP; 20 MB each, 10 per draft |
|
|
42
42
|
| `update_draft` | Revise a draft, for example after you reject it with a note |
|
|
43
|
-
| `get_draft`, `list_drafts` | Draft status; `get_draft` can wait up to 10 minutes for your decision |
|
|
43
|
+
| `get_draft`, `list_drafts` | Draft status; `get_draft` can wait up to 10 minutes for your decision. `list_drafts` filters by program, one short row per draft |
|
|
44
44
|
|
|
45
45
|
Lists return `next_cursor` when there is more; pass it back as `cursor` with the platform. Reference an attached file inside a report with `{{attachment:file-name}}`.
|
|
46
46
|
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -16,7 +16,7 @@ Work like a careful researcher:
|
|
|
16
16
|
1. Read the program with get_program before testing. Follow its key rules exactly (required headers, test account emails, rate limits, banned techniques).
|
|
17
17
|
2. Call check_scope for every host or URL before you send it traffic. Only "in_scope" targets may be tested. "not_listed" means do not test.
|
|
18
18
|
3. Sign up for test accounts with the user's platform email alias from get_email_alias (tags give one address per account), unless the program names another address. Mail to it reaches the user, not you: ask the user for any link or code it brings.
|
|
19
|
-
4. Before drafting, check for duplicates with search_disclosed_reports (where the platform has it) and
|
|
19
|
+
4. Before drafting, check for duplicates with search_disclosed_reports (where the platform has it), list_my_reports, and list_drafts with platform and handle.
|
|
20
20
|
5. Call get_report_requirements for the program. It lists the required fields, the program's custom fields with their allowed values, the in-scope assets, and whether the report is filed directly or finished in the platform's form. Pick the weakness with get_weaknesses: a HackerOne weakness, or the most specific Bugcrowd VRT entry, whose priority sets the baseline.
|
|
21
21
|
6. draft_report never submits on its own. The user reviews each draft in the browser, unless they turned on auto-submit for that program. Attach evidence with attachments or attach_file. Use get_draft with wait_seconds to learn the outcome, and update_draft to address a rejection note.
|
|
22
22
|
|
|
@@ -40,6 +40,19 @@ const aliasLine = (alias) => (typeof alias === 'string' && PLAIN_ADDRESS.test(al
|
|
|
40
40
|
: '');
|
|
41
41
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
42
42
|
|
|
43
|
+
// Unknown parameters are refused rather than dropped: a dropped "program" would turn a search
|
|
44
|
+
// for one program into a search of every program.
|
|
45
|
+
function strict(shape) {
|
|
46
|
+
const known = Object.keys(shape);
|
|
47
|
+
return z.strictObject(shape, {
|
|
48
|
+
error: (issue) => {
|
|
49
|
+
if (issue.code !== 'unrecognized_keys') return undefined;
|
|
50
|
+
const hint = issue.keys.includes('program') && known.includes('handle') ? ' The program goes in handle.' : '';
|
|
51
|
+
return `Unknown parameter${issue.keys.length > 1 ? 's' : ''} ${issue.keys.map((k) => `"${k}"`).join(', ')}.${hint} This tool takes: ${known.join(', ')}.`;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
43
56
|
export function createServer(bridge = new Bridge()) {
|
|
44
57
|
const server = new McpServer({ name: 'scopedown', version: VERSION }, { instructions: INSTRUCTIONS });
|
|
45
58
|
|
|
@@ -58,7 +71,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
58
71
|
const reply = (text) => ({ content: [{ type: 'text', text }] });
|
|
59
72
|
const fail = (e) => ({ isError: true, content: [{ type: 'text', text: `${e.code || 'error'}: ${e.message}` }] });
|
|
60
73
|
|
|
61
|
-
const tool = (name, config, run) => server.registerTool(name, config, async (args) => {
|
|
74
|
+
const tool = (name, config, run) => server.registerTool(name, { ...config, inputSchema: strict(config.inputSchema) }, async (args) => {
|
|
62
75
|
try {
|
|
63
76
|
return await run(args ?? {});
|
|
64
77
|
} catch (e) {
|
|
@@ -101,7 +114,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
101
114
|
|
|
102
115
|
readTool('list_programs', {
|
|
103
116
|
title: 'List programs',
|
|
104
|
-
description: 'Lists programs the user can submit reports to. private_only shows private invitations; query searches by name or handle. Each platform returns its own next_cursor; to page, pass platform with that cursor until it is null. A page can hold fewer than limit programs and still have a next_cursor.',
|
|
117
|
+
description: 'Lists programs the user can submit reports to: on HackerOne every program the account can report to, on Bugcrowd its accepted invitations of every kind and the public bug bounties and VDPs. Rows read the same on both platforms: visibility is "public" or "private" (HackerOne also returns "sandbox" for a sandbox program, and any other program state as it comes), offers_bounties says whether it pays money (false for a VDP or points only; a Bugcrowd bug bounty that lists no reward range counts as paying), and submissions is "open" when it takes reports (otherwise the reason: HackerOne "paused" or "disabled", Bugcrowd "ended", "banned" or "demo"). Bugcrowd rows add rewards, its own reward range. private_only shows private invitations; query searches by name or handle. Each platform returns its own next_cursor; to page, pass platform with that cursor until it is null. A page can hold fewer than limit programs and still have a next_cursor.',
|
|
105
118
|
inputSchema: {
|
|
106
119
|
platform: platform.optional().describe('Limit to one platform. Default: both.'),
|
|
107
120
|
private_only: z.boolean().optional().describe('Only private programs the user was invited to.'),
|
|
@@ -120,7 +133,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
120
133
|
|
|
121
134
|
tool('list_scope_changes', {
|
|
122
135
|
title: 'List new and changed scope',
|
|
123
|
-
description: 'Lists what changed in the scope of every program the user can submit to: assets added, removed or changed (in scope, bounty eligibility, max severity, notes), and programs that became available (a new private invitation or a launch) or went away. Newest first. Each change says when it happened (at) and who dated it: dated_by "platform" is the platform\'s own date, "scopedown" is when ScopeDown noticed. Each call first checks the platforms for changes
|
|
136
|
+
description: 'Lists what changed in the scope of every program the user can submit to: assets added, removed or changed (in scope, bounty eligibility, max severity, notes), and programs that became available (a new private invitation or a launch) or went away. Newest first. Each change says when it happened (at) and who dated it: dated_by "platform" is the platform\'s own date, "scopedown" is when ScopeDown noticed. Each call first checks the platforms for changes and answers within about 20 seconds with what is stored. The first check reads every program and can take a few minutes: while checking is true, call again with refresh false a minute later for the rest. All filters work across every program. Before testing a new asset, read the program with get_program and run check_scope.',
|
|
124
137
|
inputSchema: {
|
|
125
138
|
platform: platform.optional().describe('Limit to one platform. Default: all.'),
|
|
126
139
|
handle: handle.optional().describe('Only this program. Needs platform.'),
|
|
@@ -141,12 +154,9 @@ export function createServer(bridge = new Bridge()) {
|
|
|
141
154
|
},
|
|
142
155
|
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
143
156
|
}, async ({ browser: b, ...params }) => {
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
while (out.checking && params.cursor === undefined && Date.now() < deadline) {
|
|
148
|
-
out = await send('list_scope_changes', { ...params, refresh: false, wait_seconds: 45 }, { browser: b, retry: true, timeoutMs: 80_000 });
|
|
149
|
-
}
|
|
157
|
+
// Many MCP clients give up on a call after 30 seconds, so wait at most 20 for the check and
|
|
158
|
+
// return what is stored; the reply says checking is true and the agent calls again.
|
|
159
|
+
const out = await send('list_scope_changes', { ...params, wait_seconds: 20 }, { browser: b, timeoutMs: 27_000 });
|
|
150
160
|
return reply(UNTRUSTED + json(out));
|
|
151
161
|
});
|
|
152
162
|
|
|
@@ -186,7 +196,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
186
196
|
|
|
187
197
|
readTool('search_disclosed_reports', {
|
|
188
198
|
title: 'Search disclosed reports',
|
|
189
|
-
description: 'Searches publicly disclosed reports (
|
|
199
|
+
description: 'HackerOne only. Searches publicly disclosed reports (Hacktivity), optionally for one program by handle. Use it to avoid duplicates and to learn what a program has already fixed. Bugcrowd has no public search, so for a Bugcrowd program use list_my_reports with handle.',
|
|
190
200
|
inputSchema: { platform: platform.optional().describe('Default: the first platform with disclosed reports (hackerone).'), handle: handle.optional(), query: z.string().max(200).optional().describe('Words to search for, such as "ssrf webhook".'), limit: z.number().int().min(1).max(50).optional(), cursor, browser },
|
|
191
201
|
}, { format: (r) => UNTRUSTED + json(r) });
|
|
192
202
|
|
|
@@ -198,7 +208,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
198
208
|
|
|
199
209
|
readTool('get_my_report', {
|
|
200
210
|
title: 'Get one of my reports',
|
|
201
|
-
description: 'Returns one of the user\'s reports with its state, severity and the comment thread, so you can see what triage asked for. Long threads page with thread_cursor. A disclosed report by someone else can be read too: check yours, which is true only for the user\'s own reports. A limited disclosure has no description; its summaries hold what was published.
|
|
211
|
+
description: 'HackerOne only. Returns one of the user\'s reports with its state, severity and the comment thread, so you can see what triage asked for. Long threads page with thread_cursor. A disclosed report by someone else can be read too: check yours, which is true only for the user\'s own reports. A limited disclosure has no description; its summaries hold what was published. Platforms where status shows report_threads false (Bugcrowd) return unsupported; list_my_reports gives their state.',
|
|
202
212
|
inputSchema: {
|
|
203
213
|
platform,
|
|
204
214
|
id: z.string().regex(/^[\w-]{1,40}$/).describe('Report id, as in hackerone.com/reports/<id>.'),
|
|
@@ -213,7 +223,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
213
223
|
weakness: z.string().max(200).optional().describe('Weakness name or id from get_weaknesses, for example "Cross-site Scripting (XSS) - Stored" or a Bugcrowd VRT id.'),
|
|
214
224
|
severity: z.enum(['none', 'low', 'medium', 'high', 'critical']).optional().describe('Your severity estimate. Be conservative. Required on HackerOne; on Bugcrowd it defaults to the VRT entry\'s priority.'),
|
|
215
225
|
cvss_vector: z.string().max(200).optional().describe('Optional CVSS 3.1 or 4.0 vector supporting the severity.'),
|
|
216
|
-
url: z.string().max(2048).optional().describe('The exact URL where the issue occurs.'),
|
|
226
|
+
url: z.string().max(2048).optional().describe('The exact http(s) URL where the issue occurs. For a WebSocket, give the https:// URL of its handshake.'),
|
|
217
227
|
http_request: z.string().max(30_000).optional().describe('One raw HTTP request that demonstrates the issue.'),
|
|
218
228
|
custom_fields: z.record(z.string(), z.union([z.string(), z.boolean()])).optional().describe('Values for the program\'s custom fields, keyed by the key or label from get_report_requirements. Required ones must be set; list fields take one of their options.'),
|
|
219
229
|
description: z.string().min(80).max(60_000).describe('Markdown: summary, exact steps to reproduce, and the requests or code needed. Reference an attached file inline with {{attachment:file-name.png}}. Never include secrets or data you were not authorized to access.'),
|
|
@@ -223,7 +233,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
223
233
|
|
|
224
234
|
tool('draft_report', {
|
|
225
235
|
title: 'Draft a report for review',
|
|
226
|
-
description: 'Creates a report draft for the user to review in the browser, with optional evidence files. Call get_report_requirements first. Nothing is sent to the platform until the user approves it, unless they turned on auto-submit for this program, in which case it is filed at once (attach files with this call in that case). The asset must be in scope and every required field set. Returns a draft id; call get_draft with wait_seconds to learn the outcome.',
|
|
236
|
+
description: 'Creates a report draft for the user to review in the browser, with optional evidence files. Call get_report_requirements first. Nothing is sent to the platform until the user approves it, unless they turned on auto-submit for this program, in which case it is filed at once (attach files with this call in that case). The asset must be in scope and every required field set. There is no limit on drafts. Returns a draft id, and similar_drafts when the same program already has drafts that may report the same bug; call get_draft with wait_seconds to learn the outcome.',
|
|
227
237
|
inputSchema: { platform, handle, ...reportFields, attachments: files, browser },
|
|
228
238
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
229
239
|
}, async ({ browser: b, attachments = [], ...params }) => {
|
|
@@ -266,7 +276,7 @@ export function createServer(bridge = new Bridge()) {
|
|
|
266
276
|
tool('get_draft', {
|
|
267
277
|
title: 'Get a draft and its review outcome',
|
|
268
278
|
description: 'Returns a draft and its status: pending_review, submitting, submitted (with the report URL), rejected (with the user\'s note), handed_off (ScopeDown filled the platform\'s form and the user finishes it there; form_prefill lists what was filled and what was left to the user) or failed (with the platform error). Set wait_seconds to wait for the user\'s decision.',
|
|
269
|
-
inputSchema: { draft_id: z.string().min(1).max(64), wait_seconds: z.number().int().min(0).max(600).optional().describe('Wait up to this long for the status to leave pending_review. Default 0.'), browser },
|
|
279
|
+
inputSchema: { draft_id: z.string().min(1).max(64), wait_seconds: z.number().int().min(0).max(600).optional().describe('Wait up to this long for the status to leave pending_review. Default 0. If your client stops waiting for a tool after 30 seconds, keep this under 25 and call again.'), browser },
|
|
270
280
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
271
281
|
}, async ({ draft_id: id, wait_seconds: wait = 0, browser: b }) => {
|
|
272
282
|
// The wait happens here, in short polls, so no single browser request lasts long and a
|
|
@@ -288,9 +298,16 @@ export function createServer(bridge = new Bridge()) {
|
|
|
288
298
|
|
|
289
299
|
readTool('list_drafts', {
|
|
290
300
|
title: 'List drafts',
|
|
291
|
-
description: 'Lists report drafts created by agents, newest first,
|
|
292
|
-
inputSchema: {
|
|
293
|
-
|
|
301
|
+
description: 'Lists report drafts created by agents, newest first, one short row each (get_draft has the full draft). Filter by program with platform and handle, which is how to check a program for drafts of the same bug.',
|
|
302
|
+
inputSchema: {
|
|
303
|
+
status: z.enum(['pending_review', 'submitting', 'submitted', 'rejected', 'handed_off', 'failed']).optional(),
|
|
304
|
+
platform: platform.optional().describe('Only drafts for this platform.'),
|
|
305
|
+
handle: handle.optional().describe('Only drafts for this program. Needs platform.'),
|
|
306
|
+
limit: z.number().int().min(1).max(100).optional().describe('Default 25.'),
|
|
307
|
+
cursor,
|
|
308
|
+
browser,
|
|
309
|
+
},
|
|
310
|
+
}, { format: rows('drafts') });
|
|
294
311
|
|
|
295
312
|
return server;
|
|
296
313
|
}
|
|
@@ -299,6 +316,16 @@ function json(value) {
|
|
|
299
316
|
return JSON.stringify(value, null, 2);
|
|
300
317
|
}
|
|
301
318
|
|
|
319
|
+
// Valid JSON with one compact row per line: a long list costs about a fifth less than indented.
|
|
320
|
+
function rows(key) {
|
|
321
|
+
return (r) => {
|
|
322
|
+
const { [key]: list = [], ...rest } = r;
|
|
323
|
+
const head = JSON.stringify(rest).slice(0, -1);
|
|
324
|
+
const body = list.length ? `[\n${list.map((x) => JSON.stringify(x)).join(',\n')}\n]` : '[]';
|
|
325
|
+
return `${head}${head.length > 1 ? ',' : ''}"${key}":${body}}`;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
302
329
|
export async function runServer() {
|
|
303
330
|
const bridge = new Bridge();
|
|
304
331
|
const server = createServer(bridge);
|