autoremediator 0.2.1 → 0.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 +20 -1
- package/dist/{chunk-DQKT2CUG.js → chunk-URM53GSJ.js} +388 -133
- package/dist/chunk-URM53GSJ.js.map +1 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +51 -13
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +42 -2
- package/dist/index.js +3 -1
- package/dist/mcp/server.d.ts +277 -0
- package/dist/mcp/server.js +115 -15
- package/dist/mcp/server.js.map +1 -1
- package/dist/openapi/server.d.ts +400 -1
- package/dist/openapi/server.js +192 -50
- package/dist/openapi/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-DQKT2CUG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -48,8 +48,21 @@ interface PatchResult {
|
|
|
48
48
|
error?: string;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
interface CorrelationContext {
|
|
52
|
+
requestId?: string;
|
|
53
|
+
sessionId?: string;
|
|
54
|
+
parentRunId?: string;
|
|
55
|
+
}
|
|
56
|
+
interface RemediationConstraints {
|
|
57
|
+
directDependenciesOnly?: boolean;
|
|
58
|
+
preferVersionBump?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface ProvenanceContext {
|
|
61
|
+
actor?: string;
|
|
62
|
+
source?: "cli" | "sdk" | "mcp" | "openapi" | "unknown";
|
|
63
|
+
}
|
|
51
64
|
/** Top-level options for the remediate() API and CLI */
|
|
52
|
-
interface RemediateOptions {
|
|
65
|
+
interface RemediateOptions extends CorrelationContext {
|
|
53
66
|
/** Working directory of the consumer's project (defaults to process.cwd()) */
|
|
54
67
|
cwd?: string;
|
|
55
68
|
/** Package manager to use (defaults to auto-detect from lockfile) */
|
|
@@ -66,6 +79,17 @@ interface RemediateOptions {
|
|
|
66
79
|
policyPath?: string;
|
|
67
80
|
/** Directory to write .patch files (default: ./patches) */
|
|
68
81
|
patchesDir?: string;
|
|
82
|
+
/** If true, run a non-mutating remediation preview (forces dryRun behavior for mutation tools). */
|
|
83
|
+
preview?: boolean;
|
|
84
|
+
/** Optional deterministic idempotency key for request replay handling. */
|
|
85
|
+
idempotencyKey?: string;
|
|
86
|
+
/** If true, return cached report for matching idempotency key + CVE when available. */
|
|
87
|
+
resume?: boolean;
|
|
88
|
+
/** Optional caller provenance fields for evidence and reporting. */
|
|
89
|
+
actor?: string;
|
|
90
|
+
source?: "cli" | "sdk" | "mcp" | "openapi" | "unknown";
|
|
91
|
+
/** Optional orchestration constraints for result enforcement. */
|
|
92
|
+
constraints?: RemediationConstraints;
|
|
69
93
|
}
|
|
70
94
|
/** Final report returned by the remediation pipeline */
|
|
71
95
|
interface RemediationReport {
|
|
@@ -75,6 +99,10 @@ interface RemediationReport {
|
|
|
75
99
|
results: PatchResult[];
|
|
76
100
|
agentSteps: number;
|
|
77
101
|
summary: string;
|
|
102
|
+
correlation?: CorrelationContext;
|
|
103
|
+
provenance?: ProvenanceContext;
|
|
104
|
+
constraints?: RemediationConstraints;
|
|
105
|
+
resumedFromCache?: boolean;
|
|
78
106
|
}
|
|
79
107
|
|
|
80
108
|
type ScanInputFormat = "npm-audit" | "yarn-audit" | "sarif" | "auto";
|
|
@@ -106,6 +134,10 @@ interface ScanReport {
|
|
|
106
134
|
error: string;
|
|
107
135
|
}>;
|
|
108
136
|
patchStorageDir?: string;
|
|
137
|
+
correlation?: CorrelationContext;
|
|
138
|
+
provenance?: ProvenanceContext;
|
|
139
|
+
constraints?: RemediationConstraints;
|
|
140
|
+
idempotencyKey?: string;
|
|
109
141
|
}
|
|
110
142
|
interface CiSummary {
|
|
111
143
|
schemaVersion: "1.0";
|
|
@@ -127,6 +159,10 @@ interface CiSummary {
|
|
|
127
159
|
error: string;
|
|
128
160
|
}>;
|
|
129
161
|
patchStorageDir?: string;
|
|
162
|
+
correlation?: CorrelationContext;
|
|
163
|
+
provenance?: ProvenanceContext;
|
|
164
|
+
constraints?: RemediationConstraints;
|
|
165
|
+
idempotencyKey?: string;
|
|
130
166
|
}
|
|
131
167
|
/**
|
|
132
168
|
* Main entry point for programmatic use.
|
|
@@ -136,6 +172,10 @@ interface CiSummary {
|
|
|
136
172
|
* @returns A RemediationReport describing what was found and done
|
|
137
173
|
*/
|
|
138
174
|
declare function remediate(cveId: string, options?: RemediateOptions): Promise<RemediationReport>;
|
|
175
|
+
/**
|
|
176
|
+
* Non-mutating preview entrypoint for planning and orchestration.
|
|
177
|
+
*/
|
|
178
|
+
declare function planRemediation(cveId: string, options?: RemediateOptions): Promise<RemediationReport>;
|
|
139
179
|
/**
|
|
140
180
|
* Scanner-first entrypoint: parse a scanner output file (npm audit JSON or SARIF),
|
|
141
181
|
* extract CVEs, and run remediations one-by-one.
|
|
@@ -144,4 +184,4 @@ declare function remediateFromScan(inputPath: string, options?: ScanOptions): Pr
|
|
|
144
184
|
declare function toCiSummary(report: ScanReport): CiSummary;
|
|
145
185
|
declare function ciExitCode(summary: CiSummary): number;
|
|
146
186
|
|
|
147
|
-
export { type AffectedPackage, type CiSummary, type CveDetails, type InventoryPackage, type PatchResult, type PatchStrategy, type RemediateOptions, type RemediationReport, type ScanInputFormat, type ScanOptions, type ScanReport, type VulnerablePackage, ciExitCode, remediate, remediateFromScan, runRemediationPipeline, toCiSummary };
|
|
187
|
+
export { type AffectedPackage, type CiSummary, type CorrelationContext, type CveDetails, type InventoryPackage, type PatchResult, type PatchStrategy, type ProvenanceContext, type RemediateOptions, type RemediationConstraints, type RemediationReport, type ScanInputFormat, type ScanOptions, type ScanReport, type VulnerablePackage, ciExitCode, planRemediation, remediate, remediateFromScan, runRemediationPipeline, toCiSummary };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ciExitCode,
|
|
3
|
+
planRemediation,
|
|
3
4
|
remediate,
|
|
4
5
|
remediateFromScan,
|
|
5
6
|
runRemediationPipeline,
|
|
6
7
|
toCiSummary
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-URM53GSJ.js";
|
|
8
9
|
export {
|
|
9
10
|
ciExitCode,
|
|
11
|
+
planRemediation,
|
|
10
12
|
remediate,
|
|
11
13
|
remediateFromScan,
|
|
12
14
|
runRemediationPipeline,
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1 +1,278 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { remediate, planRemediation, remediateFromScan } from '../index.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* autoremediator MCP server
|
|
7
|
+
*
|
|
8
|
+
* Exposes all autoremediator tools via the Model Context Protocol so LLM hosts
|
|
9
|
+
* (Claude Desktop, Cursor, Copilot, etc.) can invoke them directly.
|
|
10
|
+
*
|
|
11
|
+
* Start: autoremediator-mcp (stdio transport)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
interface McpApiDeps {
|
|
15
|
+
remediateFn: typeof remediate;
|
|
16
|
+
planRemediationFn: typeof planRemediation;
|
|
17
|
+
remediateFromScanFn: typeof remediateFromScan;
|
|
18
|
+
}
|
|
19
|
+
declare const TOOLS: ({
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: string;
|
|
24
|
+
required: string[];
|
|
25
|
+
properties: {
|
|
26
|
+
cveId: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
cwd: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
packageManager: {
|
|
35
|
+
type: string;
|
|
36
|
+
enum: string[];
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
dryRun: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
preview: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
skipTests: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
llmProvider: {
|
|
52
|
+
type: string;
|
|
53
|
+
enum: string[];
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
patchesDir: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
requestId: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
sessionId: {
|
|
65
|
+
type: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
parentRunId: {
|
|
69
|
+
type: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
idempotencyKey: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
resume: {
|
|
77
|
+
type: string;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
actor: {
|
|
81
|
+
type: string;
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
source: {
|
|
85
|
+
type: string;
|
|
86
|
+
enum: string[];
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
constraints: {
|
|
90
|
+
type: string;
|
|
91
|
+
properties: {
|
|
92
|
+
directDependenciesOnly: {
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
preferVersionBump: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
inputPath?: undefined;
|
|
101
|
+
format?: undefined;
|
|
102
|
+
writeEvidence?: undefined;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
} | {
|
|
106
|
+
name: string;
|
|
107
|
+
description: string;
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: string;
|
|
110
|
+
required: string[];
|
|
111
|
+
properties: {
|
|
112
|
+
cveId: {
|
|
113
|
+
type: string;
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
cwd: {
|
|
117
|
+
type: string;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
packageManager: {
|
|
121
|
+
type: string;
|
|
122
|
+
enum: string[];
|
|
123
|
+
description: string;
|
|
124
|
+
};
|
|
125
|
+
skipTests: {
|
|
126
|
+
type: string;
|
|
127
|
+
description: string;
|
|
128
|
+
};
|
|
129
|
+
llmProvider: {
|
|
130
|
+
type: string;
|
|
131
|
+
enum: string[];
|
|
132
|
+
description: string;
|
|
133
|
+
};
|
|
134
|
+
patchesDir: {
|
|
135
|
+
type: string;
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
requestId: {
|
|
139
|
+
type: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
sessionId: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
parentRunId: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
idempotencyKey: {
|
|
151
|
+
type: string;
|
|
152
|
+
description: string;
|
|
153
|
+
};
|
|
154
|
+
resume: {
|
|
155
|
+
type: string;
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
actor: {
|
|
159
|
+
type: string;
|
|
160
|
+
description: string;
|
|
161
|
+
};
|
|
162
|
+
source: {
|
|
163
|
+
type: string;
|
|
164
|
+
enum: string[];
|
|
165
|
+
description: string;
|
|
166
|
+
};
|
|
167
|
+
constraints: {
|
|
168
|
+
type: string;
|
|
169
|
+
properties: {
|
|
170
|
+
directDependenciesOnly: {
|
|
171
|
+
type: string;
|
|
172
|
+
};
|
|
173
|
+
preferVersionBump: {
|
|
174
|
+
type: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
dryRun?: undefined;
|
|
179
|
+
preview?: undefined;
|
|
180
|
+
inputPath?: undefined;
|
|
181
|
+
format?: undefined;
|
|
182
|
+
writeEvidence?: undefined;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
} | {
|
|
186
|
+
name: string;
|
|
187
|
+
description: string;
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: string;
|
|
190
|
+
required: string[];
|
|
191
|
+
properties: {
|
|
192
|
+
inputPath: {
|
|
193
|
+
type: string;
|
|
194
|
+
description: string;
|
|
195
|
+
};
|
|
196
|
+
cwd: {
|
|
197
|
+
type: string;
|
|
198
|
+
description: string;
|
|
199
|
+
};
|
|
200
|
+
packageManager: {
|
|
201
|
+
type: string;
|
|
202
|
+
enum: string[];
|
|
203
|
+
description: string;
|
|
204
|
+
};
|
|
205
|
+
format: {
|
|
206
|
+
type: string;
|
|
207
|
+
enum: string[];
|
|
208
|
+
description: string;
|
|
209
|
+
};
|
|
210
|
+
dryRun: {
|
|
211
|
+
type: string;
|
|
212
|
+
description: string;
|
|
213
|
+
};
|
|
214
|
+
preview: {
|
|
215
|
+
type: string;
|
|
216
|
+
description: string;
|
|
217
|
+
};
|
|
218
|
+
writeEvidence: {
|
|
219
|
+
type: string;
|
|
220
|
+
description: string;
|
|
221
|
+
};
|
|
222
|
+
requestId: {
|
|
223
|
+
type: string;
|
|
224
|
+
description: string;
|
|
225
|
+
};
|
|
226
|
+
sessionId: {
|
|
227
|
+
type: string;
|
|
228
|
+
description: string;
|
|
229
|
+
};
|
|
230
|
+
parentRunId: {
|
|
231
|
+
type: string;
|
|
232
|
+
description: string;
|
|
233
|
+
};
|
|
234
|
+
idempotencyKey: {
|
|
235
|
+
type: string;
|
|
236
|
+
description: string;
|
|
237
|
+
};
|
|
238
|
+
resume: {
|
|
239
|
+
type: string;
|
|
240
|
+
description: string;
|
|
241
|
+
};
|
|
242
|
+
actor: {
|
|
243
|
+
type: string;
|
|
244
|
+
description: string;
|
|
245
|
+
};
|
|
246
|
+
source: {
|
|
247
|
+
type: string;
|
|
248
|
+
enum: string[];
|
|
249
|
+
description: string;
|
|
250
|
+
};
|
|
251
|
+
constraints: {
|
|
252
|
+
type: string;
|
|
253
|
+
properties: {
|
|
254
|
+
directDependenciesOnly: {
|
|
255
|
+
type: string;
|
|
256
|
+
};
|
|
257
|
+
preferVersionBump: {
|
|
258
|
+
type: string;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
cveId?: undefined;
|
|
263
|
+
skipTests?: undefined;
|
|
264
|
+
llmProvider?: undefined;
|
|
265
|
+
patchesDir?: undefined;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
})[];
|
|
269
|
+
declare function handleToolCall(name: string, args?: Record<string, unknown>, deps?: McpApiDeps): Promise<{
|
|
270
|
+
content: Array<{
|
|
271
|
+
type: "text";
|
|
272
|
+
text: string;
|
|
273
|
+
}>;
|
|
274
|
+
isError?: boolean;
|
|
275
|
+
}>;
|
|
276
|
+
declare function createMcpServer(): Server;
|
|
277
|
+
|
|
278
|
+
export { TOOLS, createMcpServer, handleToolCall };
|
package/dist/mcp/server.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
planRemediation,
|
|
3
4
|
remediate,
|
|
4
5
|
remediateFromScan
|
|
5
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-URM53GSJ.js";
|
|
6
7
|
|
|
7
8
|
// src/mcp/server.ts
|
|
8
9
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
@@ -11,10 +12,18 @@ import {
|
|
|
11
12
|
CallToolRequestSchema,
|
|
12
13
|
ListToolsRequestSchema
|
|
13
14
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
import { fileURLToPath } from "url";
|
|
16
|
+
var defaultDeps = {
|
|
17
|
+
remediateFn: remediate,
|
|
18
|
+
planRemediationFn: planRemediation,
|
|
19
|
+
remediateFromScanFn: remediateFromScan
|
|
20
|
+
};
|
|
21
|
+
function createBaseServer() {
|
|
22
|
+
return new Server(
|
|
23
|
+
{ name: "autoremediator", version: "0.1.2" },
|
|
24
|
+
{ capabilities: { tools: {} } }
|
|
25
|
+
);
|
|
26
|
+
}
|
|
18
27
|
var TOOLS = [
|
|
19
28
|
{
|
|
20
29
|
name: "remediate",
|
|
@@ -27,9 +36,54 @@ var TOOLS = [
|
|
|
27
36
|
cwd: { type: "string", description: "Absolute path to the project root (default: process.cwd())" },
|
|
28
37
|
packageManager: { type: "string", enum: ["npm", "pnpm", "yarn"], description: "Package manager override (auto-detected by default)" },
|
|
29
38
|
dryRun: { type: "boolean", description: "If true, plan changes but write nothing (default: false)" },
|
|
39
|
+
preview: { type: "boolean", description: "If true, enforce non-mutating preview mode" },
|
|
30
40
|
skipTests: { type: "boolean", description: "Skip package-manager test command after applying fix (default: true)" },
|
|
31
41
|
llmProvider: { type: "string", enum: ["openai", "anthropic", "local"], description: "LLM provider override" },
|
|
32
|
-
patchesDir: { type: "string", description: "Directory to write .patch files (default: ./patches)" }
|
|
42
|
+
patchesDir: { type: "string", description: "Directory to write .patch files (default: ./patches)" },
|
|
43
|
+
requestId: { type: "string", description: "Request correlation ID" },
|
|
44
|
+
sessionId: { type: "string", description: "Session correlation ID" },
|
|
45
|
+
parentRunId: { type: "string", description: "Parent run correlation ID" },
|
|
46
|
+
idempotencyKey: { type: "string", description: "Idempotency key for replay-safe execution" },
|
|
47
|
+
resume: { type: "boolean", description: "Return cached result for matching idempotency key when available" },
|
|
48
|
+
actor: { type: "string", description: "Actor identity for evidence provenance" },
|
|
49
|
+
source: { type: "string", enum: ["cli", "sdk", "mcp", "openapi", "unknown"], description: "Source system for provenance" },
|
|
50
|
+
constraints: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
directDependenciesOnly: { type: "boolean" },
|
|
54
|
+
preferVersionBump: { type: "boolean" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "planRemediation",
|
|
62
|
+
description: "Generate a non-mutating remediation preview for a single CVE in a Node.js project. Returns a RemediationReport with planned results.",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
required: ["cveId"],
|
|
66
|
+
properties: {
|
|
67
|
+
cveId: { type: "string", description: "CVE ID, e.g. CVE-2021-23337" },
|
|
68
|
+
cwd: { type: "string", description: "Absolute path to the project root (default: process.cwd())" },
|
|
69
|
+
packageManager: { type: "string", enum: ["npm", "pnpm", "yarn"], description: "Package manager override (auto-detected by default)" },
|
|
70
|
+
skipTests: { type: "boolean", description: "Skip package-manager test command after applying fix (default: true)" },
|
|
71
|
+
llmProvider: { type: "string", enum: ["openai", "anthropic", "local"], description: "LLM provider override" },
|
|
72
|
+
patchesDir: { type: "string", description: "Directory to write .patch files (default: ./patches)" },
|
|
73
|
+
requestId: { type: "string", description: "Request correlation ID" },
|
|
74
|
+
sessionId: { type: "string", description: "Session correlation ID" },
|
|
75
|
+
parentRunId: { type: "string", description: "Parent run correlation ID" },
|
|
76
|
+
idempotencyKey: { type: "string", description: "Idempotency key for replay-safe execution" },
|
|
77
|
+
resume: { type: "boolean", description: "Return cached result for matching idempotency key when available" },
|
|
78
|
+
actor: { type: "string", description: "Actor identity for evidence provenance" },
|
|
79
|
+
source: { type: "string", enum: ["cli", "sdk", "mcp", "openapi", "unknown"], description: "Source system for provenance" },
|
|
80
|
+
constraints: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
directDependenciesOnly: { type: "boolean" },
|
|
84
|
+
preferVersionBump: { type: "boolean" }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
33
87
|
}
|
|
34
88
|
}
|
|
35
89
|
},
|
|
@@ -45,23 +99,45 @@ var TOOLS = [
|
|
|
45
99
|
packageManager: { type: "string", enum: ["npm", "pnpm", "yarn"], description: "Package manager override (auto-detected by default)" },
|
|
46
100
|
format: { type: "string", enum: ["auto", "npm-audit", "yarn-audit", "sarif"], description: "Scanner format (default: auto)" },
|
|
47
101
|
dryRun: { type: "boolean", description: "If true, plan changes but write nothing" },
|
|
48
|
-
|
|
102
|
+
preview: { type: "boolean", description: "If true, enforce non-mutating preview mode" },
|
|
103
|
+
writeEvidence: { type: "boolean", description: "Write evidence JSON to .autoremediator/evidence/ (default: true)" },
|
|
104
|
+
requestId: { type: "string", description: "Request correlation ID" },
|
|
105
|
+
sessionId: { type: "string", description: "Session correlation ID" },
|
|
106
|
+
parentRunId: { type: "string", description: "Parent run correlation ID" },
|
|
107
|
+
idempotencyKey: { type: "string", description: "Idempotency key for replay-safe execution" },
|
|
108
|
+
resume: { type: "boolean", description: "Return cached result for matching idempotency key when available" },
|
|
109
|
+
actor: { type: "string", description: "Actor identity for evidence provenance" },
|
|
110
|
+
source: { type: "string", enum: ["cli", "sdk", "mcp", "openapi", "unknown"], description: "Source system for provenance" },
|
|
111
|
+
constraints: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
directDependenciesOnly: { type: "boolean" },
|
|
115
|
+
preferVersionBump: { type: "boolean" }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
49
118
|
}
|
|
50
119
|
}
|
|
51
120
|
}
|
|
52
121
|
];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
122
|
+
async function handleToolCall(name, args = {}, deps = defaultDeps) {
|
|
123
|
+
const withMcpSource = (options) => ({
|
|
124
|
+
...options,
|
|
125
|
+
source: typeof options.source === "string" ? options.source : "mcp"
|
|
126
|
+
});
|
|
56
127
|
try {
|
|
57
128
|
if (name === "remediate") {
|
|
58
129
|
const { cveId, ...options } = args;
|
|
59
|
-
const report = await
|
|
130
|
+
const report = await deps.remediateFn(cveId, withMcpSource(options));
|
|
131
|
+
return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
|
|
132
|
+
}
|
|
133
|
+
if (name === "planRemediation") {
|
|
134
|
+
const { cveId, ...options } = args;
|
|
135
|
+
const report = await deps.planRemediationFn(cveId, withMcpSource(options));
|
|
60
136
|
return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
|
|
61
137
|
}
|
|
62
138
|
if (name === "remediateFromScan") {
|
|
63
139
|
const { inputPath, ...options } = args;
|
|
64
|
-
const report = await
|
|
140
|
+
const report = await deps.remediateFromScanFn(inputPath, withMcpSource(options));
|
|
65
141
|
return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
|
|
66
142
|
}
|
|
67
143
|
return {
|
|
@@ -74,7 +150,31 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
74
150
|
isError: true
|
|
75
151
|
};
|
|
76
152
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
153
|
+
}
|
|
154
|
+
function createMcpServer() {
|
|
155
|
+
const server = createBaseServer();
|
|
156
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
157
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
158
|
+
const { name, arguments: args } = request.params;
|
|
159
|
+
return handleToolCall(name, args ?? {});
|
|
160
|
+
});
|
|
161
|
+
return server;
|
|
162
|
+
}
|
|
163
|
+
async function startMcpServer() {
|
|
164
|
+
const transport = new StdioServerTransport();
|
|
165
|
+
const server = createMcpServer();
|
|
166
|
+
await server.connect(transport);
|
|
167
|
+
}
|
|
168
|
+
function isMainModule() {
|
|
169
|
+
if (!process.argv[1]) return false;
|
|
170
|
+
return fileURLToPath(import.meta.url) === process.argv[1];
|
|
171
|
+
}
|
|
172
|
+
if (isMainModule()) {
|
|
173
|
+
await startMcpServer();
|
|
174
|
+
}
|
|
175
|
+
export {
|
|
176
|
+
TOOLS,
|
|
177
|
+
createMcpServer,
|
|
178
|
+
handleToolCall
|
|
179
|
+
};
|
|
80
180
|
//# sourceMappingURL=server.js.map
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mcp/server.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * autoremediator MCP server\n *\n * Exposes all autoremediator tools via the Model Context Protocol so LLM hosts\n * (Claude Desktop, Cursor, Copilot, etc.) can invoke them directly.\n *\n * Start: autoremediator-mcp (stdio transport)\n */\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { remediate, remediateFromScan } from \"../api.js\";\n\nconst server = new Server(\n { name: \"autoremediator\", version: \"0.1.2\" },\n { capabilities: { tools: {} } }\n);\n\n// ---------------------------------------------------------------------------\n// Tool definitions\n// ---------------------------------------------------------------------------\n\nconst TOOLS = [\n {\n name: \"remediate\",\n description:\n \"Remediate a single CVE in a Node.js project. Looks up the CVE, scans the project inventory, and applies a version bump or generates a patch file. Returns a RemediationReport.\",\n inputSchema: {\n type: \"object\",\n required: [\"cveId\"],\n properties: {\n cveId: { type: \"string\", description: \"CVE ID, e.g. CVE-2021-23337\" },\n cwd: { type: \"string\", description: \"Absolute path to the project root (default: process.cwd())\" },\n packageManager: { type: \"string\", enum: [\"npm\", \"pnpm\", \"yarn\"], description: \"Package manager override (auto-detected by default)\" },\n dryRun: { type: \"boolean\", description: \"If true, plan changes but write nothing (default: false)\" },\n skipTests: { type: \"boolean\", description: \"Skip package-manager test command after applying fix (default: true)\" },\n llmProvider: { type: \"string\", enum: [\"openai\", \"anthropic\", \"local\"], description: \"LLM provider override\" },\n patchesDir: { type: \"string\", description: \"Directory to write .patch files (default: ./patches)\" },\n },\n },\n },\n {\n name: \"remediateFromScan\",\n description:\n \"Parse an npm/pnpm/yarn audit JSON or SARIF scan file, extract all CVE IDs, and remediate each one. Returns a ScanReport.\",\n inputSchema: {\n type: \"object\",\n required: [\"inputPath\"],\n properties: {\n inputPath: { type: \"string\", description: \"Absolute path to the scanner output file\" },\n cwd: { type: \"string\", description: \"Absolute path to the project root\" },\n packageManager: { type: \"string\", enum: [\"npm\", \"pnpm\", \"yarn\"], description: \"Package manager override (auto-detected by default)\" },\n format: { type: \"string\", enum: [\"auto\", \"npm-audit\", \"yarn-audit\", \"sarif\"], description: \"Scanner format (default: auto)\" },\n dryRun: { type: \"boolean\", description: \"If true, plan changes but write nothing\" },\n writeEvidence: { type: \"boolean\", description: \"Write evidence JSON to .autoremediator/evidence/ (default: true)\" },\n },\n },\n },\n];\n\n// ---------------------------------------------------------------------------\n// Handlers\n// ---------------------------------------------------------------------------\n\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));\n\nserver.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n\n try {\n if (name === \"remediate\") {\n const { cveId, ...options } = args as { cveId: string; [key: string]: unknown };\n const report = await remediate(cveId, options as Parameters<typeof remediate>[1]);\n return { content: [{ type: \"text\", text: JSON.stringify(report, null, 2) }] };\n }\n\n if (name === \"remediateFromScan\") {\n const { inputPath, ...options } = args as { inputPath: string; [key: string]: unknown };\n const report = await remediateFromScan(inputPath, options as Parameters<typeof remediateFromScan>[1]);\n return { content: [{ type: \"text\", text: JSON.stringify(report, null, 2) }] };\n }\n\n return {\n content: [{ type: \"text\", text: `Unknown tool: ${name}` }],\n isError: true,\n };\n } catch (err) {\n return {\n content: [{ type: \"text\", text: err instanceof Error ? err.message : String(err) }],\n isError: true,\n };\n }\n});\n\n// ---------------------------------------------------------------------------\n// Start\n// ---------------------------------------------------------------------------\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n"],"mappings":";;;;;;;AASA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,IAAM,SAAS,IAAI;AAAA,EACjB,EAAE,MAAM,kBAAkB,SAAS,QAAQ;AAAA,EAC3C,EAAE,cAAc,EAAE,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AAO,MAAM,EAAE;AAE/E,OAAO,kBAAkB,uBAAuB,OAAO,YAAY;AACjE,QAAM,EAAE,MAAM,WAAW,KAAK,IAAI,QAAQ;AAE1C,MAAI;AACF,QAAI,SAAS,aAAa;AACxB,YAAM,EAAE,OAAO,GAAG,QAAQ,IAAI;AAC9B,YAAM,SAAS,MAAM,UAAU,OAAO,OAA0C;AAChF,aAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,CAAC,EAAE;AAAA,IAC9E;AAEA,QAAI,SAAS,qBAAqB;AAChC,YAAM,EAAE,WAAW,GAAG,QAAQ,IAAI;AAClC,YAAM,SAAS,MAAM,kBAAkB,WAAW,OAAkD;AACpG,aAAO,EAAE,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,CAAC,EAAE;AAAA,IAC9E;AAEA,WAAO;AAAA,MACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,iBAAiB,IAAI,GAAG,CAAC;AAAA,MACzD,SAAS;AAAA,IACX;AAAA,EACF,SAAS,KAAK;AACZ,WAAO;AAAA,MACL,SAAS,CAAC,EAAE,MAAM,QAAQ,MAAM,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC;AAAA,MAClF,SAAS;AAAA,IACX;AAAA,EACF;AACF,CAAC;AAMD,IAAM,YAAY,IAAI,qBAAqB;AAC3C,MAAM,OAAO,QAAQ,SAAS;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/mcp/server.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * autoremediator MCP server\n *\n * Exposes all autoremediator tools via the Model Context Protocol so LLM hosts\n * (Claude Desktop, Cursor, Copilot, etc.) can invoke them directly.\n *\n * Start: autoremediator-mcp (stdio transport)\n */\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport { fileURLToPath } from \"node:url\";\nimport { planRemediation, remediate, remediateFromScan } from \"../api.js\";\n\ninterface McpApiDeps {\n remediateFn: typeof remediate;\n planRemediationFn: typeof planRemediation;\n remediateFromScanFn: typeof remediateFromScan;\n}\n\nconst defaultDeps: McpApiDeps = {\n remediateFn: remediate,\n planRemediationFn: planRemediation,\n remediateFromScanFn: remediateFromScan,\n};\n\nfunction createBaseServer(): Server {\n return new Server(\n { name: \"autoremediator\", version: \"0.1.2\" },\n { capabilities: { tools: {} } }\n );\n}\n\n// ---------------------------------------------------------------------------\n// Tool definitions\n// ---------------------------------------------------------------------------\n\nexport const TOOLS = [\n {\n name: \"remediate\",\n description:\n \"Remediate a single CVE in a Node.js project. Looks up the CVE, scans the project inventory, and applies a version bump or generates a patch file. Returns a RemediationReport.\",\n inputSchema: {\n type: \"object\",\n required: [\"cveId\"],\n properties: {\n cveId: { type: \"string\", description: \"CVE ID, e.g. CVE-2021-23337\" },\n cwd: { type: \"string\", description: \"Absolute path to the project root (default: process.cwd())\" },\n packageManager: { type: \"string\", enum: [\"npm\", \"pnpm\", \"yarn\"], description: \"Package manager override (auto-detected by default)\" },\n dryRun: { type: \"boolean\", description: \"If true, plan changes but write nothing (default: false)\" },\n preview: { type: \"boolean\", description: \"If true, enforce non-mutating preview mode\" },\n skipTests: { type: \"boolean\", description: \"Skip package-manager test command after applying fix (default: true)\" },\n llmProvider: { type: \"string\", enum: [\"openai\", \"anthropic\", \"local\"], description: \"LLM provider override\" },\n patchesDir: { type: \"string\", description: \"Directory to write .patch files (default: ./patches)\" },\n requestId: { type: \"string\", description: \"Request correlation ID\" },\n sessionId: { type: \"string\", description: \"Session correlation ID\" },\n parentRunId: { type: \"string\", description: \"Parent run correlation ID\" },\n idempotencyKey: { type: \"string\", description: \"Idempotency key for replay-safe execution\" },\n resume: { type: \"boolean\", description: \"Return cached result for matching idempotency key when available\" },\n actor: { type: \"string\", description: \"Actor identity for evidence provenance\" },\n source: { type: \"string\", enum: [\"cli\", \"sdk\", \"mcp\", \"openapi\", \"unknown\"], description: \"Source system for provenance\" },\n constraints: {\n type: \"object\",\n properties: {\n directDependenciesOnly: { type: \"boolean\" },\n preferVersionBump: { type: \"boolean\" },\n },\n },\n },\n },\n },\n {\n name: \"planRemediation\",\n description:\n \"Generate a non-mutating remediation preview for a single CVE in a Node.js project. Returns a RemediationReport with planned results.\",\n inputSchema: {\n type: \"object\",\n required: [\"cveId\"],\n properties: {\n cveId: { type: \"string\", description: \"CVE ID, e.g. CVE-2021-23337\" },\n cwd: { type: \"string\", description: \"Absolute path to the project root (default: process.cwd())\" },\n packageManager: { type: \"string\", enum: [\"npm\", \"pnpm\", \"yarn\"], description: \"Package manager override (auto-detected by default)\" },\n skipTests: { type: \"boolean\", description: \"Skip package-manager test command after applying fix (default: true)\" },\n llmProvider: { type: \"string\", enum: [\"openai\", \"anthropic\", \"local\"], description: \"LLM provider override\" },\n patchesDir: { type: \"string\", description: \"Directory to write .patch files (default: ./patches)\" },\n requestId: { type: \"string\", description: \"Request correlation ID\" },\n sessionId: { type: \"string\", description: \"Session correlation ID\" },\n parentRunId: { type: \"string\", description: \"Parent run correlation ID\" },\n idempotencyKey: { type: \"string\", description: \"Idempotency key for replay-safe execution\" },\n resume: { type: \"boolean\", description: \"Return cached result for matching idempotency key when available\" },\n actor: { type: \"string\", description: \"Actor identity for evidence provenance\" },\n source: { type: \"string\", enum: [\"cli\", \"sdk\", \"mcp\", \"openapi\", \"unknown\"], description: \"Source system for provenance\" },\n constraints: {\n type: \"object\",\n properties: {\n directDependenciesOnly: { type: \"boolean\" },\n preferVersionBump: { type: \"boolean\" },\n },\n },\n },\n },\n },\n {\n name: \"remediateFromScan\",\n description:\n \"Parse an npm/pnpm/yarn audit JSON or SARIF scan file, extract all CVE IDs, and remediate each one. Returns a ScanReport.\",\n inputSchema: {\n type: \"object\",\n required: [\"inputPath\"],\n properties: {\n inputPath: { type: \"string\", description: \"Absolute path to the scanner output file\" },\n cwd: { type: \"string\", description: \"Absolute path to the project root\" },\n packageManager: { type: \"string\", enum: [\"npm\", \"pnpm\", \"yarn\"], description: \"Package manager override (auto-detected by default)\" },\n format: { type: \"string\", enum: [\"auto\", \"npm-audit\", \"yarn-audit\", \"sarif\"], description: \"Scanner format (default: auto)\" },\n dryRun: { type: \"boolean\", description: \"If true, plan changes but write nothing\" },\n preview: { type: \"boolean\", description: \"If true, enforce non-mutating preview mode\" },\n writeEvidence: { type: \"boolean\", description: \"Write evidence JSON to .autoremediator/evidence/ (default: true)\" },\n requestId: { type: \"string\", description: \"Request correlation ID\" },\n sessionId: { type: \"string\", description: \"Session correlation ID\" },\n parentRunId: { type: \"string\", description: \"Parent run correlation ID\" },\n idempotencyKey: { type: \"string\", description: \"Idempotency key for replay-safe execution\" },\n resume: { type: \"boolean\", description: \"Return cached result for matching idempotency key when available\" },\n actor: { type: \"string\", description: \"Actor identity for evidence provenance\" },\n source: { type: \"string\", enum: [\"cli\", \"sdk\", \"mcp\", \"openapi\", \"unknown\"], description: \"Source system for provenance\" },\n constraints: {\n type: \"object\",\n properties: {\n directDependenciesOnly: { type: \"boolean\" },\n preferVersionBump: { type: \"boolean\" },\n },\n },\n },\n },\n },\n];\n\nexport async function handleToolCall(\n name: string,\n args: Record<string, unknown> = {},\n deps: McpApiDeps = defaultDeps\n): Promise<{ content: Array<{ type: \"text\"; text: string }>; isError?: boolean }> {\n const withMcpSource = (options: Record<string, unknown>): Record<string, unknown> => ({\n ...options,\n source: typeof options.source === \"string\" ? options.source : \"mcp\",\n });\n\n try {\n if (name === \"remediate\") {\n const { cveId, ...options } = args as { cveId: string; [key: string]: unknown };\n const report = await deps.remediateFn(cveId, withMcpSource(options) as Parameters<typeof remediate>[1]);\n return { content: [{ type: \"text\", text: JSON.stringify(report, null, 2) }] };\n }\n\n if (name === \"planRemediation\") {\n const { cveId, ...options } = args as { cveId: string; [key: string]: unknown };\n const report = await deps.planRemediationFn(cveId, withMcpSource(options) as Parameters<typeof planRemediation>[1]);\n return { content: [{ type: \"text\", text: JSON.stringify(report, null, 2) }] };\n }\n\n if (name === \"remediateFromScan\") {\n const { inputPath, ...options } = args as { inputPath: string; [key: string]: unknown };\n const report = await deps.remediateFromScanFn(inputPath, withMcpSource(options) as Parameters<typeof remediateFromScan>[1]);\n return { content: [{ type: \"text\", text: JSON.stringify(report, null, 2) }] };\n }\n\n return {\n content: [{ type: \"text\", text: `Unknown tool: ${name}` }],\n isError: true,\n };\n } catch (err) {\n return {\n content: [{ type: \"text\", text: err instanceof Error ? err.message : String(err) }],\n isError: true,\n };\n }\n}\n\nexport function createMcpServer(): Server {\n const server = createBaseServer();\n\n server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n return handleToolCall(name, (args ?? {}) as Record<string, unknown>);\n });\n\n return server;\n}\n\n// ---------------------------------------------------------------------------\n// Start\n// ---------------------------------------------------------------------------\n\nasync function startMcpServer(): Promise<void> {\n const transport = new StdioServerTransport();\n const server = createMcpServer();\n await server.connect(transport);\n}\n\nfunction isMainModule(): boolean {\n if (!process.argv[1]) return false;\n return fileURLToPath(import.meta.url) === process.argv[1];\n}\n\nif (isMainModule()) {\n await startMcpServer();\n}\n"],"mappings":";;;;;;;;AASA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAS9B,IAAM,cAA0B;AAAA,EAC9B,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,qBAAqB;AACvB;AAEA,SAAS,mBAA2B;AAClC,SAAO,IAAI;AAAA,IACT,EAAE,MAAM,kBAAkB,SAAS,QAAQ;AAAA,IAC3C,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,EAAE;AAAA,EAChC;AACF;AAMO,I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