@mushi-mushi/mcp 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.
Files changed (3) hide show
  1. package/README.md +30 -2
  2. package/dist/index.js +76 -0
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -52,11 +52,28 @@ The server speaks stdio MCP transport by default — your client launches it as
52
52
 
53
53
  ## Tools
54
54
 
55
+ ### Read
56
+
55
57
  | Tool | What it does |
56
58
  |---|---|
57
59
  | `get_recent_reports` | Fetch the N most recent reports, with optional `status` / `category` / `severity` filters |
58
60
  | `get_report_detail` | Full payload for a single report — description, console logs, network requests, screenshot URL, classification result, fix history |
59
- | `search_reports` | Keyword + semantic search across reports for the configured project |
61
+ | `search_reports` | Semantic + keyword search (server-side pgvector; falls back to keyword match when embeddings aren't available) |
62
+ | `get_similar_bugs` | Embedding-nearest neighbours for a component, page, or description |
63
+ | `get_fix_context` | One-shot brief for a coding agent: report + repro + root-cause + ontology tags |
64
+ | `get_fix_timeline` | Ordered timeline of a fix attempt (dispatched → started → branch → commit → PR → CI → completed/failed) |
65
+ | `get_blast_radius` | Graph traversal showing other components a bug group touches |
66
+ | `get_knowledge_graph` | Traverse the knowledge graph from a seed component or page |
67
+
68
+ ### Write / agentic
69
+
70
+ | Tool | What it does |
71
+ |---|---|
72
+ | `submit_fix_result` | Record a fix outcome (branch, PR, files, lines) from an external agent |
73
+ | `dispatch_fix` | Kick off the agentic fix orchestrator for a report — returns a `fix_attempt` id |
74
+ | `trigger_judge` | Run the Sonnet-as-Judge over a batch of classified reports |
75
+ | `transition_status` | Move a report between workflow states (enforces the same rules as the UI) |
76
+ | `run_nl_query` | Natural-language → read-only SQL against your project data (60/hour rate-limited) |
60
77
 
61
78
  > Need a tool that isn't here? Open an issue at [github.com/kensaurus/mushi-mushi/issues](https://github.com/kensaurus/mushi-mushi/issues) and tag it `mcp`.
62
79
 
@@ -64,8 +81,19 @@ The server speaks stdio MCP transport by default — your client launches it as
64
81
 
65
82
  | URI | Returns |
66
83
  |---|---|
67
- | `project://settings` | Project config (name, autofix settings, plugins enabled, ontology) |
68
84
  | `project://stats` | Counts of new / classified / fixed reports + last 7-day trend |
85
+ | `project://settings` | Project config — autofix agent, plugins enabled, ontology, LLM budgets |
86
+ | `project://dashboard` | PDCA health snapshot — stage counts, bottleneck, recent activity (the same payload the admin console polls every 15 s) |
87
+
88
+ ## Prompts
89
+
90
+ Named templates the MCP client surfaces in its slash-menu. Each one bakes in the house voice ("lead with the fix, skip the preamble") so agents produce consistent outputs across editors.
91
+
92
+ | Prompt | When to use |
93
+ |---|---|
94
+ | `summarize_report_for_fix` | Before asking the agent to write the patch — produces a one-line root cause, smallest file set, repro steps, and blast-radius warnings |
95
+ | `explain_judge_result` | After the judge scores a fix — turns the raw scores into ship / iterate / dismiss guidance |
96
+ | `triage_next_steps` | "What should I focus on right now?" — five-item markdown list drawn from the dashboard + recent classified queue |
69
97
 
70
98
  ## Environment variables
71
99
 
package/dist/index.js CHANGED
@@ -170,6 +170,82 @@ server.tool(
170
170
  };
171
171
  }
172
172
  );
