@geeks.ltd/geeks-amp-mcp 1.0.0 → 1.0.1

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 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`, `get_auth_status`, `audit_tdd_amp` are forwarded to AMP with `Authorization: Bearer <token>`.
10
10
 
11
11
  ## Prerequisites
12
12
 
@@ -65,5 +65,7 @@ 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).
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).
69
71
  - **audit_tdd_amp** – Same as above plus auth status message for `/audit-tdd-amp` flows.
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,54 @@ 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, 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
+ });
51
116
  // Optional: audit-tdd-amp – get AMP item + test cases and report auth status (for /audit-tdd-amp in Cursor)
52
117
  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
118
  ampReference: z.string().describe("AMP item reference number, e.g. '12345' or 'AMP-12345'"),
package/dist/tools.d.ts CHANGED
@@ -10,6 +10,9 @@ export interface ToolDefinition {
10
10
  properties: Record<string, {
11
11
  type: string;
12
12
  description?: string;
13
+ items?: {
14
+ type: string;
15
+ };
13
16
  }>;
14
17
  required?: string[];
15
18
  };
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, 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,51 @@ 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
+ },
38
83
  {
39
84
  name: "get_auth_status",
40
85
  description: "Report whether the MCP server is authenticated to AMP. Returns 'Authenticated: YES' or 'Authenticated: NO' without opening the browser.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geeks.ltd/geeks-amp-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Local MCP server for AMP (OAuth 2.0 PKCE, token storage, proxy to AMP MCPServer.ashx)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,4 +45,4 @@
45
45
  "tsx": "^4.0.0",
46
46
  "typescript": "^5.0.0"
47
47
  }
48
- }
48
+ }