@mushi-mushi/mcp 0.31.3 → 0.31.5

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
@@ -31,7 +31,7 @@ Restart the editor and ask *"what's broken in prod?"*. For Cursor and Claude, `s
31
31
  "mcpServers": {
32
32
  "mushi-mushi": {
33
33
  "command": "npx",
34
- "args": ["-y", "@mushi-mushi/mcp@0.31.3"],
34
+ "args": ["-y", "@mushi-mushi/mcp@0.31.5"],
35
35
  "env": {
36
36
  "MUSHI_API_KEY": "mushi_xxxxxxxxxxxxxxxxxxxx",
37
37
  "MUSHI_PROJECT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
package/dist/clients.d.ts CHANGED
@@ -54,7 +54,7 @@ import { FeatureGroup } from './feature-groups.js';
54
54
  * editor launch. Synced to package.json by `scripts/sync-mcp-pin.mjs` — never
55
55
  * hand-edit the version.
56
56
  */
57
- declare const MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.3";
57
+ declare const MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.5";
58
58
  interface StdioConfig {
59
59
  command: string;
60
60
  args: string[];
package/dist/clients.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-SHA56ZRG.js";
9
9
 
10
10
  // src/clients.ts
11
- var MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.3";
11
+ var MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.5";
12
12
  var PIN_SPEC_RE = /^@mushi-mushi\/mcp@\d+\.\d+\.\d+$/;
13
13
  function pinOf(pinSpec) {
14
14
  return pinSpec && PIN_SPEC_RE.test(pinSpec) ? pinSpec : MCP_PIN_SPEC;
package/dist/index.js CHANGED
@@ -1973,6 +1973,15 @@ var MUSHI_DOCS_INDEX = [
1973
1973
  headings: ["First run: two screens", "Name your project", "See your first diagnosis", "Full checklist", "After you create a project", "Generate an API key", "Test the connection", "Install the SDK"],
1974
1974
  excerpt: "Get your first bug report into Mushi Mushi with the console's Set up page, from naming your project to a report with a plain-English diagnosis."
1975
1975
  },
1976
+ {
1977
+ title: "Ops",
1978
+ url: docUrl("/admin/ops"),
1979
+ route: "/admin/ops",
1980
+ markdown: "admin/ops.md",
1981
+ keywords: ["admin", "ops"],
1982
+ headings: [],
1983
+ excerpt: "The Ops page in Mushi Mushi shows every app's payments, releases and alerts in one feed, which app is not reporting, and what is still open."
1984
+ },
1976
1985
  {
1977
1986
  title: "Overview (Home view)",
1978
1987
  url: docUrl("/admin/overview"),
@@ -2018,6 +2027,15 @@ var MUSHI_DOCS_INDEX = [
2018
2027
  headings: ["The 4-step workflow", "Summary tiles", "Steps", "Prompt table columns", "Actions per row", "Common tasks", "Fixing wrong component classification", "Investigating a bad judge score"],
2019
2028
  excerpt: "The AI prompts page in the Mushi Mushi console lets you edit and A/B compare the prompts behind each AI step before you promote a new version."
2020
2029
  },
2030
+ {
2031
+ title: "Providers & AI routes",
2032
+ url: docUrl("/admin/providers"),
2033
+ route: "/admin/providers",
2034
+ markdown: "admin/providers.md",
2035
+ keywords: ["admin", "providers", "ai", "routes"],
2036
+ headings: [],
2037
+ excerpt: "Operator-only page in the Mushi Mushi console showing each app's AI provider accounts, their health and spend, and the ordered model routes each app tries."
2038
+ },
2021
2039
  {
2022
2040
  title: "Scheduled tests",
2023
2041
  url: docUrl("/admin/qa-coverage"),
@@ -2286,7 +2304,7 @@ var MUSHI_DOCS_INDEX = [
2286
2304
  markdown: "cloud.md",
2287
2305
  keywords: ["cloud"],
2288
2306
  headings: ["Plans", "Sign-up flow", "Why metered on diagnoses", "Spend controls", "Self-hosting"],
2289
- excerpt: "Hosted Mushi Mushi. Bug reports, plain-English diagnoses, and fix dispatch without running servers. Free for one app with 100 diagnoses a month."
2307
+ excerpt: "Hosted Mushi Mushi. Bug reports, plain-English diagnoses, and fix dispatch without running servers. Free for three apps with 300 diagnoses a month."
2290
2308
  },
2291
2309
  {
2292
2310
  title: "Compare",
@@ -2340,7 +2358,7 @@ var MUSHI_DOCS_INDEX = [
2340
2358
  markdown: "compare/sentry-vs-mushi.md",
2341
2359
  keywords: ["compare", "sentry-vs-mushi", "sentry"],
2342
2360
  headings: ["What each one is", "Side by side", "Where they overlap, and where they do not", "Running Mushi Mushi alongside Sentry [#running-mushi-alongside-sentry]", "Pick Sentry if", "Pick Mushi Mushi if [#pick-mushi-if]", "Frequently asked questions"],
2343
- excerpt: "Sentry vs Mushi Mushi in 2026. What each captures, Sentry's free tier and Seer pricing next to Mushi Mushi's free plan (1 app, 100 diagnoses), and running both."
2361
+ excerpt: "Sentry vs Mushi Mushi in 2026. What each captures, Sentry's free tier and Seer pricing beside Mushi Mushi's free plan (3 apps, 300 diagnoses), and running both."
2344
2362
  },
2345
2363
  {
2346
2364
  title: "Concepts",
@@ -2603,6 +2621,15 @@ var MUSHI_DOCS_INDEX = [
2603
2621
  headings: ["Step-by-step", "Wire Cursor", "(Optional) Add the evolution-loop coding rules", "Restart Cursor", "Verify", "Available tools in Cursor", "Keep lessons current", "Connecting GitHub for auto-PR"],
2604
2622
  excerpt: "Wire Mushi Mushi into Cursor with one command. Get fix context, lessons and fix dispatch right from the editor."
2605
2623
  },
2624
+ {
2625
+ title: "Ops hub (payments, releases and alerts in your team's Slack)",
2626
+ url: docUrl("/integrations/ops-hub"),
2627
+ route: "/integrations/ops-hub",
2628
+ markdown: "integrations/ops-hub.md",
2629
+ keywords: ["integrations", "ops-hub", "ops", "hub", "payments", "releases", "alerts", "team", "slack"],
2630
+ headings: ["What you get", "Slack bot", "Create a Slack app", "Point Slack at Mushi Mushi", "Save the token and the signing secret", "Pick the channels", "Connect an app", "Create the app's ops key"],
2631
+ excerpt: "Every app sends payments, releases and alerts to Mushi Mushi with one server key; your team's own Slack bot posts them, threads follow-ups and answers commands."
2632
+ },
2606
2633
  {
2607
2634
  title: "Voice intake",
2608
2635
  url: docUrl("/integrations/voice-intake"),
@@ -2619,7 +2646,7 @@ var MUSHI_DOCS_INDEX = [
2619
2646
  markdown: "ja.md",
2620
2647
  keywords: ["ja"],
2621
2648
  headings: ["\u307E\u305A\u7121\u6599\u3067\u8A66\u3059\uFF1A\u516C\u958B\u4E2D\u306E\u30B5\u30A4\u30C8\u3092\u30C1\u30A7\u30C3\u30AF", "\u3067\u304D\u308B\u3053\u3068", "\u5831\u544A\u30DC\u30BF\u30F3\u306F\u65E5\u672C\u8A9E\u3067\u8868\u793A\u3055\u308C\u307E\u3059", "\u59CB\u3081\u65B9\uFF1ALovable\u30FBBolt \u306E\u5834\u5408", "\u59CB\u3081\u65B9\uFF1ACursor\u30FBClaude Code \u306E\u5834\u5408", "\u904B\u55B6\u8005\u60C5\u5831", "\u82F1\u8A9E\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8"],
2622
- excerpt: "Mushi Mushi \u306F\u3001\u30A2\u30D7\u30EA\u306B\u300C\u554F\u984C\u3092\u5831\u544A\u300D\u30DC\u30BF\u30F3\u3092\u8FFD\u52A0\u3057\u3001\u5C4A\u3044\u305F\u4E0D\u5177\u5408\u306E\u539F\u56E0\u3068\u76F4\u3057\u65B9\u3092 AI \u304C\u8AAC\u660E\u3059\u308B\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9\u306E\u30C4\u30FC\u30EB\u3067\u3059\u3002\u7121\u6599\u30D7\u30E9\u30F3\u306F\u30A2\u30D7\u30EA 1 \u672C\u30FB\u6708 100 \u4EF6\u306E\u8A3A\u65AD\u307E\u3067\u3002"
2649
+ excerpt: "Mushi Mushi \u306F\u3001\u30A2\u30D7\u30EA\u306B\u300C\u554F\u984C\u3092\u5831\u544A\u300D\u30DC\u30BF\u30F3\u3092\u8FFD\u52A0\u3057\u3001\u5C4A\u3044\u305F\u4E0D\u5177\u5408\u306E\u539F\u56E0\u3068\u76F4\u3057\u65B9\u3092 AI \u304C\u8AAC\u660E\u3059\u308B\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9\u306E\u30C4\u30FC\u30EB\u3067\u3059\u3002\u7121\u6599\u30D7\u30E9\u30F3\u306F\u30A2\u30D7\u30EA 3 \u672C\u30FB\u6708 300 \u4EF6\u306E\u8A3A\u65AD\u307E\u3067\u3002"
2623
2650
  },
2624
2651
  {
2625
2652
  title: "Launch Week",
@@ -3015,7 +3042,7 @@ var MUSHI_DOCS_INDEX = [
3015
3042
  markdown: "pricing.md",
3016
3043
  keywords: ["pricing", "free", "builder", "studio", "self-host"],
3017
3044
  headings: ["All plans", "What counts as a diagnosis", "Pricing estimator", "Example bills", "Why apps, not reports?", "Why diagnoses, not events", "Your own AI key and the self-host path", "Compared to Sentry + Seer"],
3018
- excerpt: "Mushi Mushi pricing. Free for one app and 100 AI bug diagnoses a month. Builder $29/mo for 3 apps, Studio $79/mo for 10. Free to self-host."
3045
+ excerpt: "Mushi Mushi pricing. Free for three apps and 300 AI bug diagnoses a month. Builder $29/mo for 1,000 diagnoses, Studio $79/mo for 10 apps. Free to self-host."
3019
3046
  },
3020
3047
  {
3021
3048
  title: "Quickstart: install, first report, first fix",
@@ -3044,6 +3071,15 @@ var MUSHI_DOCS_INDEX = [
3044
3071
  headings: ["Get your project ID and API key", "Install and register"],
3045
3072
  excerpt: "Free, open-source bug report widget for Angular 17+: one provideMushi() call registers the service and error handler, so errors and reports reach your queue."
3046
3073
  },
3074
+ {
3075
+ title: "Ask Bolt why it broke",
3076
+ url: docUrl("/quickstart/bolt-mcp"),
3077
+ route: "/quickstart/bolt-mcp",
3078
+ markdown: "quickstart/bolt-mcp.md",
3079
+ keywords: ["quickstart", "bolt-mcp", "bolt", "mcp", "ask", "broke"],
3080
+ headings: ["Open your connectors", "Add Mushi Mushi as a custom MCP server", "Sign in and approve", "Turn it on in your project", "Ask Bolt", "Which tools Bolt gets", "If it does not connect"],
3081
+ excerpt: "Add Mushi Mushi to Bolt as a custom MCP connector, sign in once, and ask Bolt what users reported. Bolt reads the plain-English diagnosis and fixes the bug."
3082
+ },
3047
3083
  {
3048
3084
  title: "Bug report widget for Capacitor and Ionic",
3049
3085
  url: docUrl("/quickstart/capacitor"),
@@ -3071,6 +3107,15 @@ var MUSHI_DOCS_INDEX = [
3071
3107
  headings: ["Get your project ID and API key", "Install", "Initialize", "Open the widget or submit a report"],
3072
3108
  excerpt: "Free, open-source bug report widget for Flutter (preview): shake-to-report, a Material bottom sheet and an offline queue. A git dependency, not on pub.dev yet."
3073
3109
  },
3110
+ {
3111
+ title: "HTTP API: file a bug report with one curl",
3112
+ url: docUrl("/quickstart/http-api"),
3113
+ route: "/quickstart/http-api",
3114
+ markdown: "quickstart/http-api.md",
3115
+ keywords: ["quickstart", "http-api", "http", "api", "file", "bug", "report", "one", "curl"],
3116
+ headings: ["Get your project ID and key", "Send a report", "Check it", "The fields", "Keys and scopes", "Rate limits", "More than one report", "OpenAPI spec"],
3117
+ excerpt: "Send a bug report to Mushi Mushi with one HTTP call, no SDK. How to get a key, the scopes, the rate limits, and the OpenAPI 3.1 spec for code generators."
3118
+ },
3074
3119
  {
3075
3120
  title: "Incident loop: from bug report to fix prompt",
3076
3121
  url: docUrl("/quickstart/incident-loop"),
@@ -3143,6 +3188,15 @@ var MUSHI_DOCS_INDEX = [
3143
3188
  headings: ["Get your project ID and API key", "1. Install", "2. Mount the provider", "Optional native modules", "3. Verify"],
3144
3189
  excerpt: "Free, open-source bug report widget for React Native and Expo: shake to report, a floating bug button, then a plain-English diagnosis of each report."
3145
3190
  },
3191
+ {
3192
+ title: "Mushi Mushi in Replit",
3193
+ url: docUrl("/quickstart/replit"),
3194
+ route: "/quickstart/replit",
3195
+ markdown: "quickstart/replit.md",
3196
+ keywords: ["quickstart", "replit"],
3197
+ headings: ["Add the report button", "Connect Replit Agent", "Add the server", "Sign in and approve", "Ask Agent", "If it does not connect"],
3198
+ excerpt: "Add the Mushi Mushi report button to a Replit app with one prompt, then connect Replit Agent over MCP so it reads the plain-English diagnosis and fixes the bug."
3199
+ },
3146
3200
  {
3147
3201
  title: "Bug report widget for Svelte and SvelteKit",
3148
3202
  url: docUrl("/quickstart/svelte"),
@@ -3428,7 +3482,7 @@ var MUSHI_DOCS_INDEX = [
3428
3482
  route: "/sdks/react-native",
3429
3483
  markdown: "sdks/react-native.md",
3430
3484
  keywords: ["sdks", "react-native", "react", "native", "@mushi-mushi/react-native"],
3431
- headings: ["Install", "Mount the provider", "Submit a report from a screen", "Offline queue", "What gets captured (v0.19+)", "Screenshots (react-native-view-shot)", "Theming the report sheet", "Manual breadcrumbs"],
3485
+ headings: ["Install", "Mount the provider", "Submit a report from a screen", "Offline queue", "What gets captured (v0.19+)", "Screenshots (react-native-view-shot)", "Theming the report sheet", "Diagnostics at send time"],
3432
3486
  excerpt: "Reference for @mushi-mushi/react-native, Mushi Mushi for React Native and Expo. MushiProvider, hooks, shake-to-report, screenshots, identity and offline queue."
3433
3487
  },
3434
3488
  {
@@ -3491,7 +3545,7 @@ var MUSHI_DOCS_INDEX = [
3491
3545
  route: "/sdks/web",
3492
3546
  markdown: "sdks/web.md",
3493
3547
  keywords: ["sdks", "web", "javascript", "bug", "reporting", "sdk", "browser", "mushi-mushi"],
3494
- headings: ["Sampling & beforeSend", "Screenshot preview & consent (1.19+)", "Runtime config merge (Jul 2026+)", "Capture availability & errors", "Description draft persistence", "Identifying users & the Rewards program", "Enabling the Rewards program", "Querying points & tier"],
3548
+ headings: ["Sampling & beforeSend", "Screenshot preview & consent (1.19+)", "Runtime config merge (Jul 2026+)", "Diagnostics at send time", "Capture availability & errors", "Description draft persistence", "Identifying users & the Rewards program", "Enabling the Rewards program"],
3495
3549
  excerpt: "Reference for mushi-mushi, the Mushi Mushi browser SDK. Screenshots, console and network capture, the Shadow DOM widget, sampling, beforeSend and privacy."
3496
3550
  },
3497
3551
  {
@@ -3563,8 +3617,8 @@ var MUSHI_DOCS_INDEX = [
3563
3617
  route: "/self-hosting",
3564
3618
  markdown: "self-hosting/index.md",
3565
3619
  keywords: ["self-hosting", "self", "hosting"],
3566
- headings: ["What you'll deploy", "Fastest path \u2014 Docker Compose", "Managed-Supabase path"],
3567
- excerpt: "Run the whole Mushi Mushi stack yourself with Docker Compose. Your own keys, AGPLv3 server, MIT SDKs, no usage limits."
3620
+ headings: ["What you'll deploy", "Quickstart: your own Supabase project", "Docker Compose (experimental)"],
3621
+ excerpt: "Run Mushi Mushi on your own Supabase project with one command, mushi selfhost up. Your own keys, AGPLv3 server, MIT SDKs, no usage limits."
3568
3622
  },
3569
3623
  {
3570
3624
  title: "Admin SPA deploy",
@@ -3576,13 +3630,13 @@ var MUSHI_DOCS_INDEX = [
3576
3630
  excerpt: "Build and deploy the Mushi Mushi admin console yourself. A static Vite and React app that talks to your Supabase project, and the env vars it needs."
3577
3631
  },
3578
3632
  {
3579
- title: "Self-host in minutes (Docker Compose)",
3633
+ title: "Docker Compose (experimental)",
3580
3634
  url: docUrl("/self-hosting/docker-compose"),
3581
3635
  route: "/self-hosting/docker-compose",
3582
3636
  markdown: "self-hosting/docker-compose.md",
3583
- keywords: ["self-hosting", "self", "hosting", "docker-compose", "docker", "compose", "self-host", "minutes"],
3584
- headings: ["One command", "Clone and configure", "Bring the stack up", "Open the console", "What's running", "Production notes", "Managed Supabase instead"],
3585
- excerpt: "Self-host the whole Mushi Mushi stack with one Docker Compose file. Postgres, auth, storage, edge functions, the admin console and a Caddy reverse proxy."
3637
+ keywords: ["self-hosting", "self", "hosting", "docker-compose", "docker", "compose", "experimental"],
3638
+ headings: ["Generate the secrets", "Bring the stack up", "Open the console", "What's running", "Not included", "Production notes"],
3639
+ excerpt: "Run the whole Mushi Mushi stack in Docker Compose with no Supabase account. Experimental. Postgres, auth, storage, every edge function, the console and Caddy."
3586
3640
  },
3587
3641
  {
3588
3642
  title: "Edge Functions deploy",
@@ -3608,7 +3662,7 @@ var MUSHI_DOCS_INDEX = [
3608
3662
  route: "/self-hosting/supabase",
3609
3663
  markdown: "self-hosting/supabase.md",
3610
3664
  keywords: ["self-hosting", "self", "hosting", "supabase", "setup"],
3611
- headings: ["Required extensions", "Required custom functions", "RLS pattern", "Seed data", "Verifying the setup"],
3665
+ headings: ["Required extensions", "Required custom functions", "RLS pattern", "Seed data and runtime config", "Verifying the setup"],
3612
3666
  excerpt: "Set up a Supabase project for self-hosted Mushi Mushi. Link the CLI, push every migration, and check the Postgres extensions the server needs."
3613
3667
  },
3614
3668
  {
@@ -3785,6 +3839,63 @@ function wrapUntrustedJson(value, role) {
3785
3839
  return wrapUntrusted(serialised, role);
3786
3840
  }
3787
3841
 
3842
+ // src/key-scopes.ts
3843
+ async function fetchKeyScopes(opts) {
3844
+ const doFetch = opts.fetch ?? fetch;
3845
+ try {
3846
+ const res = await doFetch(`${opts.apiEndpoint.replace(/\/+$/, "")}/v1/sync/whoami`, {
3847
+ headers: {
3848
+ "X-Mushi-Api-Key": opts.apiKey,
3849
+ ...opts.projectId ? { "X-Mushi-Project-Id": opts.projectId } : {}
3850
+ },
3851
+ signal: AbortSignal.timeout(opts.timeoutMs ?? 5e3)
3852
+ });
3853
+ if (!res.ok) return null;
3854
+ const body = await res.json();
3855
+ const scopes = body?.data?.scopes;
3856
+ if (!Array.isArray(scopes)) return null;
3857
+ return scopes.filter((s) => typeof s === "string");
3858
+ } catch {
3859
+ return null;
3860
+ }
3861
+ }
3862
+ function decideScopes(keyScopes, configured) {
3863
+ if (keyScopes === null) return { kind: "serve", scopes: configured };
3864
+ const granted = /* @__PURE__ */ new Set();
3865
+ if (keyScopes.includes("mcp:write")) {
3866
+ granted.add("mcp:read");
3867
+ granted.add("mcp:write");
3868
+ } else if (keyScopes.includes("mcp:read")) {
3869
+ granted.add("mcp:read");
3870
+ }
3871
+ if (granted.size === 0) return { kind: "sdk-key", keyScopes };
3872
+ return { kind: "serve", scopes: configured.filter((s) => granted.has(s)) };
3873
+ }
3874
+ function mcpKeyLoginCommand(projectId) {
3875
+ return `npx mushi-mushi login${projectId ? ` --project-id ${projectId}` : ""}`;
3876
+ }
3877
+ function sdkKeyNextAction(consoleUrl, ctx = {}) {
3878
+ const command = mcpKeyLoginCommand(ctx.projectId);
3879
+ const then = ctx.keySource === "env" ? "then remove MUSHI_API_KEY from this server's env block (the server then uses the saved key) and restart it." : "then restart this server.";
3880
+ return `Run \`${command}\` (approve in the browser; it saves a key that can read reports), ${then} Or mint an MCP key in the console (${consoleUrl}/mcp \u2192 "Mint mcp:read key") and put it in MUSHI_API_KEY.`;
3881
+ }
3882
+ function sdkKeyReport(keyScopes, consoleUrl, ctx = {}) {
3883
+ const held = keyScopes.length > 0 ? keyScopes.join(", ") : "none";
3884
+ const then = ctx.keySource === "env" ? " then remove MUSHI_API_KEY from this server's env block and restart it." : " then restart this server.";
3885
+ return [
3886
+ "",
3887
+ `[mushi-mcp] This API key has scopes: ${held}. It can send bug reports (the SDK key) but not read them,`,
3888
+ " so the MCP tools would all be refused. Serving setup mode.",
3889
+ " Fix (one command, approve in the browser):",
3890
+ "",
3891
+ ` ${mcpKeyLoginCommand(ctx.projectId)}`,
3892
+ "",
3893
+ then,
3894
+ ` Or mint an MCP key in the console (${consoleUrl}/mcp \u2192 "Mint mcp:read key") and put it in MUSHI_API_KEY.`,
3895
+ ""
3896
+ ].join("\n");
3897
+ }
3898
+
3788
3899
  // src/arg-aliases.ts