173
+ server.tool(
174
+ "trigger_judge",
175
+ "Run the Sonnet-as-Judge over a batch of classified reports. Returns batch id; results land in judge_results.",
176
+ {
177
+ limit: z.number().optional().describe("Max reports to judge in this batch (default 25, max 100)"),
178
+ projectId: z.string().optional().describe("Restrict to one project when the API key owns multiple")
179
+ },
180
+ async (args) => {
181
+ const data = await apiCall("/v1/admin/judge/run", {
182
+ method: "POST",
183
+ body: JSON.stringify({ limit: Math.min(args.limit ?? 25, 100), projectId: args.projectId })
184
+ });
185
+ return { content: [{ type: "text", text: JSON.stringify(data.data, null, 2) }] };
186
+ }
187
+ );
188
+ server.tool(
189
+ "dispatch_fix",
190
+ "Dispatch the agentic fix orchestrator for a classified report. Returns fix_attempt id; stream progress via get_fix_progress.",
191
+ {
192
+ reportId: z.string().describe("Report UUID to fix"),
193
+ agent: z.enum(["claude_code", "codex", "rest_worker", "mcp"]).optional().describe("Override the agent adapter")
194
+ },
195
+ async (args) => {
196
+ const data = await apiCall("/v1/admin/fixes/dispatch", {
197
+ method: "POST",
198
+ body: JSON.stringify({ reportId: args.reportId, agent: args.agent })
199
+ });
200
+ return { content: [{ type: "text", text: JSON.stringify(data.data, null, 2) }] };
201
+ }
202
+ );
203
+ server.tool(
204
+ "transition_status",
205
+ "Move a report between workflow states. Enforces the same transition rules as the admin UI.",
206
+ {
207
+ reportId: z.string().describe("Report UUID"),
208
+ status: z.enum(["pending", "classified", "grouped", "fixing", "fixed", "dismissed"]).describe("Target status"),
209
+ reason: z.string().optional().describe("Reason for the transition (audit trail)")
210
+ },
211
+ async (args) => {
212
+ const data = await apiCall(`/v1/admin/reports/${args.reportId}`, {
213
+ method: "PATCH",
214
+ body: JSON.stringify({ status: args.status, reason: args.reason })
215
+ });
216
+ return { content: [{ type: "text", text: JSON.stringify(data.data, null, 2) }] };
217
+ }
218
+ );
219
+ server.tool(
220
+ "run_nl_query",
221
+ "Natural-language question \u2192 SQL query run against your project data. Read-only, 60/hour rate-limited, no privileged schemas.",
222
+ {
223
+ question: z.string().describe('Question in plain English, e.g. "Which components had the most critical bugs this week?"')
224
+ },
225
+ async (args) => {
226
+ const data = await apiCall("/v1/admin/query", {
227
+ method: "POST",
228
+ body: JSON.stringify({ question: args.question })
229
+ });
230
+ return { content: [{ type: "text", text: JSON.stringify(data.data, null, 2) }] };
231
+ }
232
+ );
233
+ server.tool(
234
+ "get_knowledge_graph",
235
+ "Traverse the knowledge graph from a seed component or page. Returns nodes + edges within a depth budget.",
236
+ {
237
+ seed: z.string().describe("Starting node id or label"),
238
+ depth: z.number().optional().describe("Traversal depth (default 2, max 4)")
239
+ },
240
+ async (args) => {
241
+ const params = new URLSearchParams({
242
+ seed: args.seed,
243
+ depth: String(Math.min(args.depth ?? 2, 4))
244
+ });
245
+ const data = await apiCall(`/v1/admin/graph/traverse?${params}`);
246
+ return { content: [{ type: "text", text: JSON.stringify(data.data, null, 2) }] };
247
+ }
248
+ );
173
249
  server.resource(
174
250
  "project_stats",
175
251
  "project://stats",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mushi-mushi/mcp",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "license": "MIT",
5
5
  "description": "MCP server exposing Mushi Mushi reports to coding agents",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@modelcontextprotocol/sdk": "^1.12.1",
25
25
  "zod": "^4.3.6",
26
- "@mushi-mushi/core": "^0.2.1"
26
+ "@mushi-mushi/core": "^0.3.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^22.0.0",