@mushi-mushi/mcp 0.12.0 → 0.13.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.
Files changed (2) hide show
  1. package/dist/index.js +83 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -183,14 +183,35 @@ var TOOL_CATALOG = [
183
183
  {
184
184
  name: "transition_status",
185
185
  title: "Move report between states",
186
- description: "Move a report between workflow states (new \u2192 classified \u2192 grouped \u2192 fixing \u2192 fixed \u2192 dismissed). Enforces the same transition rules as the admin UI.",
186
+ description: "Move a report between workflow states (new \u2192 classified \u2192 grouped \u2192 fixing \u2192 fixed \u2192 verified \u2192 reopened \u2192 dismissed). Enforces the same transition rules as the admin UI.",
187
187
  scope: "mcp:write",
188
- // Transitioning to `dismissed` is destructive by intent — it removes the
189
- // report from triage queues. Flag the whole tool as destructive so the
190
- // client prompts the user on every call.
191
188
  hints: { readOnly: false, destructive: true, idempotent: true, openWorld: true },
192
189
  useCase: "Dismiss this duplicate / mark it fixed."
193
190
  },
191
+ {
192
+ name: "merge_fix",
193
+ title: "Merge fix PR",
194
+ description: "Squash-merge a fix attempt PR and mark the linked report fixed.",
195
+ scope: "mcp:write",
196
+ hints: { readOnly: false, destructive: true, idempotent: true, openWorld: true },
197
+ useCase: "Merge the draft PR and notify the reporter."
198
+ },
199
+ {
200
+ name: "refresh_ci",
201
+ title: "Refresh fix CI status",
202
+ description: "Pull the latest GitHub check-run status for a fix attempt.",
203
+ scope: "mcp:read",
204
+ hints: { readOnly: true, idempotent: true, openWorld: true },
205
+ useCase: "Check whether CI is green before merging."
206
+ },
207
+ {
208
+ name: "reopen_report",
209
+ title: "Reopen report (operator)",
210
+ description: "Move a report to reopened for regression triage.",
211
+ scope: "mcp:write",
212
+ hints: { readOnly: false, destructive: false, idempotent: true, openWorld: true },
213
+ useCase: "Reopen a regression the reporter flagged as not fixed."
214
+ },
194
215
  // --- Rewards (P3) -------------------------------------------------------
195
216
  {
196
217
  name: "list_top_contributors",
@@ -836,12 +857,15 @@ function createMushiServer(config) {
836
857
  prUrl: z.string().optional().describe("GitHub PR URL"),
837
858
  filesChanged: z.array(z.string()).describe("Files modified"),
838
859
  linesChanged: z.number().describe("Total lines changed"),
839
- summary: z.string().describe("Fix summary")
860
+ summary: z.string().describe("Fix summary"),
861
+ idempotencyKey: z.string().uuid().optional().describe("Optional UUID \u2014 resend the same key to safely retry without creating duplicate fix rows")
840
862
  }
841
863
  },
842
864
  async (args) => {
865
+ const idemKey = args.idempotencyKey ?? crypto.randomUUID();
843
866
  const created = await apiCall("/v1/admin/fixes", {
844
867
  method: "POST",
868
+ headers: { "Idempotency-Key": idemKey },
845
869
  body: JSON.stringify({ reportId: args.reportId, agent: "mcp" })
846
870
  });
847
871
  await apiCall(`/v1/admin/fixes/${created.fixId}`, {
@@ -947,6 +971,59 @@ function createMushiServer(config) {
947
971
  return jsonText(data);
948
972
  }
949
973
  );
974
+ server.registerTool(
975
+ "merge_fix",
976
+ {
977
+ title: "Merge fix PR",
978
+ description: "Squash-merge a fix attempt PR and mark the linked report fixed.",
979
+ annotations: annotationsFor("merge_fix"),
980
+ inputSchema: {
981
+ fixId: z.string().describe("Fix attempt UUID"),
982
+ mergeMethod: z.enum(["squash", "merge", "rebase"]).optional().describe("GitHub merge method")
983
+ }
984
+ },
985
+ async (args) => {
986
+ const data = await apiCall(`/v1/admin/fixes/${args.fixId}/merge`, {
987
+ method: "POST",
988
+ body: JSON.stringify({ mergeMethod: args.mergeMethod ?? "squash" })
989
+ });
990
+ return jsonText(data);
991
+ }
992
+ );
993
+ server.registerTool(
994
+ "refresh_ci",
995
+ {
996
+ title: "Refresh fix CI status",
997
+ description: "Pull the latest GitHub check-run status for a fix attempt.",
998
+ annotations: annotationsFor("refresh_ci"),
999
+ inputSchema: {
1000
+ fixId: z.string().describe("Fix attempt UUID")
1001
+ }
1002
+ },
1003
+ async (args) => {
1004
+ const data = await apiCall(`/v1/admin/fixes/${args.fixId}/refresh-ci`, { method: "POST" });
1005
+ return jsonText(data);
1006
+ }
1007
+ );
1008
+ server.registerTool(
1009
+ "reopen_report",
1010
+ {
1011
+ title: "Reopen report (operator)",
1012
+ description: "Operator alias to move a report back to new for regression triage.",
1013
+ annotations: annotationsFor("reopen_report"),
1014
+ inputSchema: {
1015
+ reportId: z.string().describe("Report UUID"),
1016
+ note: z.string().optional().describe("Triage note")
1017
+ }
1018
+ },
1019
+ async (args) => {
1020
+ const data = await apiCall(`/v1/sync/reports/${args.reportId}`, {
1021
+ method: "PATCH",
1022
+ body: JSON.stringify({ status: "reopened", note: args.note })
1023
+ });
1024
+ return jsonText(data);
1025
+ }
1026
+ );
950
1027
  server.registerTool(
951
1028
  "transition_status",
952
1029
  {
@@ -955,7 +1032,7 @@ function createMushiServer(config) {
955
1032
  annotations: annotationsFor("transition_status"),
956
1033
  inputSchema: {
957
1034
  reportId: z.string().describe("Report UUID"),
958
- status: z.enum(["pending", "classified", "grouped", "fixing", "fixed", "dismissed"]).describe("Target status"),
1035
+ status: z.enum(["pending", "classified", "grouped", "fixing", "fixed", "resolved", "verified", "reopened", "dismissed"]).describe("Target status"),
959
1036
  reason: z.string().optional().describe("Reason for the transition (audit trail)")
960
1037
  }
961
1038
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/mcp",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "license": "MIT",
5
5
  "description": "MCP server exposing Mushi Mushi reports to coding agents",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@modelcontextprotocol/sdk": "^1.29.0",
28
- "@mushi-mushi/core": "^1.9.0",
28
+ "@mushi-mushi/core": "^1.11.0",
29
29
  "zod": "^4.4.2"
30
30
  },
31
31
  "devDependencies": {