@securityreviewai/security-review-mcp 0.2.16 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/workflowTools.js +34 -6
- package/package.json +1 -1
|
@@ -27,6 +27,32 @@ const aiIdeGuardrailAppliedSchema = z.object({
|
|
|
27
27
|
satisfied: z.boolean(),
|
|
28
28
|
notes: z.string().optional(),
|
|
29
29
|
});
|
|
30
|
+
const aiIdeOwaspTop102025MappingSchema = z.object({
|
|
31
|
+
category_id: z.string().describe("OWASP Top 10 category ID, e.g. A01"),
|
|
32
|
+
category_name: z.string().describe("OWASP Top 10 category name, e.g. Broken Access Control"),
|
|
33
|
+
});
|
|
34
|
+
function normalizeAiIdeCurrentUser(result) {
|
|
35
|
+
if (!result || typeof result !== "object") {
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
const record = result;
|
|
39
|
+
const currentUser = record.current_user;
|
|
40
|
+
if (!currentUser || typeof currentUser !== "object") {
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
const currentUserRecord = currentUser;
|
|
44
|
+
const { name, email } = currentUserRecord;
|
|
45
|
+
if (typeof name !== "string" || typeof email !== "string") {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...record,
|
|
50
|
+
current_user: {
|
|
51
|
+
name,
|
|
52
|
+
email,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
30
56
|
export function registerWorkflowTools(server) {
|
|
31
57
|
server.registerTool("list_ai_ide_workflows", {
|
|
32
58
|
description: "List AI IDE workflows for a project with pagination. Returns workflow records and pagination metadata.",
|
|
@@ -35,14 +61,14 @@ export function registerWorkflowTools(server) {
|
|
|
35
61
|
page: z.number().int().min(1).default(1),
|
|
36
62
|
page_size: z.number().int().min(1).max(100).default(10),
|
|
37
63
|
},
|
|
38
|
-
}, async ({ project_id, page, page_size }) => runTool(async () => getApiClient().listAiIdeWorkflows(project_id, page, page_size)));
|
|
64
|
+
}, async ({ project_id, page, page_size }) => runTool(async () => normalizeAiIdeCurrentUser(await getApiClient().listAiIdeWorkflows(project_id, page, page_size))));
|
|
39
65
|
server.registerTool("get_ai_ide_workflow", {
|
|
40
66
|
description: "Get a specific AI IDE workflow by workflow ID within a project. Returns workflow metadata and linked AI IDE data source.",
|
|
41
67
|
inputSchema: {
|
|
42
68
|
project_id: z.number().int(),
|
|
43
69
|
workflow_id: z.number().int(),
|
|
44
70
|
},
|
|
45
|
-
}, async ({ project_id, workflow_id }) => runTool(async () => getApiClient().getAiIdeWorkflow(project_id, workflow_id)));
|
|
71
|
+
}, async ({ project_id, workflow_id }) => runTool(async () => normalizeAiIdeCurrentUser(await getApiClient().getAiIdeWorkflow(project_id, workflow_id))));
|
|
46
72
|
server.registerTool("create_ai_ide_workflow", {
|
|
47
73
|
description: "Create an AI IDE workflow for a project. This creates a workflow and its AI IDE data source in SRAI.",
|
|
48
74
|
inputSchema: {
|
|
@@ -50,9 +76,9 @@ export function registerWorkflowTools(server) {
|
|
|
50
76
|
name: z.string(),
|
|
51
77
|
description: z.string().optional(),
|
|
52
78
|
},
|
|
53
|
-
}, async ({ project_id, name, description }) => runTool(async () => getApiClient().createAiIdeWorkflow(project_id, name, description)));
|
|
79
|
+
}, async ({ project_id, name, description }) => runTool(async () => normalizeAiIdeCurrentUser(await getApiClient().createAiIdeWorkflow(project_id, name, description))));
|
|
54
80
|
server.registerTool("create_ai_ide_event", {
|
|
55
|
-
description: "Create an AI IDE event under an existing AI IDE workflow. Include summary, developer details, mitigated threats (each threat must include severity: critical/high/medium/low), best practices, secure snippets, applied guardrails, and optional event metadata.",
|
|
81
|
+
description: "Create an AI IDE event under an existing AI IDE workflow. Include summary, developer details, mitigated threats (each threat must include severity: critical/high/medium/low), best practices, secure snippets, applied guardrails, OWASP Top 10 2025 mappings, and optional event metadata.",
|
|
56
82
|
inputSchema: {
|
|
57
83
|
project_id: z.number().int(),
|
|
58
84
|
workflow_id: z.number().int(),
|
|
@@ -65,9 +91,10 @@ export function registerWorkflowTools(server) {
|
|
|
65
91
|
best_practices_achieved: z.array(aiIdeBestPracticeSchema),
|
|
66
92
|
secure_code_snippets: z.array(aiIdeSecureCodeSnippetSchema).default([]),
|
|
67
93
|
guardrails_applied: z.array(aiIdeGuardrailAppliedSchema).default([]),
|
|
94
|
+
owasp_top_10_2025_mappings: z.array(aiIdeOwaspTop102025MappingSchema).default([]),
|
|
68
95
|
event_metadata: z.record(z.string(), z.unknown()).optional(),
|
|
69
96
|
},
|
|
70
|
-
}, async ({ project_id, workflow_id, external_id, title, summary, developer_name, developer_email, threats_mitigated, best_practices_achieved, secure_code_snippets, guardrails_applied, event_metadata, }) => runTool(async () => getApiClient().createAiIdeEvent(project_id, workflow_id, {
|
|
97
|
+
}, async ({ project_id, workflow_id, external_id, title, summary, developer_name, developer_email, threats_mitigated, best_practices_achieved, secure_code_snippets, guardrails_applied, owasp_top_10_2025_mappings, event_metadata, }) => runTool(async () => normalizeAiIdeCurrentUser(await getApiClient().createAiIdeEvent(project_id, workflow_id, {
|
|
71
98
|
external_id,
|
|
72
99
|
title,
|
|
73
100
|
summary,
|
|
@@ -77,8 +104,9 @@ export function registerWorkflowTools(server) {
|
|
|
77
104
|
best_practices_achieved,
|
|
78
105
|
secure_code_snippets,
|
|
79
106
|
guardrails_applied,
|
|
107
|
+
owasp_top_10_2025_mappings,
|
|
80
108
|
event_metadata,
|
|
81
|
-
})));
|
|
109
|
+
}))));
|
|
82
110
|
server.registerTool("start_workflow", {
|
|
83
111
|
description: "Start the security review workflow for a review. This triggers the SRAI AI agents to begin generating security objectives, components, data dictionaries, threat scenarios, and countermeasures. The workflow runs asynchronously. Use get_workflow_status to monitor progress.",
|
|
84
112
|
inputSchema: {
|