@mushi-mushi/mcp 0.14.1 → 0.15.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.
package/README.md CHANGED
@@ -18,6 +18,20 @@ npx mushi-mushi setup --ide cursor
18
18
 
19
19
  That command reads `~/.mushirc`, writes `.cursor/mcp.json` with the `mushi` server block, and prints "Done — restart Cursor and ask: `list mushi tools`". No copy-pasting environment variables.
20
20
 
21
+ ### Codebase Understand tools (indexed repos)
22
+
23
+ When codebase indexing is enabled on a project, these MCP tools ground on `project_codebase_files` (+ wiki chunks when configured):
24
+
25
+ | Tool | Scope | Purpose |
26
+ |------|-------|---------|
27
+ | `ask_codebase` | write | Plain-English Q&A with file:line citations |
28
+ | `get_file_summary` | read | Lazy plain-English file/symbol summary |
29
+ | `get_codebase_tour` | read | Dependency-ordered onboarding tour |
30
+ | `search_codebase` | read | Semantic (or scoped) embedding search |
31
+ | `get_codebase_domains` | read | Business domain / flow map |
32
+ | `analyze_codebase_impact` | read | Diff impact (paths, last push, compare, fix PR) |
33
+ | `analyze_wiki_knowledge` | read | Wiki/docs knowledge graph |
34
+
21
35
  > **What this is, and what it isn't**
22
36
  >
23
37
  > - **This package** (`@mushi-mushi/mcp`) is the MCP **server** — runs locally next to your editor, talks to the Mushi API, and presents bug reports as MCP tools/resources to your coding agent. Always install it by its scoped name (`npx -y @mushi-mushi/mcp@latest`) — the bare `mushi-mcp` name was never published to npm.
@@ -26,7 +40,19 @@ That command reads `~/.mushirc`, writes `.cursor/mcp.json` with the `mushi` serv
26
40
 
27
41
  ## Quick start
28
42
 
29
- ### 0. One-liner (recommended)
43
+ ### 0. One-click (fastest) — "Add to Cursor" deeplink
44
+
45
+ The Mushi admin console (**Admin → MCP → Setup tab**) generates a one-click deeplink that opens Cursor's "Install MCP server?" dialog with your project ID and a freshly-minted `mcp:write` key already embedded:
46
+
47
+ ```
48
+ cursor://anysphere.cursor-deeplink/mcp/install?name=mushi-<project>&config=<base64>
49
+ ```
50
+
51
+ Click **"⚡ Add to Cursor"** (or **"Add to VS Code"**) — Cursor prompts you to confirm, then writes the server block into your global `mcp.json` automatically. No copy-pasting.
52
+
53
+ > **Security note:** The deeplink mints a dedicated `mcp:write` key (or `mcp:read` for read-only), separate from your app's SDK key. Your SDK key (the `report:write`-scoped key your app sends bug reports with) should never carry `mcp:write` — it would expose admin-level triage and fix dispatch to anyone who extracted it from your browser bundle. The deeplink mint enforces this separation automatically. See [API key scopes](#api-key-scopes) below.
54
+
55
+ ### 1. One-liner CLI (recommended for first-time setup)
30
56
 
31
57
  ```bash
32
58
  # First: make sure you've logged in
@@ -38,7 +64,7 @@ npx mushi-mushi setup --ide claude # Claude Code / Claude Desktop
38
64
  npx mushi-mushi setup --ide cursor --with-rules # also write .cursorrules
39
65
  ```
40
66
 
41
- ### 1. With Claude Desktop (manual)
67
+ ### 2. With Claude Desktop (manual)
42
68
 
43
69
  Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
44
70
 
@@ -67,7 +93,7 @@ Restart Claude Desktop. You should see a hammer icon in the chat input — click
67
93
  >
68
94
  > Or visit **Admin → MCP** in the console for a one-click pre-filled config snippet.
69
95
 
70
- ### 2. With Cursor
96
+ ### 3. With Cursor (manual)
71
97
 
72
98
  In Cursor settings, open **MCP** → **Add new MCP server** and paste:
73
99
 
@@ -85,7 +111,7 @@ Then set the same three environment variables:
85
111
 
86
112
  Without `MUSHI_PROJECT_ID` the server starts but scoped tools return an empty result with a message pointing you here.
87
113
 
88
- ### 3. From the command line
114
+ ### 4. From the command line
89
115
 
90
116
  ```bash
91
117
  MUSHI_API_KEY=mushi_xxxxxxxxxxxxxxxxxxxx \
@@ -95,25 +121,57 @@ npx -y @mushi-mushi/mcp@latest
95
121
 
96
122
  The server speaks stdio MCP transport by default — your client launches it as a subprocess.
97
123
 
98
- ### 4. Hosted Streamable HTTP (no subprocess) — 2026-05-09 release
124
+ ### 5. Hosted Streamable HTTP (no subprocess) — 2026-05-09 release
99
125
 
100
126
  The Mushi backend now exposes the same tool catalog over the **Streamable HTTP** transport from the MCP 2025-03-26 spec at `/functions/v1/mcp`. Use this when you want to skip the local subprocess — typical for OpenAI Agents SDK, ChatGPT Agent, hosted CrewAI, or any orchestrator that talks remote MCP:
101
127
 
102
128
  ```jsonc