3789
3900
  function snakeAliasOf(name) {
3790
3901
  return name.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
@@ -8498,7 +8609,7 @@ function createSetupModeServer(config) {
8498
8609
  features: "all",
8499
8610
  ...config.fetch ? { fetch: config.fetch } : {},
8500
8611
  ...config.timeoutMs ? { timeoutMs: config.timeoutMs } : {},
8501
- instructions: config.reason === "sdk-key" ? "Mushi is running in setup mode: the configured API key is an SDK key (report:write). It can send bug reports but not read them, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for how to mint an MCP key (mcp:read), then restart the MCP server." : "Mushi is running in setup mode: no API key is configured, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for the exact steps to connect (run `npx mushi-mushi` or `mushi login`, or put MUSHI_API_KEY in this server's env block), then restart the MCP server."
8612
+ instructions: config.reason === "sdk-key" ? "Mushi is running in setup mode: the configured API key is an SDK key (report:write). It can send bug reports but not read them, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Fix: " + sdkKeyNextAction(MUSHI_CONSOLE_URL, config.sdkKeyFix) : "Mushi is running in setup mode: no API key is configured, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for the exact steps to connect (run `npx mushi-mushi` or `mushi login`, or put MUSHI_API_KEY in this server's env block), then restart the MCP server."
8502
8613
  });
