@geeks.ltd/geeks-amp-mcp 1.0.0 → 1.0.3
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 +10 -2
- package/dist/index.js +112 -1
- package/dist/tools.d.ts +3 -0
- package/dist/tools.js +80 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Local MCP server for Cursor that authenticates to your AMP backend via OAuth 2.0
|
|
|
6
6
|
|
|
7
7
|
1. **First use** – When you call an AMP tool, the server opens your browser to AMP’s login. After you sign in, AMP redirects to `http://127.0.0.1:5005/callback`. The server exchanges the code for access and refresh tokens and stores them (e.g. in `~/.amp-mcp/credentials.json`).
|
|
8
8
|
2. **Later uses** – The server reuses the stored access token. When it expires, it uses the refresh token; if refresh fails, it runs the browser flow again.
|
|
9
|
-
3. **Tools** – `get_projects`, `get_amp_item_with_test_cases`, `get_auth_status`, `audit_tdd_amp` are forwarded to AMP with `Authorization: Bearer <token>`.
|
|
9
|
+
3. **Tools** – `get_projects`, `get_amp_item_with_test_cases`, `submit_amp_progress_update`, `add_amp_test_case_references`, `submit_pen_test_review`, `get_auth_status`, `audit_tdd_amp`, `audit_pen_test_amp` are forwarded to AMP with `Authorization: Bearer <token>`.
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
@@ -65,5 +65,13 @@ In `.cursor/mcp.json` (project or global), use the **local server** via npx (no
|
|
|
65
65
|
|
|
66
66
|
- **get_auth_status** – Returns `Authenticated: YES` or `Authenticated: NO` (no browser).
|
|
67
67
|
- **get_projects** – List AMP projects (optional `searchTerm`, `limit`).
|
|
68
|
-
- **get_amp_item_with_test_cases** – AMP item + test case refs by `ampReference` (e.g. `12345` or `AMP-12345`).
|
|
68
|
+
- **get_amp_item_with_test_cases** – AMP item + test case refs by `ampReference` (e.g. `12345` or `AMP-12345`). Response JSON includes `ampItem.teamPercentageDone` (team board % done) alongside `progress` (workflow stage), and pen test review fields: `hasPenTestReview`, `penTestReviewCompleted`, `penTestReviewCompletedBy`, `penTestReviewCommentId`.
|
|
69
|
+
- **submit_amp_progress_update** – Team board: optional `teamPercentageDone` (0, 10, …, 100) and/or `message`; at least one required. Omits `message` when only updating % so AMP can default the comment to `"{n}% completed"`.
|
|
70
|
+
- **add_amp_test_case_references** – `ampReference`, required `testCaseReferences` (array of strings), optional `message` after refs; same as AMP “Update test cases” (`[#+REF#]` markers).
|
|
71
|
+
- **submit_pen_test_review** – Record a completed Cursor AI pen test review: required `ampReference` and `scope` (branch, commits, files, or PR reviewed); optional `findings` (one per line, or `"None"`), `falsePositives` (`"N/A"` if none), `knownRisks` (`"N/A"` if none), `summary`. Posts a team comment with `[#PENTEST:COMPLETE#]` and sets review metadata on the work item.
|
|
69
72
|
- **audit_tdd_amp** – Same as above plus auth status message for `/audit-tdd-amp` flows.
|
|
73
|
+
- **audit_pen_test_amp** – AMP item + pen test review status + test cases, plus auth status message for `/run-pen-test` flows.
|
|
74
|
+
|
|
75
|
+
## Cursor command: `/run-pen-test`
|
|
76
|
+
|
|
77
|
+
Copy `.cursor/commands/run-pen-test.md` into your project (or use it from a repo that includes it). The command loads AMP context via MCP, runs a security review, and after human confirmation calls `submit_pen_test_review` to persist the outcome on AMP.
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,29 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { ensureAccessToken, getAuthStatus } from "./auth.js";
|
|
10
10
|
import { callAmpTool } from "./tools.js";
|
|
11
|
+
const submitAmpProgressUpdateSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
ampReference: z.string().min(1).describe("e.g. '12345' or 'AMP-12345'"),
|
|
14
|
+
teamPercentageDone: z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.min(0)
|
|
18
|
+
.max(100)
|
|
19
|
+
.refine((n) => n % 10 === 0, "Must be a multiple of 10 (0, 10, …, 100)")
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Team % done (same as AMP team board dropdown)"),
|
|
22
|
+
message: z.string().optional().describe("Team comment text"),
|
|
23
|
+
})
|
|
24
|
+
.superRefine((val, ctx) => {
|
|
25
|
+
const hasPct = val.teamPercentageDone !== undefined;
|
|
26
|
+
const hasMsg = val.message !== undefined && val.message.trim().length > 0;
|
|
27
|
+
if (!hasPct && !hasMsg) {
|
|
28
|
+
ctx.addIssue({
|
|
29
|
+
code: z.ZodIssueCode.custom,
|
|
30
|
+
message: "Provide teamPercentageDone and/or a non-empty message.",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
11
34
|
async function main() {
|
|
12
35
|
const server = new McpServer({
|
|
13
36
|
name: "geeks-amp-mcp",
|
|
@@ -42,12 +65,79 @@ async function main() {
|
|
|
42
65
|
return callAmpTool("get_projects", args, token);
|
|
43
66
|
});
|
|
44
67
|
// get_amp_item_with_test_cases – ensure token, then call AMP
|
|
45
|
-
server.tool("get_amp_item_with_test_cases", "Get AMP (work item) details and all its test case references for a given AMP item. Use the reference number (e.g. 12345) or AMP-12345 format. Returns subject, note, status, progress, project, and a list of test case references (e.g. +AVFD) with the comment they appear in.", {
|
|
68
|
+
server.tool("get_amp_item_with_test_cases", "Get AMP (work item) details and all its test case references for a given AMP item. Use the reference number (e.g. 12345) or AMP-12345 format. Returns subject, note, status, progress (workflow stage), teamPercentageDone (team board % done, 0–100 in steps of 10), project, pen test review status (hasPenTestReview, penTestReviewCompleted, penTestReviewCompletedBy, penTestReviewCommentId), and a list of test case references (e.g. +AVFD) with the comment they appear in.", {
|
|
46
69
|
ampReference: z.string().describe("AMP item reference number, e.g. '12345' or 'AMP-12345'"),
|
|
47
70
|
}, async ({ ampReference }) => {
|
|
48
71
|
const token = await ensureAccessToken();
|
|
49
72
|
return callAmpTool("get_amp_item_with_test_cases", { ampReference }, token);
|
|
50
73
|
});
|
|
74
|
+
// submit_amp_progress_update – team board % done and/or team comment (AMP MCPServer parity)
|
|
75
|
+
server.tool("submit_amp_progress_update", "Update the AMP team board: set team % done (0, 10, …, 100) and/or append a team-column comment. Not the same as workflow progress. At least one of teamPercentageDone or a non-empty message is required.", {
|
|
76
|
+
ampReference: z.string().min(1).describe("e.g. '12345' or 'AMP-12345'"),
|
|
77
|
+
teamPercentageDone: z
|
|
78
|
+
.number()
|
|
79
|
+
.int()
|
|
80
|
+
.min(0)
|
|
81
|
+
.max(100)
|
|
82
|
+
.optional()
|
|
83
|
+
.describe("Team % done (multiple of 10); omit if only posting a comment"),
|
|
84
|
+
message: z.string().optional().describe("Team comment text"),
|
|
85
|
+
}, async (raw) => {
|
|
86
|
+
const parsed = submitAmpProgressUpdateSchema.parse(raw);
|
|
87
|
+
const token = await ensureAccessToken();
|
|
88
|
+
const args = { ampReference: parsed.ampReference };
|
|
89
|
+
if (parsed.teamPercentageDone !== undefined)
|
|
90
|
+
args.teamPercentageDone = parsed.teamPercentageDone;
|
|
91
|
+
if (parsed.message !== undefined && parsed.message.trim() !== "")
|
|
92
|
+
args.message = parsed.message.trim();
|
|
93
|
+
return callAmpTool("submit_amp_progress_update", args, token);
|
|
94
|
+
});
|
|
95
|
+
// add_amp_test_case_references – team comment with [#+REF#] markers (AMP “Update test cases”)
|
|
96
|
+
server.tool("add_amp_test_case_references", "Add test case refs to an AMP item via a team comment; uses [#+REF#] markers (same as AMP \"Update test cases\").", {
|
|
97
|
+
ampReference: z.string().min(1).describe("e.g. '12345' or 'AMP-12345'"),
|
|
98
|
+
testCaseReferences: z
|
|
99
|
+
.array(z.string().min(1))
|
|
100
|
+
.min(1)
|
|
101
|
+
.describe('Test case refs, e.g. ["+AVFD", "LKJH"] or bare ids; server normalizes'),
|
|
102
|
+
message: z
|
|
103
|
+
.string()
|
|
104
|
+
.optional()
|
|
105
|
+
.describe("Text after the refs (like the form's Comment field)"),
|
|
106
|
+
}, async ({ ampReference, testCaseReferences, message, }) => {
|
|
107
|
+
const token = await ensureAccessToken();
|
|
108
|
+
const args = {
|
|
109
|
+
ampReference,
|
|
110
|
+
testCaseReferences,
|
|
111
|
+
};
|
|
112
|
+
if (message !== undefined && message.trim() !== "")
|
|
113
|
+
args.message = message.trim();
|
|
114
|
+
return callAmpTool("add_amp_test_case_references", args, token);
|
|
115
|
+
});
|
|
116
|
+
// submit_pen_test_review – record completed Cursor AI pen test review on AMP
|
|
117
|
+
server.tool("submit_pen_test_review", "Record a completed Cursor AI pen test review on an AMP work item. Posts a structured team comment and sets review metadata. Use after run-pen-test and human confirmation.", {
|
|
118
|
+
ampReference: z
|
|
119
|
+
.string()
|
|
120
|
+
.describe("AMP reference, e.g. '12345' or 'AMP-12345'"),
|
|
121
|
+
scope: z
|
|
122
|
+
.string()
|
|
123
|
+
.describe("Branch, commits, files, or PR reviewed"),
|
|
124
|
+
findings: z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Findings, one per line; 'None' if none"),
|
|
128
|
+
falsePositives: z
|
|
129
|
+
.string()
|
|
130
|
+
.optional()
|
|
131
|
+
.describe("False positives explained; 'N/A' if none"),
|
|
132
|
+
knownRisks: z
|
|
133
|
+
.string()
|
|
134
|
+
.optional()
|
|
135
|
+
.describe("Accepted known risks; 'N/A' if none"),
|
|
136
|
+
summary: z.string().optional().describe("Short overall outcome"),
|
|
137
|
+
}, async (args) => {
|
|
138
|
+
const token = await ensureAccessToken();
|
|
139
|
+
return callAmpTool("submit_pen_test_review", args, token);
|
|
140
|
+
});
|
|
51
141
|
// Optional: audit-tdd-amp – get AMP item + test cases and report auth status (for /audit-tdd-amp in Cursor)
|
|
52
142
|
server.tool("audit_tdd_amp", "Get AMP item and its test case references, and report auth status. Use for /audit-tdd-amp flows in Cursor.", {
|
|
53
143
|
ampReference: z.string().describe("AMP item reference number, e.g. '12345' or 'AMP-12345'"),
|
|
@@ -67,6 +157,27 @@ async function main() {
|
|
|
67
157
|
],
|
|
68
158
|
};
|
|
69
159
|
});
|
|
160
|
+
// Optional: audit-pen-test-amp – get AMP item + pen test review status and report auth (for /run-pen-test in Cursor)
|
|
161
|
+
server.tool("audit_pen_test_amp", "Get AMP item, pen test review status, and test case references, plus auth status. Use for /run-pen-test flows in Cursor.", {
|
|
162
|
+
ampReference: z
|
|
163
|
+
.string()
|
|
164
|
+
.describe("AMP item reference number, e.g. '12345' or 'AMP-12345'"),
|
|
165
|
+
}, async ({ ampReference }) => {
|
|
166
|
+
const token = await ensureAccessToken();
|
|
167
|
+
const result = await callAmpTool("get_amp_item_with_test_cases", { ampReference }, token);
|
|
168
|
+
const status = getAuthStatus();
|
|
169
|
+
return {
|
|
170
|
+
content: [
|
|
171
|
+
{
|
|
172
|
+
type: "text",
|
|
173
|
+
text: JSON.stringify({
|
|
174
|
+
message: status.message,
|
|
175
|
+
ampItemAndPenTestReview: result.content[0]?.text,
|
|
176
|
+
}),
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
});
|
|
70
181
|
const transport = new StdioServerTransport();
|
|
71
182
|
await server.connect(transport);
|
|
72
183
|
}
|
package/dist/tools.d.ts
CHANGED
package/dist/tools.js
CHANGED
|
@@ -23,7 +23,7 @@ export const TOOL_DEFINITIONS = [
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
name: "get_amp_item_with_test_cases",
|
|
26
|
-
description: "Get AMP (work item) details and all its test case references for a given AMP item. Use the reference number (e.g. 12345) or AMP-12345 format. Returns subject, note, status, progress, project, and a list of test case references (e.g. +AVFD) with the comment they appear in.",
|
|
26
|
+
description: "Get AMP (work item) details and all its test case references for a given AMP item. Use the reference number (e.g. 12345) or AMP-12345 format. Returns subject, note, status, progress (workflow stage), teamPercentageDone (team board % done), project, pen test review status (hasPenTestReview, penTestReviewCompleted, penTestReviewCompletedBy, penTestReviewCommentId), and a list of test case references (e.g. +AVFD) with the comment they appear in.",
|
|
27
27
|
inputSchema: {
|
|
28
28
|
type: "object",
|
|
29
29
|
properties: {
|
|
@@ -35,6 +35,85 @@ export const TOOL_DEFINITIONS = [
|
|
|
35
35
|
required: ["ampReference"],
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
name: "submit_amp_progress_update",
|
|
40
|
+
description: "Set team board % done (0–100, multiple of 10) and/or append a team-column comment. At least one of teamPercentageDone or non-empty message required. If only teamPercentageDone is sent, AMP sets comment text to \"{n}% completed\".",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
ampReference: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "e.g. '12345' or 'AMP-12345'",
|
|
47
|
+
},
|
|
48
|
+
teamPercentageDone: {
|
|
49
|
+
type: "number",
|
|
50
|
+
description: "Team % done (same as AMP team board dropdown); integer 0–100, multiple of 10",
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Team comment text",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ["ampReference"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "add_amp_test_case_references",
|
|
62
|
+
description: "Add test case refs to an AMP item via a team comment; uses [#+REF#] markers (same as AMP \"Update test cases\").",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
ampReference: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "e.g. '12345' or 'AMP-12345'",
|
|
69
|
+
},
|
|
70
|
+
testCaseReferences: {
|
|
71
|
+
type: "array",
|
|
72
|
+
items: { type: "string" },
|
|
73
|
+
description: 'Refs such as "+AVFD", "LKJH", or bare ids; AMP normalizes',
|
|
74
|
+
},
|
|
75
|
+
message: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Text after the refs (like the form's Comment field)",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
required: ["ampReference", "testCaseReferences"],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "submit_pen_test_review",
|
|
85
|
+
description: "Record a completed Cursor AI pen test review on an AMP work item. Posts a structured team comment and sets review metadata. Use after run-pen-test and human confirmation.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
ampReference: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "AMP reference, e.g. '12345' or 'AMP-12345'",
|
|
92
|
+
},
|
|
93
|
+
scope: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "Branch, commits, files, or PR reviewed",
|
|
96
|
+
},
|
|
97
|
+
findings: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Findings, one per line; 'None' if none",
|
|
100
|
+
},
|
|
101
|
+
falsePositives: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "False positives explained; 'N/A' if none",
|
|
104
|
+
},
|
|
105
|
+
knownRisks: {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "Accepted known risks; 'N/A' if none",
|
|
108
|
+
},
|
|
109
|
+
summary: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Short overall outcome",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
required: ["ampReference", "scope"],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
38
117
|
{
|
|
39
118
|
name: "get_auth_status",
|
|
40
119
|
description: "Report whether the MCP server is authenticated to AMP. Returns 'Authenticated: YES' or 'Authenticated: NO' without opening the browser.",
|