103
- // .cursor/mcp.json — example
129
+ // .cursor/mcp.json — example (hosted HTTP)
104
130
  {
105
131
  "mcpServers": {
106
132
  "mushi-mushi-hosted": {
133
+ "type": "http",
107
134
  "url": "https://<your-ref>.supabase.co/functions/v1/mcp",
108
135
  "headers": {
136
+ "Authorization": "Bearer mushi_xxxxxxxxxxxxxxxxxxxx",
109
137
  "X-Mushi-Api-Key": "mushi_xxxxxxxxxxxxxxxxxxxx",
110
- "X-Mushi-Project": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
138
+ "X-Mushi-Project-Id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
111
139
  }
112
140
  }
113
141
  }
114
142
  }
115
143
  ```
116
144
 
145
+ > **Cursor icon:** HTTP MCP URLs on `*.supabase.co` often show the **Supabase favicon** in Cursor settings — not a Mushi bug. Use **stdio** (`command` + `npx @mushi-mushi/mcp`) for the red 虫 stamp, or set `"icon": "https://kensaur.us/mushi-mushi/integrations/mushi-mark-512.png"` in your server block. The hosted endpoint also emits MCP `serverInfo.icons` and serves inline SVG at `?icon=1`.
146
+
147
+ ### Feature groups (`?features=` / `MUSHI_FEATURES`)
148
+
149
+ Full catalog is **72 tools** (64 core + 8 project-context tools). New installs default to a lean set via:
150
+
151
+ - **Stdio:** `MUSHI_FEATURES=triage,fixes,inventory,setup,docs`
152
+ - **HTTP:** `?features=triage,fixes,inventory,setup,docs` on the MCP URL
153
+
154
+ Append `legacy` to keep deprecated aliases (`setup_check`, `ingest_setup_check`, …). Use `features=all` for the full catalog.
155
+
156
+ New unified tools: `diagnose_setup` (replaces setup trilogy), `search_mushi_docs` (keyword doc search).
157
+
158
+ Append `?read_only=1` to the URL to hide write tools (Supabase-parity mode).
159
+
160
+ ## Cursor config hygiene
161
+
162
+ 1. **One global MCP config** — keep `mushi` in `~/.cursor/mcp.json` only. Do **not** duplicate `mushi` / `mushi-stdio` in per-project `.cursor/mcp.json` (prevents connection storms). Project repos may ship `{}` or a comment pointing to the global file.
163
+ 2. **Windows paths** — use forward slashes in JSON (`C:/Users/...`) or escaped backslashes (`C:\\Users\\...`). Raw `\f`, `\n`, `\t` in paths corrupt JSON.
164
+ 3. **Multi-project** — either one HTTP server per project (distinct server name + `X-Mushi-Project-Id`) or one stdio server and pass `project_id` on each tool call.
165
+ 4. **After editing global config** — fully restart Cursor (MCP panel must reload).
166
+
167
+ | Header | Role |
168
+ |--------|------|
169
+ | `Authorization: Bearer <key>` | Auth (optional duplicate of API key) |
170
+ | `X-Mushi-Api-Key` | Auth (preferred for MCP clients) |
171
+ | `X-Mushi-Project-Id` | **Project scope** — required for API-key callers |
172
+
173
+ ~~`X-Mushi-Project`~~ is deprecated for project UUID (collision with legacy slug header).
174
+
117
175
  The endpoint accepts JSON-RPC 2.0 over POST (returns `application/json` or `text/event-stream` per content negotiation), opens an SSE stream on GET for server-pushed notifications, and accepts DELETE for session termination. Auth is the same dual-mode API-key / JWT used everywhere else on `/v1/admin/*`.
118
176
 
119
177
  ## Tools
@@ -267,6 +325,7 @@ Honest scorecard against the MCP 2025-10 spec:
267
325
  - ✅ **Stdio transport** — default for local editor integration.
268
326
  - ✅ **Streamable HTTP transport (2025-03-26 spec)** — hosted at `/functions/v1/mcp` on the Mushi backend; same tool catalog, no local subprocess. The previous "⏳" entry shipped in the 2026-05-09 release.
269
327
  - ✅ **Spec traceability for `dispatch_fix`** — the `dispatch_fix` tool input schema now accepts `inventoryActionNodeId`, and `get_fix_context` surfaces the inventory `Action` (with `expected_outcome`) the report was classified against. External orchestrators can read the contract before drafting a fix and pass the anchor back at dispatch time.
328
+ - ✅ **Structured output (`outputSchema` + `structuredContent`)** — the four highest-value tools (`triage_issue`, `get_report_detail`, `get_similar_bugs`, `get_fix_context`) now declare a Zod-derived `outputSchema` and return `structuredContent` alongside the text envelope. Clients that support structured output (Cursor, Claude Desktop) can bind the typed result directly; others fall back to the text content unchanged. Also adds `resource_links` on `triage_issue` pointing to the report and dashboard resources so clients can follow up without re-constructing URIs.
270
329
  - ⏳ **Resource subscriptions / `notifications/resources/list_changed`** — the spec supports live-updating resources (e.g. dashboard numbers that push rather than poll). Worth adding once Cursor + Claude Desktop both ship client support (currently patchy).
271
330
  - ⏳ **Sampling / elicitation** — letting the server ask the client to run an LLM call (e.g. to draft a commit message from the fix context). Not yet wired; would let us move some orchestrator LLM spend from server-side to the user's own subscription.
272
331
 
@@ -287,7 +346,8 @@ The page is the recommended first stop for a new team member — it takes about
287
346
 
288
347
  - The server runs locally; your API key never leaves your machine except in calls to your configured `MUSHI_API_ENDPOINT`.
289
348
  - **Scope keys tightly.** Give MCP the smallest scope that works — `mcp:read` is fine for 90% of agent loops.
290
- - Never paste a service-role key or a `report:write` SDK key — the former bypasses RLS, the latter is rejected by admin routes anyway.
349
+ - **Keep your SDK key (`report:write`) separate from your MCP key.** Your app's Mushi SDK key is embedded in client-side code (e.g. `NEXT_PUBLIC_MUSHI_API_KEY`) and should carry only `report:write` scope. This scope is intentionally rejected by every admin route — so even if extracted from a browser bundle, it cannot triage, dispatch fixes, or mutate report status. Mint a dedicated `mcp:write` key for Cursor/Claude (use the **"⚡ Add to Cursor"** deeplink on the `/mcp` console page — it mints one automatically). If you discover your public SDK key carries `mcp:write`, rotate it immediately.
350
+ - Never paste a service-role key — it bypasses RLS on every table.
291
351
  - Rotate keys from the admin console if a laptop is lost — the denormalised owner binding is rebuilt automatically on rotation.
292
352
  - The server logs to stderr; redirect to a file if you need an audit trail.
293
353
 
@@ -301,7 +361,7 @@ Real `Client ↔ Server` handshake over `InMemoryTransport` with a mocked `fetch
301
361
 
302
362
  ```bash
303
363
  pnpm --filter @mushi-mushi/mcp test
304
- # 18/18 pass — handshake, tool contracts, envelope unwrapping, scope errors, annotation contract
364
+ # 49/49 pass — handshake, tool contracts, envelope unwrapping, scope errors, annotation contract, outputSchema, catalog parity
305
365
  ```
306
366
 
307
367
  ### Layer 2 — Stdio smoke test (verifies the built bin boots)
@@ -404,4 +464,4 @@ MIT
404
464
  <!-- mushi-readme-stats-footer -->
405
465
  ---
406
466
 
407
- <sub>Monorepo scale (June 2026): 43 edge functions · 234 SQL migrations · 13 outbound plugins · 11 inbound adapters. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
467
+ <sub>Monorepo scale (June 2026): 47 edge functions · 256 SQL migrations · 13 outbound plugins · 11 inbound adapters · 18 pipeline agents. Canonical counts: <a href="https://github.com/kensaurus/mushi-mushi/blob/master/docs/stats.md">docs/stats.md</a> · <code>pnpm docs-stats</code></sub>
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Canonical MCP server branding — icons, title, website.
3
+ * Used by stdio + hosted HTTP initialize payloads (MCP 2025-11 icons spec).
4
+ *
5
+ * Cursor often shows the favicon of the HTTP URL host (e.g. supabase.co) when
6
+ * server icons are absent. Always emit `icons` + recommend stdio or our icon URL.
7
+ */
8
+ /** Public marketing site — also hosts favicon.svg for the docs app. */
9
+ declare const MUSHI_WEBSITE_URL = "https://kensaur.us/mushi-mushi";
10
+ /** 512×512 stamp mark — safe PNG on CDN (Cursor requires png/jpeg reliably). */
11
+ declare const MUSHI_ICON_PNG_URL = "https://kensaur.us/mushi-mushi/integrations/mushi-mark-512.png";
12
+ /** SVG favicon from the docs app (scalable; some clients sanitize SVG). */
13
+ declare const MUSHI_ICON_SVG_URL = "https://kensaur.us/mushi-mushi/favicon.svg";
14
+ /** Hosted MCP icon route — same origin as the MCP endpoint when proxied. */
15
+ declare function mcpIconUrl(mcpBaseUrl: string): string;
16
+ interface McpIconDescriptor {
17
+ src: string;
18
+ mimeType?: string;
19
+ /** MCP spec expects an array of size strings, e.g. `["512x512"]`. */
20
+ sizes?: string[];
21
+ }
22
+ declare const MUSHI_SERVER_ICONS: McpIconDescriptor[];
23
+ declare const MUSHI_SERVER_METADATA: {
24
+ readonly name: "mushi-mushi";
25
+ readonly title: "Mushi Mushi";
26
+ readonly description: "User-felt bug triage, fix dispatch, QA stories, and inventory spec traceability for AI coding agents.";
27
+ readonly websiteUrl: "https://kensaur.us/mushi-mushi";
28
+ readonly icons: McpIconDescriptor[];
29
+ };
30
+
31
+ export { MUSHI_ICON_PNG_URL, MUSHI_ICON_SVG_URL, MUSHI_SERVER_ICONS, MUSHI_SERVER_METADATA, MUSHI_WEBSITE_URL, type McpIconDescriptor, mcpIconUrl };
@@ -0,0 +1,16 @@
1
+ import {
2
+ MUSHI_ICON_PNG_URL,
3
+ MUSHI_ICON_SVG_URL,
4
+ MUSHI_SERVER_ICONS,
5
+ MUSHI_SERVER_METADATA,
6
+ MUSHI_WEBSITE_URL,
7
+ mcpIconUrl
8
+ } from "./chunk-EHB2BGWX.js";
9
+ export {
10
+ MUSHI_ICON_PNG_URL,
11
+ MUSHI_ICON_SVG_URL,
12
+ MUSHI_SERVER_ICONS,
13
+ MUSHI_SERVER_METADATA,
14
+ MUSHI_WEBSITE_URL,
15
+ mcpIconUrl
16
+ };
package/dist/catalog.d.ts CHANGED
@@ -65,5 +65,6 @@ interface PromptSpec {
65
65
  }