8503
8614
  const internals = server;
8504
8615
  for (const [name, tool] of Object.entries(internals._registeredTools)) {
@@ -8514,7 +8625,7 @@ function createSetupModeServer(config) {
8514
8625
  const spec = TOOL_CATALOG.find((t) => t.name === "diagnose_setup");
8515
8626
  if (!spec) throw new Error("[mushi-mcp] diagnose_setup is missing from TOOL_CATALOG");
8516
8627
  const sdkKey = config.reason === "sdk-key";
8517
- const nextAction = sdkKey ? `Mint an MCP key in the console (${MUSHI_CONSOLE_URL}/mcp \u2192 "Mint mcp:read key") or run \`mushi login\`, put it in MUSHI_API_KEY for this server, then restart it.` : "Run `npx mushi-mushi` in your project (signs you in and writes the key) or `mushi login`, then restart this MCP server.";
8628
+ const nextAction = sdkKey ? sdkKeyNextAction(MUSHI_CONSOLE_URL, config.sdkKeyFix) : "Run `npx mushi-mushi` in your project (signs you in and writes the key) or `mushi login`, then restart this MCP server.";
8518
8629
  server.registerTool(
8519
8630
  "diagnose_setup",
8520
8631
  {
@@ -8558,50 +8669,6 @@ function createSetupModeServer(config) {
8558
8669
  return server;
8559
8670
  }
8560
8671
 
8561
- // src/key-scopes.ts
8562
- async function fetchKeyScopes(opts) {
8563
- const doFetch = opts.fetch ?? fetch;
8564
- try {
8565
- const res = await doFetch(`${opts.apiEndpoint.replace(/\/+$/, "")}/v1/sync/whoami`, {
8566
- headers: {
8567
- "X-Mushi-Api-Key": opts.apiKey,
8568
- ...opts.projectId ? { "X-Mushi-Project-Id": opts.projectId } : {}
8569
- },
8570
- signal: AbortSignal.timeout(opts.timeoutMs ?? 5e3)
8571
- });
8572
- if (!res.ok) return null;
8573
- const body = await res.json();
8574
- const scopes = body?.data?.scopes;
8575
- if (!Array.isArray(scopes)) return null;
8576
- return scopes.filter((s) => typeof s === "string");
8577
- } catch {
8578
- return null;
8579
- }
8580
- }
8581
- function decideScopes(keyScopes, configured) {
8582
- if (keyScopes === null) return { kind: "serve", scopes: configured };
8583
- const granted = /* @__PURE__ */ new Set();
8584
- if (keyScopes.includes("mcp:write")) {
8585
- granted.add("mcp:read");
8586
- granted.add("mcp:write");
8587
- } else if (keyScopes.includes("mcp:read")) {
8588
- granted.add("mcp:read");
8589
- }
8590
- if (granted.size === 0) return { kind: "sdk-key", keyScopes };
8591
- return { kind: "serve", scopes: configured.filter((s) => granted.has(s)) };
8592
- }
8593
- function sdkKeyReport(keyScopes, consoleUrl) {
8594
- const held = keyScopes.length > 0 ? keyScopes.join(", ") : "none";
8595
- return [
8596
- "",
8597
- `[mushi-mcp] This API key has scopes: ${held}. It can send bug reports (the SDK key) but not read them,`,
8598
- " so the MCP tools would all be refused. Serving setup mode.",
8599
- ` Fix: mint an MCP key in the console (${consoleUrl}/mcp \u2192 "Mint mcp:read key"),`,
8600
- " or run `mushi login`, then put it in MUSHI_API_KEY for this server and restart it.",
8601
- ""
8602
- ].join("\n");
8603
- }
8604
-
8605
8672
  // src/inventory-poll.ts
8606
8673
  function startInventoryPoll(options) {
8607
8674
  const doFetch = options.fetch ?? globalThis.fetch;
@@ -8653,6 +8720,39 @@ function startInventoryPoll(options) {
8653
8720
  return { stop, settled: () => inFlight };
8654
8721
  }
8655
8722
 
8723
+ // src/stdio-args.ts
8724
+ function stdioArgsAction(argv) {
8725
+ if (argv.includes("-h") || argv.includes("--help")) return "help";
8726
+ if (argv.includes("-v") || argv.includes("--version")) return "version";
8727
+ return "serve";
8728
+ }
8729
+ function stdioUsage(version) {
8730
+ return `@mushi-mushi/mcp ${version} \u2014 Mushi Mushi MCP server (stdio)
8731
+
8732
+ Your editor starts this server; you normally do not run it by hand.
8733
+
8734
+ Set it up:
8735
+ npx mushi-mushi setup --ide cursor or --ide claude, continue, zed
8736
+
8737
+ Run it yourself (for an MCP client that takes a command):
8738
+ npx -y @mushi-mushi/mcp
8739
+
8740
+ Environment:
8741
+ MUSHI_API_KEY an MCP key (mcp:read or mcp:write). Not the SDK key (report:write).
8742
+ Unset: the key saved by \`npx mushi-mushi login\` is used.
8743
+ MUSHI_PROJECT_ID the project UUID. Unset: the saved project, or account mode.
8744
+ MUSHI_API_ENDPOINT only for self-hosting, e.g. https://xyz.supabase.co/functions/v1/api
8745
+ MUSHI_FEATURES tool groups to show, e.g. triage,qa,codebase, or all
8746
+ MUSHI_SCOPES limit the tools to these scopes, e.g. mcp:read
8747
+
8748
+ Flags:
8749
+ -h, --help show this help and exit
8750
+ -v, --version print the version and exit
8751
+
8752
+ Docs: https://kensaur.us/mushi-mushi/docs/sdks/mcp
8753
+ `;
8754
+ }
8755
+
8656
8756
  // src/optional-sentry.ts
8657
8757
  async function initOptionalSentry(env, deps) {
8658
8758
  const dsn = env.MUSHI_MCP_SENTRY_DSN?.trim();
@@ -8776,6 +8876,14 @@ function missingApiKeyReport({ env, cli, resolved }) {
8776
8876
  installStdoutGuard();
8777
8877
  var require2 = createRequire(import.meta.url);
8778
8878
  var VERSION = require2("../package.json").version;
8879
+ var ARGS_ACTION = stdioArgsAction(process.argv.slice(2));
8880
+ if (ARGS_ACTION !== "serve") {
8881
+ await new Promise((resolve) => {
8882
+ process.stdout.write(ARGS_ACTION === "help" ? stdioUsage(VERSION) : `${VERSION}
8883
+ `, () => resolve());
8884
+ });
8885
+ process.exit(0);
8886
+ }
8779
8887
  var log = createLogger2({ scope: "mushi:mcp", level: "info", destination: "stderr" });
8780
8888
  function resolveCliConfigPath() {
8781
8889
  const xdg = process.env.XDG_CONFIG_HOME;
@@ -8866,12 +8974,13 @@ async function main() {
8866
8974
  const keyScopes = await fetchKeyScopes({ apiEndpoint: API_ENDPOINT, apiKey: API_KEY, projectId: PROJECT_ID || void 0 });
8867
8975
  const decision = decideScopes(keyScopes, SCOPES);
8868
8976
  if (decision.kind === "sdk-key") {
8869
- const report = sdkKeyReport(decision.keyScopes, MUSHI_CONSOLE_URL);
8977
+ const sdkKeyFix = { projectId: PROJECT_ID || void 0, keySource: CREDENTIALS.apiKeySource };
8978
+ const report = sdkKeyReport(decision.keyScopes, MUSHI_CONSOLE_URL, sdkKeyFix);
8870
8979
  process.stderr.write(report);
8871
8980
  log.warn("The API key has no MCP scope (mcp:read / mcp:write) \u2014 serving setup mode.", {
8872
8981
  keyScopes: decision.keyScopes.join(",")
8873
8982
  });
8874
- serveUntilClosed(serveStdio(() => createSetupModeServer({ version: VERSION, missingKeyReport: report, reason: "sdk-key" }), {
8983
+ serveUntilClosed(serveStdio(() => createSetupModeServer({ version: VERSION, missingKeyReport: report, reason: "sdk-key", sdkKeyFix }), {
8875
8984
  onerror: (err) => log.error("stdio transport error", { err: String(err) })
8876
8985
  }));
8877
8986
  return;
package/dist/server.d.ts CHANGED
@@ -2,6 +2,25 @@ import { McpServer } from '@modelcontextprotocol/server';
2
2
  import { McpScope } from './catalog.js';
3
3
  import { FeatureFilter } from './feature-groups.js';
4
4
 
5
+ /**
6
+ * Which tools the configured key can actually use.
7
+ *
8
+ * Two fix agents on 2026-10-09 got INSUFFICIENT_SCOPE from search_reports and
9
+ * get_report_detail: their MUSHI_API_KEY was an SDK key (report:write), which
10
+ * can send reports but not read them. Every tool was listed anyway, and
11
+ * diagnose_setup itself needs mcp:read, so nothing said what was wrong. At
12
+ * start-up the stdio server now asks /v1/sync/whoami for the key's scopes:
13
+ * with no MCP scope it serves setup mode and explains the fix; with only
14
+ * mcp:read it hides the write tools. Any failure keeps today's behaviour.
15
+ */
16
+
17
+ /** Where the SDK key came from, and the project it is for, so the fix can be one exact command. */
18
+ interface SdkKeyFixContext {
19
+ projectId?: string;
20
+ /** `env`: MUSHI_API_KEY in this server's env block. `cli-config`: the key saved by the CLI. */
21
+ keySource?: 'env' | 'cli-config' | '';
22
+ }
23
+
5
24
  /**
6
25
  * FILE: packages/mcp/src/server.ts
7
26
  * PURPOSE: Testable MCP server factory. Exports `createMushiServer()` which
@@ -72,6 +91,8 @@ interface SetupModeServerConfig {
72
91
  * key without mcp:read or mcp:write, such as the report:write SDK key.
73
92
  */
74
93
  reason?: 'missing-key' | 'sdk-key';
94
+ /** For `sdk-key`: the project and key source, so the fix is one exact command. */
95
+ sdkKeyFix?: SdkKeyFixContext;
75
96
  fetch?: typeof fetch;
76
97
  timeoutMs?: number;
77
98
  }
package/dist/server.js CHANGED
@@ -404,6 +404,15 @@ var MUSHI_DOCS_INDEX = [
404
404
  headings: ["First run: two screens", "Name your project", "See your first diagnosis", "Full checklist", "After you create a project", "Generate an API key", "Test the connection", "Install the SDK"],
405
405
  excerpt: "Get your first bug report into Mushi Mushi with the console's Set up page, from naming your project to a report with a plain-English diagnosis."
406
406
  },
407
+ {
408
+ title: "Ops",
409
+ url: docUrl("/admin/ops"),
410
+ route: "/admin/ops",
411
+ markdown: "admin/ops.md",
412
+ keywords: ["admin", "ops"],
413
+ headings: [],
414
+ excerpt: "The Ops page in Mushi Mushi shows every app's payments, releases and alerts in one feed, which app is not reporting, and what is still open."
415
+ },
407
416
  {
408
417
  title: "Overview (Home view)",
409
418
  url: docUrl("/admin/overview"),
@@ -449,6 +458,15 @@ var MUSHI_DOCS_INDEX = [
449
458
  headings: ["The 4-step workflow", "Summary tiles", "Steps", "Prompt table columns", "Actions per row", "Common tasks", "Fixing wrong component classification", "Investigating a bad judge score"],
450
459
  excerpt: "The AI prompts page in the Mushi Mushi console lets you edit and A/B compare the prompts behind each AI step before you promote a new version."
451
460
  },
461
+ {
462
+ title: "Providers & AI routes",
463
+ url: docUrl("/admin/providers"),
464
+ route: "/admin/providers",
465
+ markdown: "admin/providers.md",
466
+ keywords: ["admin", "providers", "ai", "routes"],
467
+ headings: [],
468
+ excerpt: "Operator-only page in the Mushi Mushi console showing each app's AI provider accounts, their health and spend, and the ordered model routes each app tries."
469
+ },
452
470
  {
453
471
  title: "Scheduled tests",
454
472
  url: docUrl("/admin/qa-coverage"),
@@ -717,7 +735,7 @@ var MUSHI_DOCS_INDEX = [
717
735
  markdown: "cloud.md",
718
736
  keywords: ["cloud"],
719
737
  headings: ["Plans", "Sign-up flow", "Why metered on diagnoses", "Spend controls", "Self-hosting"],
720
- excerpt: "Hosted Mushi Mushi. Bug reports, plain-English diagnoses, and fix dispatch without running servers. Free for one app with 100 diagnoses a month."
738
+ excerpt: "Hosted Mushi Mushi. Bug reports, plain-English diagnoses, and fix dispatch without running servers. Free for three apps with 300 diagnoses a month."
721
739
  },
722
740
  {
723
741
  title: "Compare",
@@ -771,7 +789,7 @@ var MUSHI_DOCS_INDEX = [
771
789
  markdown: "compare/sentry-vs-mushi.md",
772
790
  keywords: ["compare", "sentry-vs-mushi", "sentry"],
773
791
  headings: ["What each one is", "Side by side", "Where they overlap, and where they do not", "Running Mushi Mushi alongside Sentry [#running-mushi-alongside-sentry]", "Pick Sentry if", "Pick Mushi Mushi if [#pick-mushi-if]", "Frequently asked questions"],
774
- excerpt: "Sentry vs Mushi Mushi in 2026. What each captures, Sentry's free tier and Seer pricing next to Mushi Mushi's free plan (1 app, 100 diagnoses), and running both."
792
+ excerpt: "Sentry vs Mushi Mushi in 2026. What each captures, Sentry's free tier and Seer pricing beside Mushi Mushi's free plan (3 apps, 300 diagnoses), and running both."
775
793
  },
776
794
  {
777
795
  title: "Concepts",
@@ -1034,6 +1052,15 @@ var MUSHI_DOCS_INDEX = [
1034
1052
  headings: ["Step-by-step", "Wire Cursor", "(Optional) Add the evolution-loop coding rules", "Restart Cursor", "Verify", "Available tools in Cursor", "Keep lessons current", "Connecting GitHub for auto-PR"],
1035
1053
  excerpt: "Wire Mushi Mushi into Cursor with one command. Get fix context, lessons and fix dispatch right from the editor."
1036
1054
  },
1055
+ {
1056
+ title: "Ops hub (payments, releases and alerts in your team's Slack)",
1057
+ url: docUrl("/integrations/ops-hub"),
1058
+ route: "/integrations/ops-hub",
1059
+ markdown: "integrations/ops-hub.md",
1060
+ keywords: ["integrations", "ops-hub", "ops", "hub", "payments", "releases", "alerts", "team", "slack"],
1061
+ headings: ["What you get", "Slack bot", "Create a Slack app", "Point Slack at Mushi Mushi", "Save the token and the signing secret", "Pick the channels", "Connect an app", "Create the app's ops key"],
1062
+ excerpt: "Every app sends payments, releases and alerts to Mushi Mushi with one server key; your team's own Slack bot posts them, threads follow-ups and answers commands."
1063
+ },
1037
1064
  {
1038
1065
  title: "Voice intake",
1039
1066
  url: docUrl("/integrations/voice-intake"),
@@ -1050,7 +1077,7 @@ var MUSHI_DOCS_INDEX = [
1050
1077
  markdown: "ja.md",
1051
1078
  keywords: ["ja"],
1052
1079
  headings: ["\u307E\u305A\u7121\u6599\u3067\u8A66\u3059\uFF1A\u516C\u958B\u4E2D\u306E\u30B5\u30A4\u30C8\u3092\u30C1\u30A7\u30C3\u30AF", "\u3067\u304D\u308B\u3053\u3068", "\u5831\u544A\u30DC\u30BF\u30F3\u306F\u65E5\u672C\u8A9E\u3067\u8868\u793A\u3055\u308C\u307E\u3059", "\u59CB\u3081\u65B9\uFF1ALovable\u30FBBolt \u306E\u5834\u5408", "\u59CB\u3081\u65B9\uFF1ACursor\u30FBClaude Code \u306E\u5834\u5408", "\u904B\u55B6\u8005\u60C5\u5831", "\u82F1\u8A9E\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8"],
1053
- excerpt: "Mushi Mushi \u306F\u3001\u30A2\u30D7\u30EA\u306B\u300C\u554F\u984C\u3092\u5831\u544A\u300D\u30DC\u30BF\u30F3\u3092\u8FFD\u52A0\u3057\u3001\u5C4A\u3044\u305F\u4E0D\u5177\u5408\u306E\u539F\u56E0\u3068\u76F4\u3057\u65B9\u3092 AI \u304C\u8AAC\u660E\u3059\u308B\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9\u306E\u30C4\u30FC\u30EB\u3067\u3059\u3002\u7121\u6599\u30D7\u30E9\u30F3\u306F\u30A2\u30D7\u30EA 1 \u672C\u30FB\u6708 100 \u4EF6\u306E\u8A3A\u65AD\u307E\u3067\u3002"
1080
+ excerpt: "Mushi Mushi \u306F\u3001\u30A2\u30D7\u30EA\u306B\u300C\u554F\u984C\u3092\u5831\u544A\u300D\u30DC\u30BF\u30F3\u3092\u8FFD\u52A0\u3057\u3001\u5C4A\u3044\u305F\u4E0D\u5177\u5408\u306E\u539F\u56E0\u3068\u76F4\u3057\u65B9\u3092 AI \u304C\u8AAC\u660E\u3059\u308B\u30AA\u30FC\u30D7\u30F3\u30BD\u30FC\u30B9\u306E\u30C4\u30FC\u30EB\u3067\u3059\u3002\u7121\u6599\u30D7\u30E9\u30F3\u306F\u30A2\u30D7\u30EA 3 \u672C\u30FB\u6708 300 \u4EF6\u306E\u8A3A\u65AD\u307E\u3067\u3002"
1054
1081
  },
1055
1082
  {
1056
1083
  title: "Launch Week",
@@ -1446,7 +1473,7 @@ var MUSHI_DOCS_INDEX = [
1446
1473
  markdown: "pricing.md",
1447
1474
  keywords: ["pricing", "free", "builder", "studio", "self-host"],
1448
1475
  headings: ["All plans", "What counts as a diagnosis", "Pricing estimator", "Example bills", "Why apps, not reports?", "Why diagnoses, not events", "Your own AI key and the self-host path", "Compared to Sentry + Seer"],
1449
- excerpt: "Mushi Mushi pricing. Free for one app and 100 AI bug diagnoses a month. Builder $29/mo for 3 apps, Studio $79/mo for 10. Free to self-host."
1476
+ excerpt: "Mushi Mushi pricing. Free for three apps and 300 AI bug diagnoses a month. Builder $29/mo for 1,000 diagnoses, Studio $79/mo for 10 apps. Free to self-host."
1450
1477
  },
1451
1478
  {
1452
1479
  title: "Quickstart: install, first report, first fix",
@@ -1475,6 +1502,15 @@ var MUSHI_DOCS_INDEX = [
1475
1502
  headings: ["Get your project ID and API key", "Install and register"],
1476
1503
  excerpt: "Free, open-source bug report widget for Angular 17+: one provideMushi() call registers the service and error handler, so errors and reports reach your queue."
1477
1504
  },
1505
+ {
1506
+ title: "Ask Bolt why it broke",
1507
+ url: docUrl("/quickstart/bolt-mcp"),
1508
+ route: "/quickstart/bolt-mcp",
1509
+ markdown: "quickstart/bolt-mcp.md",
1510
+ keywords: ["quickstart", "bolt-mcp", "bolt", "mcp", "ask", "broke"],
1511
+ headings: ["Open your connectors", "Add Mushi Mushi as a custom MCP server", "Sign in and approve", "Turn it on in your project", "Ask Bolt", "Which tools Bolt gets", "If it does not connect"],
1512
+ excerpt: "Add Mushi Mushi to Bolt as a custom MCP connector, sign in once, and ask Bolt what users reported. Bolt reads the plain-English diagnosis and fixes the bug."
1513
+ },
1478
1514
  {
1479
1515
  title: "Bug report widget for Capacitor and Ionic",
1480
1516
  url: docUrl("/quickstart/capacitor"),
@@ -1502,6 +1538,15 @@ var MUSHI_DOCS_INDEX = [
1502
1538
  headings: ["Get your project ID and API key", "Install", "Initialize", "Open the widget or submit a report"],
1503
1539
  excerpt: "Free, open-source bug report widget for Flutter (preview): shake-to-report, a Material bottom sheet and an offline queue. A git dependency, not on pub.dev yet."
1504
1540
  },
1541
+ {
1542
+ title: "HTTP API: file a bug report with one curl",
1543
+ url: docUrl("/quickstart/http-api"),
1544
+ route: "/quickstart/http-api",
1545
+ markdown: "quickstart/http-api.md",
1546
+ keywords: ["quickstart", "http-api", "http", "api", "file", "bug", "report", "one", "curl"],
1547
+ headings: ["Get your project ID and key", "Send a report", "Check it", "The fields", "Keys and scopes", "Rate limits", "More than one report", "OpenAPI spec"],
1548
+ excerpt: "Send a bug report to Mushi Mushi with one HTTP call, no SDK. How to get a key, the scopes, the rate limits, and the OpenAPI 3.1 spec for code generators."
1549
+ },
1505
1550
  {
1506
1551
  title: "Incident loop: from bug report to fix prompt",
1507
1552
  url: docUrl("/quickstart/incident-loop"),
@@ -1574,6 +1619,15 @@ var MUSHI_DOCS_INDEX = [
1574
1619
  headings: ["Get your project ID and API key", "1. Install", "2. Mount the provider", "Optional native modules", "3. Verify"],
1575
1620
  excerpt: "Free, open-source bug report widget for React Native and Expo: shake to report, a floating bug button, then a plain-English diagnosis of each report."
1576
1621
  },
1622
+ {
1623
+ title: "Mushi Mushi in Replit",
1624
+ url: docUrl("/quickstart/replit"),
1625
+ route: "/quickstart/replit",
1626
+ markdown: "quickstart/replit.md",
1627
+ keywords: ["quickstart", "replit"],
1628
+ headings: ["Add the report button", "Connect Replit Agent", "Add the server", "Sign in and approve", "Ask Agent", "If it does not connect"],
1629
+ excerpt: "Add the Mushi Mushi report button to a Replit app with one prompt, then connect Replit Agent over MCP so it reads the plain-English diagnosis and fixes the bug."
1630
+ },
1577
1631
  {
1578
1632
  title: "Bug report widget for Svelte and SvelteKit",
1579
1633
  url: docUrl("/quickstart/svelte"),
@@ -1859,7 +1913,7 @@ var MUSHI_DOCS_INDEX = [
1859
1913
  route: "/sdks/react-native",
1860
1914
  markdown: "sdks/react-native.md",
1861
1915
  keywords: ["sdks", "react-native", "react", "native", "@mushi-mushi/react-native"],
1862
- headings: ["Install", "Mount the provider", "Submit a report from a screen", "Offline queue", "What gets captured (v0.19+)", "Screenshots (react-native-view-shot)", "Theming the report sheet", "Manual breadcrumbs"],
1916
+ headings: ["Install", "Mount the provider", "Submit a report from a screen", "Offline queue", "What gets captured (v0.19+)", "Screenshots (react-native-view-shot)", "Theming the report sheet", "Diagnostics at send time"],
1863
1917
  excerpt: "Reference for @mushi-mushi/react-native, Mushi Mushi for React Native and Expo. MushiProvider, hooks, shake-to-report, screenshots, identity and offline queue."
1864
1918
  },
1865
1919
  {
@@ -1922,7 +1976,7 @@ var MUSHI_DOCS_INDEX = [
1922
1976
  route: "/sdks/web",
1923
1977
  markdown: "sdks/web.md",
1924
1978
  keywords: ["sdks", "web", "javascript", "bug", "reporting", "sdk", "browser", "mushi-mushi"],
1925
- headings: ["Sampling & beforeSend", "Screenshot preview & consent (1.19+)", "Runtime config merge (Jul 2026+)", "Capture availability & errors", "Description draft persistence", "Identifying users & the Rewards program", "Enabling the Rewards program", "Querying points & tier"],
1979
+ headings: ["Sampling & beforeSend", "Screenshot preview & consent (1.19+)", "Runtime config merge (Jul 2026+)", "Diagnostics at send time", "Capture availability & errors", "Description draft persistence", "Identifying users & the Rewards program", "Enabling the Rewards program"],
1926
1980
  excerpt: "Reference for mushi-mushi, the Mushi Mushi browser SDK. Screenshots, console and network capture, the Shadow DOM widget, sampling, beforeSend and privacy."
1927
1981
  },
1928
1982
  {
@@ -1994,8 +2048,8 @@ var MUSHI_DOCS_INDEX = [
1994
2048
  route: "/self-hosting",
1995
2049
  markdown: "self-hosting/index.md",
1996
2050
  keywords: ["self-hosting", "self", "hosting"],
1997
- headings: ["What you'll deploy", "Fastest path \u2014 Docker Compose", "Managed-Supabase path"],
1998
- excerpt: "Run the whole Mushi Mushi stack yourself with Docker Compose. Your own keys, AGPLv3 server, MIT SDKs, no usage limits."
2051
+ headings: ["What you'll deploy", "Quickstart: your own Supabase project", "Docker Compose (experimental)"],
2052
+ excerpt: "Run Mushi Mushi on your own Supabase project with one command, mushi selfhost up. Your own keys, AGPLv3 server, MIT SDKs, no usage limits."
1999
2053
  },
2000
2054
  {
2001
2055
  title: "Admin SPA deploy",
@@ -2007,13 +2061,13 @@ var MUSHI_DOCS_INDEX = [
2007
2061
  excerpt: "Build and deploy the Mushi Mushi admin console yourself. A static Vite and React app that talks to your Supabase project, and the env vars it needs."
2008
2062
  },
2009
2063
  {
2010
- title: "Self-host in minutes (Docker Compose)",
2064
+ title: "Docker Compose (experimental)",
2011
2065
  url: docUrl("/self-hosting/docker-compose"),
2012
2066
  route: "/self-hosting/docker-compose",
2013
2067
  markdown: "self-hosting/docker-compose.md",
2014
- keywords: ["self-hosting", "self", "hosting", "docker-compose", "docker", "compose", "self-host", "minutes"],
2015
- headings: ["One command", "Clone and configure", "Bring the stack up", "Open the console", "What's running", "Production notes", "Managed Supabase instead"],
2016
- excerpt: "Self-host the whole Mushi Mushi stack with one Docker Compose file. Postgres, auth, storage, edge functions, the admin console and a Caddy reverse proxy."
2068
+ keywords: ["self-hosting", "self", "hosting", "docker-compose", "docker", "compose", "experimental"],
2069
+ headings: ["Generate the secrets", "Bring the stack up", "Open the console", "What's running", "Not included", "Production notes"],
2070
+ excerpt: "Run the whole Mushi Mushi stack in Docker Compose with no Supabase account. Experimental. Postgres, auth, storage, every edge function, the console and Caddy."
2017
2071
  },
2018
2072
  {
2019
2073
  title: "Edge Functions deploy",
@@ -2039,7 +2093,7 @@ var MUSHI_DOCS_INDEX = [
2039
2093
  route: "/self-hosting/supabase",
2040
2094
  markdown: "self-hosting/supabase.md",
2041
2095
  keywords: ["self-hosting", "self", "hosting", "supabase", "setup"],
2042
- headings: ["Required extensions", "Required custom functions", "RLS pattern", "Seed data", "Verifying the setup"],
2096
+ headings: ["Required extensions", "Required custom functions", "RLS pattern", "Seed data and runtime config", "Verifying the setup"],
2043
2097
  excerpt: "Set up a Supabase project for self-hosted Mushi Mushi. Link the CLI, push every migration, and check the Postgres extensions the server needs."
2044
2098
  },
2045
2099
  {
@@ -2282,6 +2336,16 @@ function safeStringify(value) {
2282
2336
  }
2283
2337
  }
2284
2338
 
2339
+ // src/key-scopes.ts
2340
+ function mcpKeyLoginCommand(projectId) {
2341
+ return `npx mushi-mushi login${projectId ? ` --project-id ${projectId}` : ""}`;
2342
+ }
2343
+ function sdkKeyNextAction(consoleUrl, ctx = {}) {
2344
+ const command = mcpKeyLoginCommand(ctx.projectId);
2345
+ const then = ctx.keySource === "env" ? "then remove MUSHI_API_KEY from this server's env block (the server then uses the saved key) and restart it." : "then restart this server.";
2346
+ return `Run \`${command}\` (approve in the browser; it saves a key that can read reports), ${then} Or mint an MCP key in the console (${consoleUrl}/mcp \u2192 "Mint mcp:read key") and put it in MUSHI_API_KEY.`;
2347
+ }
2348
+
2285
2349
  // src/arg-aliases.ts
2286
2350
  function snakeAliasOf(name) {
2287
2351
  return name.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
@@ -6995,7 +7059,7 @@ function createSetupModeServer(config) {
6995
7059
  features: "all",
6996
7060
  ...config.fetch ? { fetch: config.fetch } : {},
6997
7061
  ...config.timeoutMs ? { timeoutMs: config.timeoutMs } : {},
6998
- instructions: config.reason === "sdk-key" ? "Mushi is running in setup mode: the configured API key is an SDK key (report:write). It can send bug reports but not read them, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for how to mint an MCP key (mcp:read), then restart the MCP server." : "Mushi is running in setup mode: no API key is configured, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for the exact steps to connect (run `npx mushi-mushi` or `mushi login`, or put MUSHI_API_KEY in this server's env block), then restart the MCP server."
7062
+ instructions: config.reason === "sdk-key" ? "Mushi is running in setup mode: the configured API key is an SDK key (report:write). It can send bug reports but not read them, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Fix: " + sdkKeyNextAction(MUSHI_CONSOLE_URL, config.sdkKeyFix) : "Mushi is running in setup mode: no API key is configured, so only search_mushi_docs, get_mushi_doc and diagnose_setup work. Call diagnose_setup for the exact steps to connect (run `npx mushi-mushi` or `mushi login`, or put MUSHI_API_KEY in this server's env block), then restart the MCP server."
6999
7063
  });
7000
7064
  const internals = server;
7001
7065
  for (const [name, tool] of Object.entries(internals._registeredTools)) {
@@ -7011,7 +7075,7 @@ function createSetupModeServer(config) {
7011
7075
  const spec = TOOL_CATALOG.find((t) => t.name === "diagnose_setup");
7012
7076
  if (!spec) throw new Error("[mushi-mcp] diagnose_setup is missing from TOOL_CATALOG");
7013
7077
  const sdkKey = config.reason === "sdk-key";
7014
- const nextAction = sdkKey ? `Mint an MCP key in the console (${MUSHI_CONSOLE_URL}/mcp \u2192 "Mint mcp:read key") or run \`mushi login\`, put it in MUSHI_API_KEY for this server, then restart it.` : "Run `npx mushi-mushi` in your project (signs you in and writes the key) or `mushi login`, then restart this MCP server.";
7078
+ const nextAction = sdkKey ? sdkKeyNextAction(MUSHI_CONSOLE_URL, config.sdkKeyFix) : "Run `npx mushi-mushi` in your project (signs you in and writes the key) or `mushi login`, then restart this MCP server.";
7015
7079
  server.registerTool(
7016
7080
  "diagnose_setup",
7017
7081
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mushi-mushi/mcp",
3
3
  "mcpName": "io.github.kensaurus/mushi-mushi",
4
- "version": "0.31.3",
4
+ "version": "0.31.5",
5
5
  "license": "MIT",
6
6
  "description": "MCP server for Cursor, Claude Code and Copilot. One place to improve AI-built apps: fix bugs, smooth user journeys and clean up the code.",
7
7
  "type": "module",
@@ -45,7 +45,7 @@
45
45
  "@modelcontextprotocol/core": "^2.3.1",
46
46
  "@modelcontextprotocol/server": "^2.3.1",
47
47
  "zod": "^4.6.7",
48
- "@mushi-mushi/core": "^1.35.0"
48
+ "@mushi-mushi/core": "^1.37.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@sentry/node": "^10.57.0"