@mushi-mushi/mcp 0.30.6 → 0.31.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 +3 -3
- package/dist/catalog.js +1 -1
- package/dist/{chunk-CS7VPIFS.js → chunk-KEMYF42N.js} +26 -1
- package/dist/{chunk-YOLJIBQR.js → chunk-SHA56ZRG.js} +4 -0
- package/dist/clients.d.ts +1 -1
- package/dist/clients.js +2 -2
- package/dist/feature-groups.js +1 -1
- package/dist/index.js +197 -5
- package/dist/server.js +169 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mushi-mushi/mcp
|
|
2
2
|
|
|
3
|
-
> **Your AI
|
|
3
|
+
> **Your AI built it. Mushi Mushi makes it better.**
|
|
4
4
|
|
|
5
5
|
[](https://kensaur.us/mushi-mushi/docs/connect)
|
|
6
6
|
[](https://kensaur.us/mushi-mushi/docs/connect)
|
|
@@ -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.
|
|
34
|
+
"args": ["-y", "@mushi-mushi/mcp@0.31.0"],
|
|
35
35
|
"env": {
|
|
36
36
|
"MUSHI_API_KEY": "mushi_xxxxxxxxxxxxxxxxxxxx",
|
|
37
37
|
"MUSHI_PROJECT_ID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
|
@@ -61,7 +61,7 @@ Claude Desktop does not expand `${VAR}` references in this file; Cursor and VS C
|
|
|
61
61
|
| `diagnose_setup` | Explains a broken install and the one next step |
|
|
62
62
|
| `search_mushi_docs` | Answers setup and API questions from the docs |
|
|
63
63
|
|
|
64
|
-
The full catalog has
|
|
64
|
+
The full catalog has 133 tools, plus 8 resources (`project://dashboard`, `project://stats`, …) and 4 prompts (`summarize_report_for_fix`, `triage_next_steps`, …). Every tool carries read-only and destructive hints, so your editor can ask before it changes anything. Full list: [MCP tool reference](https://kensaur.us/mushi-mushi/docs/sdks/mcp-tools).
|
|
65
65
|
|
|
66
66
|
**Tool groups.** New installs get a lean default: `triage`, `fixes`, `inventory`, `setup`, `docs`. Turn on more with `MUSHI_FEATURES=triage,qa,codebase` (stdio) or `?features=…` on the hosted URL, or everything with `all`. Groups: `qa`, `skills`, `codebase`, `rewards`, `admin`, `audit`, `usage`. For a chat tool such as Lovable, or an editor that caps how many tools it loads, `vibe` gives about a dozen tools for the core loop. Add `?read_only=1` to the hosted URL to hide every write tool.
|
|
67
67
|
|
package/dist/catalog.js
CHANGED
|
@@ -788,6 +788,31 @@ var TOOL_CATALOG = [
|
|
|
788
788
|
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
789
789
|
returnsUntrusted: true,
|
|
790
790
|
useCase: "What do users do right after they mint an API key?"
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: "get_journeys",
|
|
794
|
+
title: "User journeys and where people get stuck",
|
|
795
|
+
description: "Where do people get stuck in the app, and what should change? Reads the Journey optimizer for one project: page-to-page moves from real visits over the last days (7, 30 default, or 90) joined with the latest site scan's links. Returns { days, liveUrl, score (0-100, 100 = no findings), rootPath, stats: { sessions, pageViews, pages, avgPagesPerSession, bounceRate, sampled }, scan, mapScan, recording ({ until, sampleRate } of the on-demand visit recording; until null = off), flows (top 10 common paths), findingsTotal, findingsByKind, findings: [{ id, kind, severity, pages, title, detail, suggestion, prompt }], next }. Kinds: broken, dead_end, high_exit, loop, reload, duplicate_page, route_variant, duplicate_title, orphan, deep_page, unvisited. Each finding's prompt is a ready instruction for a coding agent in the app's repo. Optional kind filters the findings, limit caps them (default 20, max 100), includeGraph adds the page nodes and edges (large). Read-only. With no scan yet, call scan_site_journeys first; for event-level funnels use query_funnel or get_user_paths.",
|
|
796
|
+
scope: "mcp:read",
|
|
797
|
+
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
798
|
+
returnsUntrusted: true,
|
|
799
|
+
useCase: "Where do people get stuck in my app, and what should I change?"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
name: "scan_site_journeys",
|
|
803
|
+
title: "Scan the live site for the journey map",
|
|
804
|
+
description: "Start a site scan for the Journey optimizer: Firecrawl maps the live site and reads up to 40 pages (no LLM), keeping each page's title, internal links and a content fingerprint, so get_journeys can find orphan, duplicate and deep pages. Optional baseUrl (the public https:// address; defaults to the one Mushi Mushi already knows) and projectId. Firecrawl reads the pages on its side, usually within a few minutes; each get_journeys call moves the scan on, so call it again in about two minutes. Returns { scan: { id, status, baseUrl, pageCount, error, createdAt, finishedAt }, next }. One scan at a time per app (409 SCAN_RUNNING) and at most one every 10 minutes (429 SCAN_TOO_SOON); NO_LIVE_URL when no address is known, UNSAFE_URL for a private address; viewers cannot scan. Uses the project's Firecrawl key. Write: it stores a scan; nothing in the app or repo changes.",
|
|
805
|
+
scope: "mcp:write",
|
|
806
|
+
hints: { readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
807
|
+
useCase: "I just shipped new pages: map the site again."
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
name: "record_journeys",
|
|
811
|
+
title: "Record visits for the journey map",
|
|
812
|
+
description: "Open, extend or stop the on-demand visit recording window for the Journey optimizer. Apps whose Mushi Mushi SDK runs trackSessions: 'on-demand' send no visits until a window is open; then that share of visitors is recorded until it ends (apps on the default trackSessions: true always record). hours is 1 to 168 from now, or 0 to stop; optional sampleRate is the share of visitors, above 0 and at most 1 (0.1 = one in ten; unset keeps the current share, 0.1 by default), and projectId. Returns { recording: { until, sampleRate }, next } (until null = off). Calling it again replaces the window. Viewers cannot record. Write: it changes the app's recording setting; nothing in the repo changes. Read the results with get_journeys.",
|
|
813
|
+
scope: "mcp:write",
|
|
814
|
+
hints: { readOnly: false, destructive: false, idempotent: true, openWorld: true },
|
|
815
|
+
useCase: "Record one in ten visitors for the next day so I can see where people get stuck."
|
|
791
816
|
}
|
|
792
817
|
];
|
|
793
818
|
var RESOURCE_CATALOG = [
|
|
@@ -1048,7 +1073,7 @@ var TDD_TOOL_CATALOG = [
|
|
|
1048
1073
|
{
|
|
1049
1074
|
name: "get_usage",
|
|
1050
1075
|
title: "Usage & billing summary",
|
|
1051
|
-
description: 'Read-only diagnoses quota and billing summary for the current project: diagnoses used / limit / percentage, spend cap, period start/end, plan name, and whether the
|
|
1076
|
+
description: 'Read-only diagnoses quota and billing summary for the team that owns the current project (a plan belongs to the team, so diagnoses are counted across every app in it): diagnoses used / limit / percentage, spend cap, period start/end, plan name, and whether the team is approaching or over its quota. Use this to answer "how many diagnoses do I have left?" or "am I close to my spend cap?".',
|
|
1052
1077
|
scope: "mcp:read",
|
|
1053
1078
|
hints: { readOnly: true, idempotent: true, openWorld: false },
|
|
1054
1079
|
useCase: "How many diagnoses do I have left this month?"
|
|
@@ -53,6 +53,10 @@ var TOOL_FEATURE_MAP = {
|
|
|
53
53
|
suggest_fix: "triage",
|
|
54
54
|
get_graph_neighborhood: "triage",
|
|
55
55
|
get_graph_node: "triage",
|
|
56
|
+
// Journey optimizer (ADR 0058): where people get stuck, with fix prompts.
|
|
57
|
+
get_journeys: "triage",
|
|
58
|
+
scan_site_journeys: "triage",
|
|
59
|
+
record_journeys: "triage",
|
|
56
60
|
// inventory
|
|
57
61
|
get_inventory: "inventory",
|
|
58
62
|
diff_inventory: "inventory",
|
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.
|
|
57
|
+
declare const MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.0";
|
|
58
58
|
interface StdioConfig {
|
|
59
59
|
command: string;
|
|
60
60
|
args: string[];
|
package/dist/clients.js
CHANGED
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
DEFAULT_FEATURE_GROUPS,
|
|
6
6
|
appendFeaturesToUrl,
|
|
7
7
|
featuresQueryString
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SHA56ZRG.js";
|
|
9
9
|
|
|
10
10
|
// src/clients.ts
|
|
11
|
-
var MCP_PIN_SPEC = "@mushi-mushi/mcp@0.
|
|
11
|
+
var MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.0";
|
|
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/feature-groups.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -864,6 +864,31 @@ var TOOL_CATALOG = [
|
|
|
864
864
|
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
865
865
|
returnsUntrusted: true,
|
|
866
866
|
useCase: "What do users do right after they mint an API key?"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
name: "get_journeys",
|
|
870
|
+
title: "User journeys and where people get stuck",
|
|
871
|
+
description: "Where do people get stuck in the app, and what should change? Reads the Journey optimizer for one project: page-to-page moves from real visits over the last days (7, 30 default, or 90) joined with the latest site scan's links. Returns { days, liveUrl, score (0-100, 100 = no findings), rootPath, stats: { sessions, pageViews, pages, avgPagesPerSession, bounceRate, sampled }, scan, mapScan, recording ({ until, sampleRate } of the on-demand visit recording; until null = off), flows (top 10 common paths), findingsTotal, findingsByKind, findings: [{ id, kind, severity, pages, title, detail, suggestion, prompt }], next }. Kinds: broken, dead_end, high_exit, loop, reload, duplicate_page, route_variant, duplicate_title, orphan, deep_page, unvisited. Each finding's prompt is a ready instruction for a coding agent in the app's repo. Optional kind filters the findings, limit caps them (default 20, max 100), includeGraph adds the page nodes and edges (large). Read-only. With no scan yet, call scan_site_journeys first; for event-level funnels use query_funnel or get_user_paths.",
|
|
872
|
+
scope: "mcp:read",
|
|
873
|
+
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
874
|
+
returnsUntrusted: true,
|
|
875
|
+
useCase: "Where do people get stuck in my app, and what should I change?"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "scan_site_journeys",
|
|
879
|
+
title: "Scan the live site for the journey map",
|
|
880
|
+
description: "Start a site scan for the Journey optimizer: Firecrawl maps the live site and reads up to 40 pages (no LLM), keeping each page's title, internal links and a content fingerprint, so get_journeys can find orphan, duplicate and deep pages. Optional baseUrl (the public https:// address; defaults to the one Mushi Mushi already knows) and projectId. Firecrawl reads the pages on its side, usually within a few minutes; each get_journeys call moves the scan on, so call it again in about two minutes. Returns { scan: { id, status, baseUrl, pageCount, error, createdAt, finishedAt }, next }. One scan at a time per app (409 SCAN_RUNNING) and at most one every 10 minutes (429 SCAN_TOO_SOON); NO_LIVE_URL when no address is known, UNSAFE_URL for a private address; viewers cannot scan. Uses the project's Firecrawl key. Write: it stores a scan; nothing in the app or repo changes.",
|
|
881
|
+
scope: "mcp:write",
|
|
882
|
+
hints: { readOnly: false, destructive: false, idempotent: false, openWorld: true },
|
|
883
|
+
useCase: "I just shipped new pages: map the site again."
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "record_journeys",
|
|
887
|
+
title: "Record visits for the journey map",
|
|
888
|
+
description: "Open, extend or stop the on-demand visit recording window for the Journey optimizer. Apps whose Mushi Mushi SDK runs trackSessions: 'on-demand' send no visits until a window is open; then that share of visitors is recorded until it ends (apps on the default trackSessions: true always record). hours is 1 to 168 from now, or 0 to stop; optional sampleRate is the share of visitors, above 0 and at most 1 (0.1 = one in ten; unset keeps the current share, 0.1 by default), and projectId. Returns { recording: { until, sampleRate }, next } (until null = off). Calling it again replaces the window. Viewers cannot record. Write: it changes the app's recording setting; nothing in the repo changes. Read the results with get_journeys.",
|
|
889
|
+
scope: "mcp:write",
|
|
890
|
+
hints: { readOnly: false, destructive: false, idempotent: true, openWorld: true },
|
|
891
|
+
useCase: "Record one in ten visitors for the next day so I can see where people get stuck."
|
|
867
892
|
}
|
|
868
893
|
];
|
|
869
894
|
var TDD_TOOL_CATALOG = [
|
|
@@ -1040,7 +1065,7 @@ var TDD_TOOL_CATALOG = [
|
|
|
1040
1065
|
{
|
|
1041
1066
|
name: "get_usage",
|
|
1042
1067
|
title: "Usage & billing summary",
|
|
1043
|
-
description: 'Read-only diagnoses quota and billing summary for the current project: diagnoses used / limit / percentage, spend cap, period start/end, plan name, and whether the
|
|
1068
|
+
description: 'Read-only diagnoses quota and billing summary for the team that owns the current project (a plan belongs to the team, so diagnoses are counted across every app in it): diagnoses used / limit / percentage, spend cap, period start/end, plan name, and whether the team is approaching or over its quota. Use this to answer "how many diagnoses do I have left?" or "am I close to my spend cap?".',
|
|
1044
1069
|
scope: "mcp:read",
|
|
1045
1070
|
hints: { readOnly: true, idempotent: true, openWorld: false },
|
|
1046
1071
|
useCase: "How many diagnoses do I have left this month?"
|
|
@@ -1350,6 +1375,10 @@ var TOOL_FEATURE_MAP = {
|
|
|
1350
1375
|
suggest_fix: "triage",
|
|
1351
1376
|
get_graph_neighborhood: "triage",
|
|
1352
1377
|
get_graph_node: "triage",
|
|
1378
|
+
// Journey optimizer (ADR 0058): where people get stuck, with fix prompts.
|
|
1379
|
+
get_journeys: "triage",
|
|
1380
|
+
scan_site_journeys: "triage",
|
|
1381
|
+
record_journeys: "triage",
|
|
1353
1382
|
// inventory
|
|
1354
1383
|
get_inventory: "inventory",
|
|
1355
1384
|
diff_inventory: "inventory",
|
|
@@ -1567,13 +1596,13 @@ function docUrl(route) {
|
|
|
1567
1596
|
}
|
|
1568
1597
|
var MUSHI_DOCS_INDEX = [
|
|
1569
1598
|
{
|
|
1570
|
-
title: "Mushi Mushi \u2014
|
|
1599
|
+
title: "Mushi Mushi \u2014 one place to improve your AI-built app",
|
|
1571
1600
|
url: docUrl("/"),
|
|
1572
1601
|
route: "/",
|
|
1573
1602
|
markdown: "index.md",
|
|
1574
|
-
keywords: ["
|
|
1603
|
+
keywords: ["one", "place", "improve", "ai-built", "app"],
|
|
1575
1604
|
headings: ["Will my customers actually report bugs?", "See it work, on a real bug", "What it takes", "Why I built it", "What this is (and is not)"],
|
|
1576
|
-
excerpt: "Your AI
|
|
1605
|
+
excerpt: "Your AI built it. Mushi Mushi makes it better: it finds what breaks, where people get stuck and what the code needs, then hands you the fix."
|
|
1577
1606
|
},
|
|
1578
1607
|
{
|
|
1579
1608
|
title: "Mushi Mushi admin console",
|
|
@@ -1872,6 +1901,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
1872
1901
|
headings: ["Understanding the score", "Runs table", "Run detail drawer", "Score timeline", "Iterations list", "Succeeded run", "Creating a run", "Common tasks"],
|
|
1873
1902
|
excerpt: "The Improvement runs page in Mushi Mushi queues runs where one AI critiques a live URL against your goal and a second scores it, iteration by iteration."
|
|
1874
1903
|
},
|
|
1904
|
+
{
|
|
1905
|
+
title: "Journey optimizer",
|
|
1906
|
+
url: docUrl("/admin/journeys"),
|
|
1907
|
+
route: "/admin/journeys",
|
|
1908
|
+
markdown: "admin/journeys.md",
|
|
1909
|
+
keywords: ["admin", "journeys", "journey", "optimizer"],
|
|
1910
|
+
headings: ["Record visits only when you need them", "Scan your site", "Read the map", "What it finds", "Hand it to your coding agent", "Related"],
|
|
1911
|
+
excerpt: "Map how people move through your app, then fix dead ends, pages people leave, duplicate pages and pages nothing links to, with prompts for your coding agent."
|
|
1912
|
+
},
|
|
1875
1913
|
{
|
|
1876
1914
|
title: "Triage grading",
|
|
1877
1915
|
url: docUrl("/admin/judge"),
|
|
@@ -2580,7 +2618,7 @@ var MUSHI_DOCS_INDEX = [
|
|
|
2580
2618
|
route: "/ja",
|
|
2581
2619
|
markdown: "ja.md",
|
|
2582
2620
|
keywords: ["ja"],
|
|
2583
|
-
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", "\u82F1\u8A9E\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8"],
|
|
2621
|
+
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"],
|
|
2584
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"
|
|
2585
2623
|
},
|
|
2586
2624
|
{
|
|
@@ -2619,6 +2657,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
2619
2657
|
headings: ["1. Acceptance", "2. The Service", "3. Software licenses", "4. Accounts", "5. Acceptable use", "6. Your data and the license you give us", "7. Free tier", "8. Paid plans and billing"],
|
|
2620
2658
|
excerpt: "The terms for Mushi Mushi Cloud, the admin console, the SDKs and the Bounties tester marketplace. Plans, limits, AI-output disclaimer, licenses and liability."
|
|
2621
2659
|
},
|
|
2660
|
+
{
|
|
2661
|
+
title: "\u7279\u5B9A\u5546\u53D6\u5F15\u6CD5\u306B\u57FA\u3065\u304F\u8868\u8A18",
|
|
2662
|
+
url: docUrl("/legal/tokushoho"),
|
|
2663
|
+
route: "/legal/tokushoho",
|
|
2664
|
+
markdown: "legal/tokushoho.md",
|
|
2665
|
+
keywords: ["legal", "tokushoho"],
|
|
2666
|
+
headings: [],
|
|
2667
|
+
excerpt: "Mushi Mushi Cloud \u306E\u7279\u5B9A\u5546\u53D6\u5F15\u6CD5\u306B\u57FA\u3065\u304F\u8868\u8A18\u3002\u8CA9\u58F2\u4E8B\u696D\u8005\u3001\u6240\u5728\u5730\u3001\u9023\u7D61\u5148\u3001\u6599\u91D1\uFF08\u7C73\u30C9\u30EB\u5EFA\u3066\uFF09\u3001\u652F\u6255\u6642\u671F\u3001\u81EA\u52D5\u66F4\u65B0\u3068\u89E3\u7D04\u306E\u65B9\u6CD5\u3001\u8FD4\u91D1\u306E\u6271\u3044\u3092\u8A18\u8F09\u3057\u3066\u3044\u307E\u3059\u3002"
|
|
2668
|
+
},
|
|
2622
2669
|
{
|
|
2623
2670
|
title: "Migration guides",
|
|
2624
2671
|
url: docUrl("/migrations"),
|
|
@@ -4021,6 +4068,86 @@ function triageSummaryOf(report, actions) {
|
|
|
4021
4068
|
const next = actions[0] ? `Recommended: ${actions[0].action}.` : "No action required.";
|
|
4022
4069
|
return `[${severity}] ${category} \u2014 status: ${status}. ${next}`;
|
|
4023
4070
|
}
|
|
4071
|
+
var JOURNEY_FINDING_KINDS = [
|
|
4072
|
+
"broken",
|
|
4073
|
+
"dead_end",
|
|
4074
|
+
"high_exit",
|
|
4075
|
+
"loop",
|
|
4076
|
+
"reload",
|
|
4077
|
+
"duplicate_page",
|
|
4078
|
+
"route_variant",
|
|
4079
|
+
"duplicate_title",
|
|
4080
|
+
"orphan",
|
|
4081
|
+
"deep_page",
|
|
4082
|
+
"unvisited"
|
|
4083
|
+
];
|
|
4084
|
+
var JOURNEY_DAY_OPTIONS = [7, 30, 90];
|
|
4085
|
+
var JOURNEY_MAX_FLOWS = 10;
|
|
4086
|
+
var JOURNEY_DEFAULT_LIMIT = 20;
|
|
4087
|
+
var JOURNEY_MAX_LIMIT = 100;
|
|
4088
|
+
var JOURNEY_SCAN_NEXT = "Firecrawl reads the pages on its side, usually in a few minutes. Call get_journeys in about two minutes; each call moves the scan on and returns the map once it is done.";
|
|
4089
|
+
var JOURNEY_RECORDING_MAX_HOURS = 168;
|
|
4090
|
+
function journeyRecordingBodyOf(hours, sampleRate) {
|
|
4091
|
+
if (typeof hours !== "number" || !Number.isInteger(hours) || hours < 0 || hours > JOURNEY_RECORDING_MAX_HOURS) {
|
|
4092
|
+
return { ok: false, message: `hours must be a whole number from 0 (stop) to ${JOURNEY_RECORDING_MAX_HOURS}` };
|
|
4093
|
+
}
|
|
4094
|
+
if (sampleRate === void 0 || sampleRate === null) return { ok: true, body: { hours } };
|
|
4095
|
+
if (typeof sampleRate !== "number" || !(sampleRate > 0 && sampleRate <= 1)) {
|
|
4096
|
+
return { ok: false, message: "sampleRate must be above 0 and at most 1 (0.1 = one visitor in ten)" };
|
|
4097
|
+
}
|
|
4098
|
+
return { ok: true, body: { hours, sample_rate: sampleRate } };
|
|
4099
|
+
}
|
|
4100
|
+
function journeyRecordingNextOf(hours) {
|
|
4101
|
+
return hours === 0 ? "Recording is off. Apps with trackSessions: 'on-demand' send no visits until a new window opens." : "Recording is on for apps whose SDK uses trackSessions: 'on-demand'. Call get_journeys once people have used the app.";
|
|
4102
|
+
}
|
|
4103
|
+
function journeyDaysOf(days) {
|
|
4104
|
+
if (days === void 0 || days === null) return 30;
|
|
4105
|
+
return JOURNEY_DAY_OPTIONS.includes(days) ? days : null;
|
|
4106
|
+
}
|
|
4107
|
+
function journeysForAgent(data, opts = {}) {
|
|
4108
|
+
const map = data.map && typeof data.map === "object" ? data.map : {};
|
|
4109
|
+
const all = Array.isArray(map.findings) ? map.findings : [];
|
|
4110
|
+
const matching = opts.kind ? all.filter((f) => f.kind === opts.kind) : all;
|
|
4111
|
+
const rawLimit = typeof opts.limit === "number" && Number.isFinite(opts.limit) ? Math.trunc(opts.limit) : JOURNEY_DEFAULT_LIMIT;
|
|
4112
|
+
const limit = Math.min(Math.max(rawLimit, 1), JOURNEY_MAX_LIMIT);
|
|
4113
|
+
const findingsByKind = {};
|
|
4114
|
+
for (const f of all) findingsByKind[String(f.kind)] = (findingsByKind[String(f.kind)] ?? 0) + 1;
|
|
4115
|
+
const stats = map.stats && typeof map.stats === "object" ? map.stats : null;
|
|
4116
|
+
const scan = data.scan && typeof data.scan === "object" ? data.scan : null;
|
|
4117
|
+
const mapScan = data.mapScan && typeof data.mapScan === "object" ? data.mapScan : null;
|
|
4118
|
+
const findings = matching.slice(0, limit);
|
|
4119
|
+
const next = [];
|
|
4120
|
+
if (scan?.status === "running") next.push("A site scan is running. Call get_journeys again in about a minute.");
|
|
4121
|
+
else if (!mapScan) next.push("No site scan yet. Call scan_site_journeys to read the live site's links (orphan, duplicate and deep pages).");
|
|
4122
|
+
const recording = data.recording && typeof data.recording === "object" ? data.recording : null;
|
|
4123
|
+
if (stats && stats.sessions === 0) {
|
|
4124
|
+
next.push(
|
|
4125
|
+
recording && recording.until ? "No visits yet in this window. Recording is on, so visits will appear as people use the app." : "No visits in this window. Visits come from the Mushi Mushi SDK in the app; if it uses trackSessions: 'on-demand', open a recording window with record_journeys (or on the console's Journeys page)."
|
|
4126
|
+
);
|
|
4127
|
+
}
|
|
4128
|
+
if (matching.length > findings.length) next.push(`${matching.length - findings.length} more finding(s): raise limit or filter by kind.`);
|
|
4129
|
+
if (findings.length > 0) next.push("Each finding has a prompt: paste it into your coding agent in the app's repo.");
|
|
4130
|
+
const out = {
|
|
4131
|
+
days: data.days ?? null,
|
|
4132
|
+
liveUrl: data.liveUrl ?? null,
|
|
4133
|
+
score: map.score ?? null,
|
|
4134
|
+
rootPath: map.rootPath ?? null,
|
|
4135
|
+
stats,
|
|
4136
|
+
scan,
|
|
4137
|
+
mapScan,
|
|
4138
|
+
recording,
|
|
4139
|
+
flows: Array.isArray(map.flows) ? map.flows.slice(0, JOURNEY_MAX_FLOWS) : [],
|
|
4140
|
+
findingsTotal: matching.length,
|
|
4141
|
+
findingsByKind,
|
|
4142
|
+
findings,
|
|
4143
|
+
next
|
|
4144
|
+
};
|
|
4145
|
+
if (opts.includeGraph) {
|
|
4146
|
+
out.nodes = Array.isArray(map.nodes) ? map.nodes : [];
|
|
4147
|
+
out.edges = Array.isArray(map.edges) ? map.edges : [];
|
|
4148
|
+
}
|
|
4149
|
+
return out;
|
|
4150
|
+
}
|
|
4024
4151
|
|
|
4025
4152
|
// src/server.ts
|
|
4026
4153
|
installStdoutGuard();
|
|
@@ -7131,6 +7258,71 @@ function createMushiServer(config) {
|
|
|
7131
7258
|
return jsonResult(await apiCall(`/v1/admin/events/paths?${qs}`));
|
|
7132
7259
|
}
|
|
7133
7260
|
);
|
|
7261
|
+
server.registerTool(
|
|
7262
|
+
"get_journeys",
|
|
7263
|
+
{
|
|
7264
|
+
title: titleOf("get_journeys"),
|
|
7265
|
+
description: descOf("get_journeys"),
|
|
7266
|
+
annotations: annotationsFor("get_journeys"),
|
|
7267
|
+
inputSchema: z.object({
|
|
7268
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
7269
|
+
days: z.number().int().min(7).max(90).optional().describe("Window of visits: 7, 30 (default) or 90 days"),
|
|
7270
|
+
kind: z.enum(JOURNEY_FINDING_KINDS).optional().describe("Only findings of this kind"),
|
|
7271
|
+
limit: z.number().int().min(1).max(JOURNEY_MAX_LIMIT).optional().describe("Most findings to return (default 20, max 100)"),
|
|
7272
|
+
includeGraph: z.boolean().optional().describe("Also return the page nodes and page-to-page edges (up to 60 and 160 rows)")
|
|
7273
|
+
})
|
|
7274
|
+
},
|
|
7275
|
+
async (args) => {
|
|
7276
|
+
const days = journeyDaysOf(args.days);
|
|
7277
|
+
if (days === null) throw new MushiApiError(400, "INVALID_DAYS", "days must be 7, 30 or 90.");
|
|
7278
|
+
const pid = await resolveProjectId(args.projectId);
|
|
7279
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys?days=${days}`);
|
|
7280
|
+
return jsonText(journeysForAgent(data, { kind: args.kind, limit: args.limit, includeGraph: args.includeGraph }));
|
|
7281
|
+
}
|
|
7282
|
+
);
|
|
7283
|
+
server.registerTool(
|
|
7284
|
+
"scan_site_journeys",
|
|
7285
|
+
{
|
|
7286
|
+
title: titleOf("scan_site_journeys"),
|
|
7287
|
+
description: descOf("scan_site_journeys"),
|
|
7288
|
+
annotations: annotationsFor("scan_site_journeys"),
|
|
7289
|
+
inputSchema: z.object({
|
|
7290
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
7291
|
+
baseUrl: z.string().optional().describe("The site's public https:// address; defaults to the one Mushi Mushi already knows")
|
|
7292
|
+
})
|
|
7293
|
+
},
|
|
7294
|
+
async (args) => {
|
|
7295
|
+
const pid = await resolveProjectId(args.projectId);
|
|
7296
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys/scan`, {
|
|
7297
|
+
method: "POST",
|
|
7298
|
+
body: JSON.stringify(args.baseUrl ? { base_url: args.baseUrl } : {})
|
|
7299
|
+
});
|
|
7300
|
+
return jsonText({ ...data, next: JOURNEY_SCAN_NEXT });
|
|
7301
|
+
}
|
|
7302
|
+
);
|
|
7303
|
+
server.registerTool(
|
|
7304
|
+
"record_journeys",
|
|
7305
|
+
{
|
|
7306
|
+
title: titleOf("record_journeys"),
|
|
7307
|
+
description: descOf("record_journeys"),
|
|
7308
|
+
annotations: annotationsFor("record_journeys"),
|
|
7309
|
+
inputSchema: z.object({
|
|
7310
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
7311
|
+
hours: z.number().int().min(0).max(JOURNEY_RECORDING_MAX_HOURS).describe("Hours to record from now (1-168), or 0 to stop"),
|
|
7312
|
+
sampleRate: z.number().max(1).optional().describe("Share of visitors to record, above 0 and at most 1 (0.1 = one in ten)")
|
|
7313
|
+
})
|
|
7314
|
+
},
|
|
7315
|
+
async (args) => {
|
|
7316
|
+
const checked = journeyRecordingBodyOf(args.hours, args.sampleRate);
|
|
7317
|
+
if (!checked.ok) throw new MushiApiError(400, "INVALID_PARAMS", checked.message);
|
|
7318
|
+
const pid = await resolveProjectId(args.projectId);
|
|
7319
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys/recording`, {
|
|
7320
|
+
method: "PUT",
|
|
7321
|
+
body: JSON.stringify(checked.body)
|
|
7322
|
+
});
|
|
7323
|
+
return jsonText({ ...data, next: journeyRecordingNextOf(checked.body.hours) });
|
|
7324
|
+
}
|
|
7325
|
+
);
|
|
7134
7326
|
server.registerResource(
|
|
7135
7327
|
"activation_status",
|
|
7136
7328
|
"mushi://activation",
|
package/dist/server.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
TDD_TOOL_CATALOG,
|
|
5
5
|
TOOL_CATALOG,
|
|
6
6
|
routeUseMushiIntent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KEMYF42N.js";
|
|
8
8
|
import {
|
|
9
9
|
MUSHI_SERVER_METADATA
|
|
10
10
|
} from "./chunk-FJRPC4VR.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
DEPRECATED_TOOL_ALIASES,
|
|
13
13
|
TOOL_FEATURE_MAP,
|
|
14
14
|
toolMatchesFeatures
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SHA56ZRG.js";
|
|
16
16
|
|
|
17
17
|
// src/server.ts
|
|
18
18
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -27,13 +27,13 @@ function docUrl(route) {
|
|
|
27
27
|
}
|
|
28
28
|
var MUSHI_DOCS_INDEX = [
|
|
29
29
|
{
|
|
30
|
-
title: "Mushi Mushi \u2014
|
|
30
|
+
title: "Mushi Mushi \u2014 one place to improve your AI-built app",
|
|
31
31
|
url: docUrl("/"),
|
|
32
32
|
route: "/",
|
|
33
33
|
markdown: "index.md",
|
|
34
|
-
keywords: ["
|
|
34
|
+
keywords: ["one", "place", "improve", "ai-built", "app"],
|
|
35
35
|
headings: ["Will my customers actually report bugs?", "See it work, on a real bug", "What it takes", "Why I built it", "What this is (and is not)"],
|
|
36
|
-
excerpt: "Your AI
|
|
36
|
+
excerpt: "Your AI built it. Mushi Mushi makes it better: it finds what breaks, where people get stuck and what the code needs, then hands you the fix."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
title: "Mushi Mushi admin console",
|
|
@@ -332,6 +332,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
332
332
|
headings: ["Understanding the score", "Runs table", "Run detail drawer", "Score timeline", "Iterations list", "Succeeded run", "Creating a run", "Common tasks"],
|
|
333
333
|
excerpt: "The Improvement runs page in Mushi Mushi queues runs where one AI critiques a live URL against your goal and a second scores it, iteration by iteration."
|
|
334
334
|
},
|
|
335
|
+
{
|
|
336
|
+
title: "Journey optimizer",
|
|
337
|
+
url: docUrl("/admin/journeys"),
|
|
338
|
+
route: "/admin/journeys",
|
|
339
|
+
markdown: "admin/journeys.md",
|
|
340
|
+
keywords: ["admin", "journeys", "journey", "optimizer"],
|
|
341
|
+
headings: ["Record visits only when you need them", "Scan your site", "Read the map", "What it finds", "Hand it to your coding agent", "Related"],
|
|
342
|
+
excerpt: "Map how people move through your app, then fix dead ends, pages people leave, duplicate pages and pages nothing links to, with prompts for your coding agent."
|
|
343
|
+
},
|
|
335
344
|
{
|
|
336
345
|
title: "Triage grading",
|
|
337
346
|
url: docUrl("/admin/judge"),
|
|
@@ -1040,7 +1049,7 @@ var MUSHI_DOCS_INDEX = [
|
|
|
1040
1049
|
route: "/ja",
|
|
1041
1050
|
markdown: "ja.md",
|
|
1042
1051
|
keywords: ["ja"],
|
|
1043
|
-
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", "\u82F1\u8A9E\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8"],
|
|
1052
|
+
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"],
|
|
1044
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"
|
|
1045
1054
|
},
|
|
1046
1055
|
{
|
|
@@ -1079,6 +1088,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
1079
1088
|
headings: ["1. Acceptance", "2. The Service", "3. Software licenses", "4. Accounts", "5. Acceptable use", "6. Your data and the license you give us", "7. Free tier", "8. Paid plans and billing"],
|
|
1080
1089
|
excerpt: "The terms for Mushi Mushi Cloud, the admin console, the SDKs and the Bounties tester marketplace. Plans, limits, AI-output disclaimer, licenses and liability."
|
|
1081
1090
|
},
|
|
1091
|
+
{
|
|
1092
|
+
title: "\u7279\u5B9A\u5546\u53D6\u5F15\u6CD5\u306B\u57FA\u3065\u304F\u8868\u8A18",
|
|
1093
|
+
url: docUrl("/legal/tokushoho"),
|
|
1094
|
+
route: "/legal/tokushoho",
|
|
1095
|
+
markdown: "legal/tokushoho.md",
|
|
1096
|
+
keywords: ["legal", "tokushoho"],
|
|
1097
|
+
headings: [],
|
|
1098
|
+
excerpt: "Mushi Mushi Cloud \u306E\u7279\u5B9A\u5546\u53D6\u5F15\u6CD5\u306B\u57FA\u3065\u304F\u8868\u8A18\u3002\u8CA9\u58F2\u4E8B\u696D\u8005\u3001\u6240\u5728\u5730\u3001\u9023\u7D61\u5148\u3001\u6599\u91D1\uFF08\u7C73\u30C9\u30EB\u5EFA\u3066\uFF09\u3001\u652F\u6255\u6642\u671F\u3001\u81EA\u52D5\u66F4\u65B0\u3068\u89E3\u7D04\u306E\u65B9\u6CD5\u3001\u8FD4\u91D1\u306E\u6271\u3044\u3092\u8A18\u8F09\u3057\u3066\u3044\u307E\u3059\u3002"
|
|
1099
|
+
},
|
|
1082
1100
|
{
|
|
1083
1101
|
title: "Migration guides",
|
|
1084
1102
|
url: docUrl("/migrations"),
|
|
@@ -2547,6 +2565,86 @@ function triageSummaryOf(report, actions) {
|
|
|
2547
2565
|
const next = actions[0] ? `Recommended: ${actions[0].action}.` : "No action required.";
|
|
2548
2566
|
return `[${severity}] ${category} \u2014 status: ${status}. ${next}`;
|
|
2549
2567
|
}
|
|
2568
|
+
var JOURNEY_FINDING_KINDS = [
|
|
2569
|
+
"broken",
|
|
2570
|
+
"dead_end",
|
|
2571
|
+
"high_exit",
|
|
2572
|
+
"loop",
|
|
2573
|
+
"reload",
|
|
2574
|
+
"duplicate_page",
|
|
2575
|
+
"route_variant",
|
|
2576
|
+
"duplicate_title",
|
|
2577
|
+
"orphan",
|
|
2578
|
+
"deep_page",
|
|
2579
|
+
"unvisited"
|
|
2580
|
+
];
|
|
2581
|
+
var JOURNEY_DAY_OPTIONS = [7, 30, 90];
|
|
2582
|
+
var JOURNEY_MAX_FLOWS = 10;
|
|
2583
|
+
var JOURNEY_DEFAULT_LIMIT = 20;
|
|
2584
|
+
var JOURNEY_MAX_LIMIT = 100;
|
|
2585
|
+
var JOURNEY_SCAN_NEXT = "Firecrawl reads the pages on its side, usually in a few minutes. Call get_journeys in about two minutes; each call moves the scan on and returns the map once it is done.";
|
|
2586
|
+
var JOURNEY_RECORDING_MAX_HOURS = 168;
|
|
2587
|
+
function journeyRecordingBodyOf(hours, sampleRate) {
|
|
2588
|
+
if (typeof hours !== "number" || !Number.isInteger(hours) || hours < 0 || hours > JOURNEY_RECORDING_MAX_HOURS) {
|
|
2589
|
+
return { ok: false, message: `hours must be a whole number from 0 (stop) to ${JOURNEY_RECORDING_MAX_HOURS}` };
|
|
2590
|
+
}
|
|
2591
|
+
if (sampleRate === void 0 || sampleRate === null) return { ok: true, body: { hours } };
|
|
2592
|
+
if (typeof sampleRate !== "number" || !(sampleRate > 0 && sampleRate <= 1)) {
|
|
2593
|
+
return { ok: false, message: "sampleRate must be above 0 and at most 1 (0.1 = one visitor in ten)" };
|
|
2594
|
+
}
|
|
2595
|
+
return { ok: true, body: { hours, sample_rate: sampleRate } };
|
|
2596
|
+
}
|
|
2597
|
+
function journeyRecordingNextOf(hours) {
|
|
2598
|
+
return hours === 0 ? "Recording is off. Apps with trackSessions: 'on-demand' send no visits until a new window opens." : "Recording is on for apps whose SDK uses trackSessions: 'on-demand'. Call get_journeys once people have used the app.";
|
|
2599
|
+
}
|
|
2600
|
+
function journeyDaysOf(days) {
|
|
2601
|
+
if (days === void 0 || days === null) return 30;
|
|
2602
|
+
return JOURNEY_DAY_OPTIONS.includes(days) ? days : null;
|
|
2603
|
+
}
|
|
2604
|
+
function journeysForAgent(data, opts = {}) {
|
|
2605
|
+
const map = data.map && typeof data.map === "object" ? data.map : {};
|
|
2606
|
+
const all = Array.isArray(map.findings) ? map.findings : [];
|
|
2607
|
+
const matching = opts.kind ? all.filter((f) => f.kind === opts.kind) : all;
|
|
2608
|
+
const rawLimit = typeof opts.limit === "number" && Number.isFinite(opts.limit) ? Math.trunc(opts.limit) : JOURNEY_DEFAULT_LIMIT;
|
|
2609
|
+
const limit = Math.min(Math.max(rawLimit, 1), JOURNEY_MAX_LIMIT);
|
|
2610
|
+
const findingsByKind = {};
|
|
2611
|
+
for (const f of all) findingsByKind[String(f.kind)] = (findingsByKind[String(f.kind)] ?? 0) + 1;
|
|
2612
|
+
const stats = map.stats && typeof map.stats === "object" ? map.stats : null;
|
|
2613
|
+
const scan = data.scan && typeof data.scan === "object" ? data.scan : null;
|
|
2614
|
+
const mapScan = data.mapScan && typeof data.mapScan === "object" ? data.mapScan : null;
|
|
2615
|
+
const findings = matching.slice(0, limit);
|
|
2616
|
+
const next = [];
|
|
2617
|
+
if (scan?.status === "running") next.push("A site scan is running. Call get_journeys again in about a minute.");
|
|
2618
|
+
else if (!mapScan) next.push("No site scan yet. Call scan_site_journeys to read the live site's links (orphan, duplicate and deep pages).");
|
|
2619
|
+
const recording = data.recording && typeof data.recording === "object" ? data.recording : null;
|
|
2620
|
+
if (stats && stats.sessions === 0) {
|
|
2621
|
+
next.push(
|
|
2622
|
+
recording && recording.until ? "No visits yet in this window. Recording is on, so visits will appear as people use the app." : "No visits in this window. Visits come from the Mushi Mushi SDK in the app; if it uses trackSessions: 'on-demand', open a recording window with record_journeys (or on the console's Journeys page)."
|
|
2623
|
+
);
|
|
2624
|
+
}
|
|
2625
|
+
if (matching.length > findings.length) next.push(`${matching.length - findings.length} more finding(s): raise limit or filter by kind.`);
|
|
2626
|
+
if (findings.length > 0) next.push("Each finding has a prompt: paste it into your coding agent in the app's repo.");
|
|
2627
|
+
const out = {
|
|
2628
|
+
days: data.days ?? null,
|
|
2629
|
+
liveUrl: data.liveUrl ?? null,
|
|
2630
|
+
score: map.score ?? null,
|
|
2631
|
+
rootPath: map.rootPath ?? null,
|
|
2632
|
+
stats,
|
|
2633
|
+
scan,
|
|
2634
|
+
mapScan,
|
|
2635
|
+
recording,
|
|
2636
|
+
flows: Array.isArray(map.flows) ? map.flows.slice(0, JOURNEY_MAX_FLOWS) : [],
|
|
2637
|
+
findingsTotal: matching.length,
|
|
2638
|
+
findingsByKind,
|
|
2639
|
+
findings,
|
|
2640
|
+
next
|
|
2641
|
+
};
|
|
2642
|
+
if (opts.includeGraph) {
|
|
2643
|
+
out.nodes = Array.isArray(map.nodes) ? map.nodes : [];
|
|
2644
|
+
out.edges = Array.isArray(map.edges) ? map.edges : [];
|
|
2645
|
+
}
|
|
2646
|
+
return out;
|
|
2647
|
+
}
|
|
2550
2648
|
|
|
2551
2649
|
// src/server.ts
|
|
2552
2650
|
installStdoutGuard();
|
|
@@ -5657,6 +5755,71 @@ function createMushiServer(config) {
|
|
|
5657
5755
|
return jsonResult(await apiCall(`/v1/admin/events/paths?${qs}`));
|
|
5658
5756
|
}
|
|
5659
5757
|
);
|
|
5758
|
+
server.registerTool(
|
|
5759
|
+
"get_journeys",
|
|
5760
|
+
{
|
|
5761
|
+
title: titleOf("get_journeys"),
|
|
5762
|
+
description: descOf("get_journeys"),
|
|
5763
|
+
annotations: annotationsFor("get_journeys"),
|
|
5764
|
+
inputSchema: z.object({
|
|
5765
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
5766
|
+
days: z.number().int().min(7).max(90).optional().describe("Window of visits: 7, 30 (default) or 90 days"),
|
|
5767
|
+
kind: z.enum(JOURNEY_FINDING_KINDS).optional().describe("Only findings of this kind"),
|
|
5768
|
+
limit: z.number().int().min(1).max(JOURNEY_MAX_LIMIT).optional().describe("Most findings to return (default 20, max 100)"),
|
|
5769
|
+
includeGraph: z.boolean().optional().describe("Also return the page nodes and page-to-page edges (up to 60 and 160 rows)")
|
|
5770
|
+
})
|
|
5771
|
+
},
|
|
5772
|
+
async (args) => {
|
|
5773
|
+
const days = journeyDaysOf(args.days);
|
|
5774
|
+
if (days === null) throw new MushiApiError(400, "INVALID_DAYS", "days must be 7, 30 or 90.");
|
|
5775
|
+
const pid = await resolveProjectId(args.projectId);
|
|
5776
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys?days=${days}`);
|
|
5777
|
+
return jsonText(journeysForAgent(data, { kind: args.kind, limit: args.limit, includeGraph: args.includeGraph }));
|
|
5778
|
+
}
|
|
5779
|
+
);
|
|
5780
|
+
server.registerTool(
|
|
5781
|
+
"scan_site_journeys",
|
|
5782
|
+
{
|
|
5783
|
+
title: titleOf("scan_site_journeys"),
|
|
5784
|
+
description: descOf("scan_site_journeys"),
|
|
5785
|
+
annotations: annotationsFor("scan_site_journeys"),
|
|
5786
|
+
inputSchema: z.object({
|
|
5787
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
5788
|
+
baseUrl: z.string().optional().describe("The site's public https:// address; defaults to the one Mushi Mushi already knows")
|
|
5789
|
+
})
|
|
5790
|
+
},
|
|
5791
|
+
async (args) => {
|
|
5792
|
+
const pid = await resolveProjectId(args.projectId);
|
|
5793
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys/scan`, {
|
|
5794
|
+
method: "POST",
|
|
5795
|
+
body: JSON.stringify(args.baseUrl ? { base_url: args.baseUrl } : {})
|
|
5796
|
+
});
|
|
5797
|
+
return jsonText({ ...data, next: JOURNEY_SCAN_NEXT });
|
|
5798
|
+
}
|
|
5799
|
+
);
|
|
5800
|
+
server.registerTool(
|
|
5801
|
+
"record_journeys",
|
|
5802
|
+
{
|
|
5803
|
+
title: titleOf("record_journeys"),
|
|
5804
|
+
description: descOf("record_journeys"),
|
|
5805
|
+
annotations: annotationsFor("record_journeys"),
|
|
5806
|
+
inputSchema: z.object({
|
|
5807
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
5808
|
+
hours: z.number().int().min(0).max(JOURNEY_RECORDING_MAX_HOURS).describe("Hours to record from now (1-168), or 0 to stop"),
|
|
5809
|
+
sampleRate: z.number().max(1).optional().describe("Share of visitors to record, above 0 and at most 1 (0.1 = one in ten)")
|
|
5810
|
+
})
|
|
5811
|
+
},
|
|
5812
|
+
async (args) => {
|
|
5813
|
+
const checked = journeyRecordingBodyOf(args.hours, args.sampleRate);
|
|
5814
|
+
if (!checked.ok) throw new MushiApiError(400, "INVALID_PARAMS", checked.message);
|
|
5815
|
+
const pid = await resolveProjectId(args.projectId);
|
|
5816
|
+
const data = await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/journeys/recording`, {
|
|
5817
|
+
method: "PUT",
|
|
5818
|
+
body: JSON.stringify(checked.body)
|
|
5819
|
+
});
|
|
5820
|
+
return jsonText({ ...data, next: journeyRecordingNextOf(checked.body.hours) });
|
|
5821
|
+
}
|
|
5822
|
+
);
|
|
5660
5823
|
server.registerResource(
|
|
5661
5824
|
"activation_status",
|
|
5662
5825
|
"mushi://activation",
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mushi-mushi/mcp",
|
|
3
3
|
"mcpName": "io.github.kensaurus/mushi-mushi",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.31.0",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "MCP server for Cursor, Claude Code and Copilot.
|
|
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",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -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.
|
|
48
|
+
"@mushi-mushi/core": "^1.34.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sentry/node": "^10.57.0"
|