66
66
  declare const PROMPT_CATALOG: PromptSpec[];
67
67
  declare const TDD_TOOL_CATALOG: ToolSpec[];
68
+ declare const CODEBASE_TOOL_CATALOG: ToolSpec[];
68
69
 
69
- export { ALL_SCOPES, type McpScope, PROMPT_CATALOG, type PromptSpec, RESOURCE_CATALOG, type ResourceSpec, TDD_TOOL_CATALOG, TOOL_CATALOG, type ToolHints, type ToolSpec };
70
+ export { ALL_SCOPES, CODEBASE_TOOL_CATALOG, type McpScope, PROMPT_CATALOG, type PromptSpec, RESOURCE_CATALOG, type ResourceSpec, TDD_TOOL_CATALOG, TOOL_CATALOG, type ToolHints, type ToolSpec };
package/dist/catalog.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  ALL_SCOPES,
3
+ CODEBASE_TOOL_CATALOG,
3
4
  PROMPT_CATALOG,
4
5
  RESOURCE_CATALOG,
5
6
  TDD_TOOL_CATALOG,
6
7
  TOOL_CATALOG
7
- } from "./chunk-FQ5WR3PS.js";
8
+ } from "./chunk-FD6GVGQS.js";
8
9
  export {
9
10
  ALL_SCOPES,
11
+ CODEBASE_TOOL_CATALOG,
10
12
  PROMPT_CATALOG,
11
13
  RESOURCE_CATALOG,
12
14
  TDD_TOOL_CATALOG,
@@ -0,0 +1,158 @@
1
+ // src/feature-groups.ts
2
+ var FEATURE_GROUPS = [
3
+ "triage",
4
+ "fixes",
5
+ "inventory",
6
+ "setup",
7
+ "qa",
8
+ "skills",
9
+ "rewards",
10
+ "admin",
11
+ "audit",
12
+ "docs",
13
+ /** Deprecated aliases kept for one release — hidden unless `legacy` or `all`. */
14
+ "legacy"
15
+ ];
16
+ var DEFAULT_FEATURE_GROUPS = [
17
+ "triage",
18
+ "fixes",
19
+ "inventory",
20
+ "setup",
21
+ "docs"
22
+ ];
23
+ var ALL_FEATURE_GROUPS = FEATURE_GROUPS.filter(
24
+ (g) => g !== "legacy"
25
+ );
26
+ var TOOL_FEATURE_MAP = {
27
+ // triage
28
+ get_recent_reports: "triage",
29
+ get_report_detail: "triage",
30
+ get_report_timeline: "triage",
31
+ search_reports: "triage",
32
+ get_similar_bugs: "triage",
33
+ get_fix_context: "triage",
34
+ get_fix_timeline: "triage",
35
+ get_blast_radius: "triage",
36
+ get_knowledge_graph: "triage",
37
+ run_nl_query: "triage",
38
+ get_report_evidence: "triage",
39
+ triage_issue: "triage",
40
+ query_lessons: "triage",
41
+ list_lessons: "triage",
42
+ fix_suggest: "triage",
43
+ graph_neighborhood: "triage",
44
+ graph_node_status: "triage",
45
+ get_reporter_thread: "legacy",
46
+ // inventory
47
+ inventory_get: "inventory",
48
+ inventory_diff: "inventory",
49
+ inventory_findings: "inventory",
50
+ inventory_current: "admin",
51
+ // setup
52
+ diagnose_connection: "setup",
53
+ diagnose_setup: "setup",
54
+ setup_check: "legacy",
55
+ ingest_setup_check: "legacy",
56
+ get_activation_status: "legacy",
57
+ activation_status: "setup",
58
+ project_integration_health: "setup",
59
+ setup_repo_for_mushi: "setup",
60
+ get_two_way_comms_health: "setup",
61
+ // fixes
62
+ submit_fix_result: "fixes",
63
+ dispatch_fix: "fixes",
64
+ trigger_judge: "fixes",
65
+ test_gen_from_report: "fixes",
66
+ transition_status: "fixes",
67
+ merge_fix: "fixes",
68
+ refresh_ci: "fixes",
69
+ reopen_report: "fixes",
70
+ reply_to_reporter: "fixes",
71
+ // rewards
72
+ list_top_contributors: "rewards",
73
+ award_bonus_points: "rewards",
74
+ set_tier: "rewards",
75
+ // admin / project context
76
+ list_projects: "admin",
77
+ get_account_overview: "admin",
78
+ get_project_context: "admin",
79
+ get_pipeline_logs: "admin",
80
+ project_dashboard: "admin",
81
+ project_stats: "admin",
82
+ project_settings: "admin",
83
+ privacy_status: "admin",
84
+ evolution_history: "admin",
85
+ // qa / tdd
86
+ map_user_stories: "qa",
87
+ get_map_run_status: "qa",
88
+ generate_tdd_from_story: "qa",
89
+ improve_qa_story: "qa",
90
+ run_qa_story: "qa",
91
+ list_pending_review_stories: "qa",
92
+ approve_qa_story: "qa",
93
+ list_qa_story_runs: "qa",
94
+ get_qa_story_run: "qa",
95
+ test_notification_channel: "qa",
96
+ // skills
97
+ list_skills: "skills",
98
+ get_skill: "skills",
99
+ start_skill_pipeline: "skills",
100
+ get_pipeline_run: "skills",
101
+ checkin_pipeline_step: "skills",
102
+ list_byok_keys: "skills",
103
+ add_byok_key: "skills",
104
+ // audit
105
+ run_fullstack_audit: "audit",
106
+ get_backend_health: "audit",
107
+ // docs
108
+ search_mushi_docs: "docs"
109
+ };
110
+ var DEPRECATED_TOOL_ALIASES = {
111
+ setup_check: "diagnose_setup",
112
+ ingest_setup_check: "diagnose_setup",
113
+ get_activation_status: "activation_status",
114
+ get_reporter_thread: "get_report_timeline"
115
+ };
116
+ function parseFeaturesParam(raw) {
117
+ if (raw == null || raw.trim() === "") return "all";
118
+ const normalized = raw.trim().toLowerCase();
119
+ if (normalized === "all" || normalized === "*") return "all";
120
+ const groups = normalized.split(",").map((s) => s.trim()).filter(Boolean);
121
+ const valid = groups.filter((g) => FEATURE_GROUPS.includes(g));
122
+ if (valid.length === 0) return "all";
123
+ return valid;
124
+ }
125
+ function parseFeaturesCsv(raw) {
126
+ if (!raw?.trim()) return "all";
127
+ return parseFeaturesParam(raw);
128
+ }
129
+ function toolMatchesFeatures(toolName, filter) {
130
+ if (filter === "all") return true;
131
+ const group = TOOL_FEATURE_MAP[toolName];
132
+ if (!group) return true;
133
+ if (group === "legacy") {
134
+ return filter.includes("legacy");
135
+ }
136
+ return filter.includes(group);
137
+ }
138
+ function featuresQueryString(groups) {
139
+ return groups.join(",");
140
+ }
141
+ function appendFeaturesToUrl(baseUrl, groups) {
142
+ const url = new URL(baseUrl);
143
+ url.searchParams.set("features", featuresQueryString(groups));
144
+ return url.toString();
145
+ }
146
+
147
+ export {
148
+ FEATURE_GROUPS,
149
+ DEFAULT_FEATURE_GROUPS,
150
+ ALL_FEATURE_GROUPS,
151
+ TOOL_FEATURE_MAP,
152
+ DEPRECATED_TOOL_ALIASES,
153
+ parseFeaturesParam,
154
+ parseFeaturesCsv,
155
+ toolMatchesFeatures,
156
+ featuresQueryString,
157
+ appendFeaturesToUrl
158
+ };
@@ -0,0 +1,28 @@
1
+ // src/branding.ts
2
+ var MUSHI_WEBSITE_URL = "https://kensaur.us/mushi-mushi";
3
+ var MUSHI_ICON_PNG_URL = `${MUSHI_WEBSITE_URL}/integrations/mushi-mark-512.png`;
4
+ var MUSHI_ICON_SVG_URL = `${MUSHI_WEBSITE_URL}/favicon.svg`;
5
+ function mcpIconUrl(mcpBaseUrl) {
6
+ const base = mcpBaseUrl.replace(/\/+$/, "");
7
+ return `${base}?icon=1`;
8
+ }
9
+ var MUSHI_SERVER_ICONS = [
10
+ { src: MUSHI_ICON_PNG_URL, mimeType: "image/png", sizes: ["512x512"] },
11
+ { src: MUSHI_ICON_SVG_URL, mimeType: "image/svg+xml", sizes: ["any"] }
12
+ ];
13
+ var MUSHI_SERVER_METADATA = {
14
+ name: "mushi-mushi",
15
+ title: "Mushi Mushi",
16
+ description: "User-felt bug triage, fix dispatch, QA stories, and inventory spec traceability for AI coding agents.",
17
+ websiteUrl: MUSHI_WEBSITE_URL,
18
+ icons: MUSHI_SERVER_ICONS
19
+ };
20
+
21
+ export {
22
+ MUSHI_WEBSITE_URL,
23
+ MUSHI_ICON_PNG_URL,
24
+ MUSHI_ICON_SVG_URL,
25
+ mcpIconUrl,
26
+ MUSHI_SERVER_ICONS,
27
+ MUSHI_SERVER_METADATA
28
+ };
@@ -134,7 +134,7 @@ var TOOL_CATALOG = [
134
134
  {
135
135
  name: "setup_check",
136
136
  title: "Dispatch preflight check",
137
- description: "Run the 4 **dispatch-readiness** checks for a project and return their pass/fail status (GitHub repo connected, codebase indexed, Anthropic BYOK key present, autofix enabled). Also returns the target repo URL when GitHub is connected. Use this before calling dispatch_fix to understand why a dispatch might fail. For SDK ingest health (API key \u2192 heartbeat \u2192 first report), call ingest_setup_check instead.",
137
+ description: "[Deprecated \u2014 use diagnose_setup with mode=dispatch or diagnose_connection.] Run the 4 **dispatch-readiness** checks for a project and return their pass/fail status (GitHub repo connected, codebase indexed, Anthropic BYOK key present, autofix enabled). Also returns the target repo URL when GitHub is connected.",
138
138
  scope: "mcp:read",
139
139
  hints: { readOnly: true, idempotent: true, openWorld: true },
140
140
  useCase: "Is this project ready to auto-fix bugs? What is blocking dispatch?"
@@ -142,19 +142,35 @@ var TOOL_CATALOG = [
142
142
  {
143
143
  name: "ingest_setup_check",
144
144
  title: "Ingest setup check",
145
- description: "Run the 4 **required ingest** checks for the project tied to this API key: project exists, active API key, SDK heartbeat (or real report), and at least one ingested report. Returns per-step pass/fail plus last_sdk_seen_at and endpoint host diagnostics. Use after wiring env vars or pasting the SDK snippet to confirm the banner will work.",
145
+ description: "[Deprecated \u2014 use diagnose_setup with mode=ingest or diagnose_connection.] Run the 4 **required ingest** checks for the project tied to this API key: project exists, active API key, SDK heartbeat (or real report), and at least one ingested report.",
146
146
  scope: "mcp:read",
147
147
  hints: { readOnly: true, idempotent: true, openWorld: true },
148
148
  useCase: "Is the SDK installed and ingesting reports? Why is my banner still missing?"
149
149
  },
150
+ {
151
+ name: "diagnose_setup",
152
+ title: "Unified setup diagnose",
153
+ description: "Single entry point for setup health. mode=full (default) runs ingest + dispatch checks and returns the best next action; mode=ingest runs SDK ingest checks only; mode=dispatch runs fix-dispatch preflight only. Prefer this over setup_check, ingest_setup_check, or diagnose_connection alone.",
154
+ scope: "mcp:read",
155
+ hints: { readOnly: true, idempotent: true, openWorld: true },
156
+ useCase: "Why is Mushi setup broken \u2014 one call, clear next step."
157
+ },
150
158
  {
151
159
  name: "diagnose_connection",
152
160
  title: "Connection diagnose (CLI + MCP + SDK)",
153
- description: `Validate the MCP server credentials (endpoint, API key, projectId), ping /health, run ingest-setup and dispatch preflight, and return the single best next action when anything fails. Use when the user asks "why aren't my reports showing up?".`,
161
+ description: `Validate MCP credentials, ping /health, run ingest-setup and dispatch preflight, return the single best next action. For mode-specific checks prefer diagnose_setup. Use when the user asks "why aren't my reports showing up?".`,
154
162
  scope: "mcp:read",
155
163
  hints: { readOnly: true, idempotent: true, openWorld: true },
156
164
  useCase: "Why is my Mushi setup broken \u2014 what exact step should I fix next?"
157
165
  },
166
+ {
167
+ name: "search_mushi_docs",
168
+ title: "Search Mushi documentation",
169
+ description: "Search official Mushi docs (guides, MCP setup, inventory, QA, skills) by keyword. Returns ranked page titles, URLs, and excerpts \u2014 use before guessing API shapes or RPC names.",
170
+ scope: "mcp:read",
171
+ hints: { readOnly: true, idempotent: true, openWorld: false },
172
+ useCase: "How do I configure MCP scopes / dispatch a fix / wire QA stories?"
173
+ },
158
174
  // --- Write / agentic ----------------------------------------------------
159
175
  {
160
176
  name: "submit_fix_result",
@@ -258,11 +274,19 @@ var TOOL_CATALOG = [
258
274
  {
259
275
  name: "list_projects",
260
276
  title: "List accessible projects",
261
- description: "List the Mushi projects accessible to this API key. For project-scoped keys (the typical case), returns a single-item list with the bound project's id, name, slug, plan tier, and ingest status. For org-level tokens, returns all projects in the org. Use this when MUSHI_PROJECT_ID is not configured \u2014 call list_projects first, then pass the id to other tools.",
277
+ description: `List the Mushi projects accessible to this API key. For project-scoped keys (the typical case), returns a single-item list with the bound project's id, name, created_at. Use this when MUSHI_PROJECT_ID is not configured \u2014 call list_projects first, then pass the id to other tools. Multi-project note: each Mushi project uses its own API key. To connect multiple projects, run "Add to Cursor" in the Mushi console for each project \u2014 each deeplink creates a uniquely-named MCP server entry (mushi-{slug}-{id}). You can then call list_projects on each named server to confirm which project it serves.`,
262
278
  scope: "mcp:read",
263
279
  hints: { readOnly: true, idempotent: true, openWorld: true },
264
280
  useCase: "Which projects can I access with this API key?"
265
281
  },
282
+ {
283
+ name: "get_account_overview",
284
+ title: "Account overview \u2014 all projects",
285
+ description: "Return a summary of every Mushi project accessible to this API key, including report counts, SDK heartbeat status, and the last ingest timestamp for each. For project-scoped keys this is a one-item list; for future org-level keys it lists every project. Also includes a hint explaining how to connect additional projects to your IDE. Call this at the start of a multi-repo or multi-app triage session to orient yourself.",
286
+ scope: "mcp:read",
287
+ hints: { readOnly: true, idempotent: true, openWorld: true },
288
+ useCase: "Show me all my Mushi projects and their health at a glance."
289
+ },
266
290
  {
267
291
  name: "get_project_context",
268
292
  title: "Project context snapshot",
@@ -554,7 +578,7 @@ var TDD_TOOL_CATALOG = [
554
578
  {
555
579
  name: "get_activation_status",
556
580
  title: "Activation cockpit status",
557
- description: "Unified setup posture for the active project: required steps, SDK heartbeat, dispatch preflight, and the next best action. Use this first when the user says setup is broken or they cannot connect.",
581
+ description: "[Deprecated \u2014 use activation_status resource or tool on hosted MCP.] Unified setup posture for the active project: required steps, SDK heartbeat, dispatch preflight, and the next best action.",
558
582
  scope: "mcp:read",
559
583
  hints: { readOnly: true, idempotent: true, openWorld: true },
560
584
  useCase: "What is blocking this project from going live?"
@@ -562,7 +586,7 @@ var TDD_TOOL_CATALOG = [
562
586
  {
563
587
  name: "get_reporter_thread",
564
588
  title: "Reporter feedback thread",
565
- description: "Fetch the unified timeline for a report \u2014 the reporter/admin comment thread (including verify/reopen signals) plus fix, QA, and status lanes. Use when triaging whether an end user still sees a bug as unfixed.",
589
+ description: "[Deprecated \u2014 use get_report_timeline instead.] Fetch the unified timeline for a report \u2014 reporter comments plus fix, QA, and status lanes.",
566
590
  scope: "mcp:read",
567
591
  hints: { readOnly: true, idempotent: true, openWorld: true },
568
592
  useCase: "What did the reporter say after we marked this fixed?"
@@ -585,11 +609,70 @@ var TDD_TOOL_CATALOG = [
585
609
  useCase: "Are there any tables without RLS? Show me recent backend errors for this project."
586
610
  }
587
611
  ];
612
+ var CODEBASE_TOOL_CATALOG = [
613
+ {
614
+ name: "ask_codebase",
615
+ title: "Ask about the indexed codebase",
616
+ description: "Ask a plain-English question about the connected repo. Grounds on pgvector retrieval over project_codebase_files and returns an answer with file:line citations. Requires codebase indexing enabled and an Anthropic or OpenAI BYOK key.",
617
+ scope: "mcp:write",
618
+ hints: { readOnly: false, destructive: false, idempotent: false, openWorld: true },
619
+ useCase: "How does authentication work in this repo?"
620
+ },
621
+ {
622
+ name: "get_file_summary",
623
+ title: "Plain-English file summary",
624
+ description: "Lazy-generate (or return cached) plain-English summary for an indexed file or symbol. Cache invalidates when content_hash changes after re-index.",
625
+ scope: "mcp:read",
626
+ hints: { readOnly: true, idempotent: true, openWorld: true },
627
+ useCase: "Explain what lib/auth.ts does in plain English."
628
+ },
629
+ {
630
+ name: "get_codebase_tour",
631
+ title: "Guided codebase tour",
632
+ description: "Return a dependency-ordered guided tour (~6\u201310 stops) for onboarding \u2014 each stop lists node ids, file paths, layer, and rationale. Cached per index fingerprint.",
633
+ scope: "mcp:read",
634
+ hints: { readOnly: true, idempotent: true, openWorld: true },
635
+ useCase: "Give me an onboarding walkthrough of this codebase."
636
+ },
637
+ {
638
+ name: "search_codebase",
639
+ title: "Semantic codebase search",
640
+ description: "Search indexed files by plain-English meaning via embeddings. Returns top-k file chunks with similarity scores.",
641
+ scope: "mcp:read",
642
+ hints: { readOnly: true, idempotent: true, openWorld: true },
643
+ useCase: "Find files related to authentication or payment handling."
644
+ },
645
+ {
646
+ name: "get_codebase_domains",
647
+ title: "Business domain map",
648
+ description: "Extract business domains, flows, and steps mapped to file paths. Cached per index fingerprint.",
649
+ scope: "mcp:read",
650
+ hints: { readOnly: true, idempotent: true, openWorld: true },
651
+ useCase: "What business domains does this codebase implement?"
652
+ },
653
+ {
654
+ name: "analyze_codebase_impact",
655
+ title: "Diff impact analysis",
656
+ description: "Find files that depend on changed paths (reverse import graph). Supports manual paths, last push, GitHub compare, or fix PR files.",
657
+ scope: "mcp:read",
658
+ hints: { readOnly: true, idempotent: true, openWorld: true },
659
+ useCase: "What breaks if I change lib/auth.ts?"
660
+ },
661
+ {
662
+ name: "analyze_wiki_knowledge",
663
+ title: "Wiki knowledge graph",
664
+ description: "Return wiki/docs knowledge graph nodes and sources for the project. Use include_wiki on ask_codebase for RAG merge.",
665
+ scope: "mcp:read",
666
+ hints: { readOnly: true, idempotent: true, openWorld: true },
667
+ useCase: "What docs entities exist for onboarding?"
668
+ }
669
+ ];
588
670
 
589
671
  export {
590
672
  ALL_SCOPES,
591
673
  TOOL_CATALOG,
592
674
  RESOURCE_CATALOG,
593
675
  PROMPT_CATALOG,
594
- TDD_TOOL_CATALOG
676
+ TDD_TOOL_CATALOG,
677
+ CODEBASE_TOOL_CATALOG
595
678
  };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Feature groups for MCP tool filtering — mirrors Supabase MCP `?features=` pattern.
3
+ *
4
+ * When `features` is omitted → all tools (backward compatible).
5
+ * New installs default to DEFAULT_FEATURE_GROUPS via deeplink / docs.
6
+ */
7
+ declare const FEATURE_GROUPS: readonly ["triage", "fixes", "inventory", "setup", "qa", "skills", "rewards", "admin", "audit", "docs", "legacy"];
8
+ type FeatureGroup = (typeof FEATURE_GROUPS)[number];
9
+ /** Lean default for new Cursor installs (~45 tools vs 70 full). */
10
+ declare const DEFAULT_FEATURE_GROUPS: readonly FeatureGroup[];
11
+ declare const ALL_FEATURE_GROUPS: readonly FeatureGroup[];
12
+ /** Map every tool/resource name → feature group. */
13
+ declare const TOOL_FEATURE_MAP: Record<string, FeatureGroup>;
14
+ /** Tools superseded by another — still registered when legacy/all enabled. */
15
+ declare const DEPRECATED_TOOL_ALIASES: Record<string, string>;
16
+ type FeatureFilter = 'all' | readonly FeatureGroup[];
17
+ declare function parseFeaturesParam(raw: string | null | undefined): FeatureFilter;
18
+ declare function parseFeaturesCsv(raw: string | undefined): FeatureFilter;
19
+ declare function toolMatchesFeatures(toolName: string, filter: FeatureFilter): boolean;
20
+ declare function featuresQueryString(groups: readonly FeatureGroup[]): string;
21
+ declare function appendFeaturesToUrl(baseUrl: string, groups: readonly FeatureGroup[]): string;
22
+
23
+ export { ALL_FEATURE_GROUPS, DEFAULT_FEATURE_GROUPS, DEPRECATED_TOOL_ALIASES, FEATURE_GROUPS, type FeatureFilter, type FeatureGroup, TOOL_FEATURE_MAP, appendFeaturesToUrl, featuresQueryString, parseFeaturesCsv, parseFeaturesParam, toolMatchesFeatures };
@@ -0,0 +1,24 @@
1
+ import {
2
+ ALL_FEATURE_GROUPS,
3
+ DEFAULT_FEATURE_GROUPS,
4
+ DEPRECATED_TOOL_ALIASES,
5
+ FEATURE_GROUPS,
6
+ TOOL_FEATURE_MAP,
7
+ appendFeaturesToUrl,
8
+ featuresQueryString,
9
+ parseFeaturesCsv,
10
+ parseFeaturesParam,
11
+ toolMatchesFeatures
12
+ } from "./chunk-B2QEG35D.js";
13
+ export {
14
+ ALL_FEATURE_GROUPS,
15
+ DEFAULT_FEATURE_GROUPS,
16
+ DEPRECATED_TOOL_ALIASES,
17
+ FEATURE_GROUPS,
18
+ TOOL_FEATURE_MAP,
19
+ appendFeaturesToUrl,
20
+ featuresQueryString,
21
+ parseFeaturesCsv,
22
+ parseFeaturesParam,
23
+ toolMatchesFeatures
24
+ };