@mushi-mushi/mcp 0.31.8 → 0.32.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 +2 -2
- package/dist/catalog.js +1 -1
- package/dist/{chunk-KEMYF42N.js → chunk-MVP3BKZ2.js} +19 -1
- package/dist/{chunk-SHA56ZRG.js → chunk-PHTWQKFE.js} +2 -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 +111 -2
- package/dist/server.js +92 -3
- package/package.json +2 -2
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.
|
|
34
|
+
"args": ["-y", "@mushi-mushi/mcp@0.32.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 135 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
|
@@ -552,6 +552,22 @@ var TOOL_CATALOG = [
|
|
|
552
552
|
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
553
553
|
useCase: "Is this project on the current Mushi SDK?"
|
|
554
554
|
},
|
|
555
|
+
{
|
|
556
|
+
name: "get_widget_settings",
|
|
557
|
+
title: "Bug widget look",
|
|
558
|
+
description: `Return how the in-app bug widget looks for one project, as the console sets it (served to installed SDKs at startup, no redeploy): { projectId, enabled (false: SDKs ignore console settings), canEdit, widget: { position, theme (auto | light | dark | inherit), triggerText (null = the default bug icon), accent (a #rrggbb brand colour, or "auto" to match the site), accentText (the black or white text Mushi checked against the accent, null when auto), launcher (auto | banner | edge-tab | attach | manual | hidden) } }. A value the app's own code sets in Mushi.init / data-* attributes wins over these. Optional projectId. Read-only.`,
|
|
559
|
+
scope: "mcp:read",
|
|
560
|
+
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
561
|
+
useCase: "What colour and corner is the bug button in this app?"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "set_widget_settings",
|
|
565
|
+
title: "Change the bug widget look",
|
|
566
|
+
description: `Change how the in-app bug widget looks for one project; installed SDKs pick it up at their next start, with no redeploy. Send any of accent (a hex colour like #3b5bdb, or "auto" to match the site; Mushi picks black or white text with at least 3:1 contrast), position (top-left | top-right | bottom-left | bottom-right), theme (auto | light | dark | inherit), triggerText (up to 24 characters; "" restores the default icon) and launcher (auto | banner | edge-tab | attach | manual | hidden). A value the app's own code sets wins over the console, so if nothing changes in the app, check Mushi.init. Project owners and admins only (403 otherwise); 60 changes an hour per app. Optional projectId. Returns { before, after, changed }. Write.`,
|
|
567
|
+
scope: "mcp:write",
|
|
568
|
+
hints: { readOnly: false, destructive: false, idempotent: true, openWorld: true },
|
|
569
|
+
useCase: "Make the bug button our brand blue and move it to the bottom left."
|
|
570
|
+
},
|
|
555
571
|
{
|
|
556
572
|
name: "search_mushi_docs",
|
|
557
573
|
title: "Search Mushi documentation",
|
|
@@ -1194,7 +1210,9 @@ var USE_MUSHI_INTENTS = {
|
|
|
1194
1210
|
"list_byok_keys",
|
|
1195
1211
|
"add_byok_key",
|
|
1196
1212
|
"test_byok_key",
|
|
1197
|
-
"remove_byok_key"
|
|
1213
|
+
"remove_byok_key",
|
|
1214
|
+
"get_widget_settings",
|
|
1215
|
+
"set_widget_settings"
|
|
1198
1216
|
],
|
|
1199
1217
|
hint: "Call diagnose_setup first \u2014 it diagnoses setup gaps and returns the next action to take."
|
|
1200
1218
|
},
|
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.32.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-PHTWQKFE.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.32.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
|
@@ -628,6 +628,22 @@ var TOOL_CATALOG = [
|
|
|
628
628
|
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
629
629
|
useCase: "Is this project on the current Mushi SDK?"
|
|
630
630
|
},
|
|
631
|
+
{
|
|
632
|
+
name: "get_widget_settings",
|
|
633
|
+
title: "Bug widget look",
|
|
634
|
+
description: `Return how the in-app bug widget looks for one project, as the console sets it (served to installed SDKs at startup, no redeploy): { projectId, enabled (false: SDKs ignore console settings), canEdit, widget: { position, theme (auto | light | dark | inherit), triggerText (null = the default bug icon), accent (a #rrggbb brand colour, or "auto" to match the site), accentText (the black or white text Mushi checked against the accent, null when auto), launcher (auto | banner | edge-tab | attach | manual | hidden) } }. A value the app's own code sets in Mushi.init / data-* attributes wins over these. Optional projectId. Read-only.`,
|
|
635
|
+
scope: "mcp:read",
|
|
636
|
+
hints: { readOnly: true, idempotent: true, openWorld: true },
|
|
637
|
+
useCase: "What colour and corner is the bug button in this app?"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: "set_widget_settings",
|
|
641
|
+
title: "Change the bug widget look",
|
|
642
|
+
description: `Change how the in-app bug widget looks for one project; installed SDKs pick it up at their next start, with no redeploy. Send any of accent (a hex colour like #3b5bdb, or "auto" to match the site; Mushi picks black or white text with at least 3:1 contrast), position (top-left | top-right | bottom-left | bottom-right), theme (auto | light | dark | inherit), triggerText (up to 24 characters; "" restores the default icon) and launcher (auto | banner | edge-tab | attach | manual | hidden). A value the app's own code sets wins over the console, so if nothing changes in the app, check Mushi.init. Project owners and admins only (403 otherwise); 60 changes an hour per app. Optional projectId. Returns { before, after, changed }. Write.`,
|
|
643
|
+
scope: "mcp:write",
|
|
644
|
+
hints: { readOnly: false, destructive: false, idempotent: true, openWorld: true },
|
|
645
|
+
useCase: "Make the bug button our brand blue and move it to the bottom left."
|
|
646
|
+
},
|
|
631
647
|
{
|
|
632
648
|
name: "search_mushi_docs",
|
|
633
649
|
title: "Search Mushi documentation",
|
|
@@ -1186,7 +1202,9 @@ var USE_MUSHI_INTENTS = {
|
|
|
1186
1202
|
"list_byok_keys",
|
|
1187
1203
|
"add_byok_key",
|
|
1188
1204
|
"test_byok_key",
|
|
1189
|
-
"remove_byok_key"
|
|
1205
|
+
"remove_byok_key",
|
|
1206
|
+
"get_widget_settings",
|
|
1207
|
+
"set_widget_settings"
|
|
1190
1208
|
],
|
|
1191
1209
|
hint: "Call diagnose_setup first \u2014 it diagnoses setup gaps and returns the next action to take."
|
|
1192
1210
|
},
|
|
@@ -1415,6 +1433,8 @@ var TOOL_FEATURE_MAP = {
|
|
|
1415
1433
|
// setup
|
|
1416
1434
|
diagnose_setup: "setup",
|
|
1417
1435
|
check_sdk_version: "setup",
|
|
1436
|
+
get_widget_settings: "setup",
|
|
1437
|
+
set_widget_settings: "setup",
|
|
1418
1438
|
activation_status: "setup",
|
|
1419
1439
|
get_two_way_comms_health: "setup",
|
|
1420
1440
|
// fixes
|
|
@@ -2609,7 +2629,7 @@ var MUSHI_DOCS_INDEX = [
|
|
|
2609
2629
|
route: "/how-it-works",
|
|
2610
2630
|
markdown: "how-it-works.md",
|
|
2611
2631
|
keywords: ["how-it-works", "works", "shown", "real", "screens"],
|
|
2612
|
-
headings: ["The four steps", "1. Your user reports a bug", "2. From the report to a merged fix", "What it fixes about bug tracking today", "For developers", "How a bug moves", "Connect your AI editor"
|
|
2632
|
+
headings: ["The four steps", "Before you install: check your live app free", "1. Your user reports a bug", "2. From the report to a merged fix", "What it fixes about bug tracking today", "For developers", "How a bug moves", "Connect your AI editor"],
|
|
2613
2633
|
excerpt: "Watch a bug go from a user's report to a fix: what you do at each step, what Mushi Mushi does, and the real screens from report button to fix prompt."
|
|
2614
2634
|
},
|
|
2615
2635
|
{
|
|
@@ -3512,6 +3532,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
3512
3532
|
headings: ["API surface", "Setup", "Submitting a report"],
|
|
3513
3533
|
excerpt: "Reference for mushi-mushi/svelte, the Mushi Mushi Svelte SDK. initMushi, getMushi and the SvelteKit handleError helpers that send browser errors to your queue."
|
|
3514
3534
|
},
|
|
3535
|
+
{
|
|
3536
|
+
title: "Theming the bug widget",
|
|
3537
|
+
url: docUrl("/sdks/theming"),
|
|
3538
|
+
route: "/sdks/theming",
|
|
3539
|
+
markdown: "sdks/theming.md",
|
|
3540
|
+
keywords: ["sdks", "theming", "bug", "widget"],
|
|
3541
|
+
headings: ["Three easy ways", "1. Script tag (Lovable, Bolt, plain HTML)", "2. In code", "3. In the console", "What can be set where", "CSS tokens", "Contrast rule", "Route rules"],
|
|
3542
|
+
excerpt: "Match the Mushi Mushi bug widget to your app: accent, theme, corner, language and hidden pages from a script tag, code or the console, plus 13 CSS tokens."
|
|
3543
|
+
},
|
|
3515
3544
|
{
|
|
3516
3545
|
title: "@mushi-mushi/ux",
|
|
3517
3546
|
url: docUrl("/sdks/ux"),
|
|
@@ -3923,6 +3952,46 @@ function sdkKeyReport(keyScopes, consoleUrl, ctx = {}) {
|
|
|
3923
3952
|
].join("\n");
|
|
3924
3953
|
}
|
|
3925
3954
|
|
|
3955
|
+
// src/widget-settings.ts
|
|
3956
|
+
var WIDGET_POSITIONS = ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
3957
|
+
var WIDGET_THEMES = ["auto", "light", "dark", "inherit"];
|
|
3958
|
+
var WIDGET_LAUNCHERS = ["auto", "banner", "edge-tab", "attach", "manual", "hidden"];
|
|
3959
|
+
function widgetSettingsBody(input) {
|
|
3960
|
+
const widget = {};
|
|
3961
|
+
if (input.accent !== void 0) {
|
|
3962
|
+
const a = input.accent.trim();
|
|
3963
|
+
widget.accent = a === "" || a.toLowerCase() === "auto" ? null : a;
|
|
3964
|
+
}
|
|
3965
|
+
if (input.position !== void 0) widget.position = input.position;
|
|
3966
|
+
if (input.theme !== void 0) widget.theme = input.theme;
|
|
3967
|
+
if (input.triggerText !== void 0) widget.triggerText = input.triggerText.trim() ? input.triggerText : null;
|
|
3968
|
+
if (input.launcher !== void 0) widget.launcher = input.launcher;
|
|
3969
|
+
return { widget };
|
|
3970
|
+
}
|
|
3971
|
+
function widgetSettingsView(data) {
|
|
3972
|
+
const d = data && typeof data === "object" ? data : {};
|
|
3973
|
+
const w = d.widget && typeof d.widget === "object" ? d.widget : {};
|
|
3974
|
+
const str = (v) => typeof v === "string" && v ? v : null;
|
|
3975
|
+
return {
|
|
3976
|
+
projectId: str(d.projectId),
|
|
3977
|
+
enabled: d.enabled !== false,
|
|
3978
|
+
canEdit: typeof d.canEdit === "boolean" ? d.canEdit : null,
|
|
3979
|
+
widget: {
|
|
3980
|
+
position: str(w.position) ?? "bottom-right",
|
|
3981
|
+
theme: str(w.theme) ?? "auto",
|
|
3982
|
+
triggerText: str(w.triggerText),
|
|
3983
|
+
accent: str(w.accent) ?? "auto",
|
|
3984
|
+
accentText: str(w.accentText),
|
|
3985
|
+
launcher: str(w.launcher) ?? "auto"
|
|
3986
|
+
}
|
|
3987
|
+
};
|
|
3988
|
+
}
|
|
3989
|
+
function changedWidgetKeys(before, after) {
|
|
3990
|
+
return Object.keys(after.widget).filter(
|
|
3991
|
+
(k) => before.widget[k] !== after.widget[k]
|
|
3992
|
+
);
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3926
3995
|
// src/arg-aliases.ts
|
|
3927
3996
|
function snakeAliasOf(name) {
|
|
3928
3997
|
return name.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
|
|
@@ -5728,6 +5797,46 @@ function createMushiServer(config) {
|
|
|
5728
5797
|
return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/design/settings`, { method: "PUT", body: JSON.stringify(body) }));
|
|
5729
5798
|
}
|
|
5730
5799
|
);
|
|
5800
|
+
server.registerTool(
|
|
5801
|
+
"get_widget_settings",
|
|
5802
|
+
{
|
|
5803
|
+
title: titleOf("get_widget_settings"),
|
|
5804
|
+
description: descOf("get_widget_settings"),
|
|
5805
|
+
annotations: annotationsFor("get_widget_settings"),
|
|
5806
|
+
inputSchema: PROJECT_ID_INPUT
|
|
5807
|
+
},
|
|
5808
|
+
async (args) => {
|
|
5809
|
+
const pid = await resolveProjectId(args.projectId);
|
|
5810
|
+
return jsonText(widgetSettingsView(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/sdk-config`)));
|
|
5811
|
+
}
|
|
5812
|
+
);
|
|
5813
|
+
server.registerTool(
|
|
5814
|
+
"set_widget_settings",
|
|
5815
|
+
{
|
|
5816
|
+
title: titleOf("set_widget_settings"),
|
|
5817
|
+
description: descOf("set_widget_settings"),
|
|
5818
|
+
annotations: annotationsFor("set_widget_settings"),
|
|
5819
|
+
inputSchema: z.object({
|
|
5820
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
5821
|
+
accent: z.string().max(20).optional().describe('Hex colour like #3b5bdb, or "auto" to match the site'),
|
|
5822
|
+
position: z.enum(WIDGET_POSITIONS).optional().describe("Corner of the launcher"),
|
|
5823
|
+
theme: z.enum(WIDGET_THEMES).optional().describe("auto follows the OS; inherit follows the page"),
|
|
5824
|
+
triggerText: z.string().max(24).optional().describe('Launcher label, up to 24 characters; "" restores the default icon'),
|
|
5825
|
+
launcher: z.enum(WIDGET_LAUNCHERS).optional().describe("How the widget opens")
|
|
5826
|
+
})
|
|
5827
|
+
},
|
|
5828
|
+
async (args) => {
|
|
5829
|
+
const body = widgetSettingsBody(args);
|
|
5830
|
+
if (Object.keys(body.widget).length === 0) {
|
|
5831
|
+
throw new MushiApiError(400, "VALIDATION_ERROR", "Send at least one of accent, position, theme, triggerText or launcher.");
|
|
5832
|
+
}
|
|
5833
|
+
const pid = await resolveProjectId(args.projectId);
|
|
5834
|
+
const path = `/v1/admin/projects/${encodeURIComponent(pid)}/sdk-config`;
|
|
5835
|
+
const before = widgetSettingsView(await apiCall(path));
|
|
5836
|
+
const after = widgetSettingsView(await apiCall(path, { method: "PUT", body: JSON.stringify(body) }));
|
|
5837
|
+
return jsonText({ before, after, changed: changedWidgetKeys(before, after) });
|
|
5838
|
+
}
|
|
5839
|
+
);
|
|
5731
5840
|
server.registerTool(
|
|
5732
5841
|
"get_recipe_sources",
|
|
5733
5842
|
{
|
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-MVP3BKZ2.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-PHTWQKFE.js";
|
|
16
16
|
|
|
17
17
|
// src/server.ts
|
|
18
18
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -1040,7 +1040,7 @@ var MUSHI_DOCS_INDEX = [
|
|
|
1040
1040
|
route: "/how-it-works",
|
|
1041
1041
|
markdown: "how-it-works.md",
|
|
1042
1042
|
keywords: ["how-it-works", "works", "shown", "real", "screens"],
|
|
1043
|
-
headings: ["The four steps", "1. Your user reports a bug", "2. From the report to a merged fix", "What it fixes about bug tracking today", "For developers", "How a bug moves", "Connect your AI editor"
|
|
1043
|
+
headings: ["The four steps", "Before you install: check your live app free", "1. Your user reports a bug", "2. From the report to a merged fix", "What it fixes about bug tracking today", "For developers", "How a bug moves", "Connect your AI editor"],
|
|
1044
1044
|
excerpt: "Watch a bug go from a user's report to a fix: what you do at each step, what Mushi Mushi does, and the real screens from report button to fix prompt."
|
|
1045
1045
|
},
|
|
1046
1046
|
{
|
|
@@ -1943,6 +1943,15 @@ var MUSHI_DOCS_INDEX = [
|
|
|
1943
1943
|
headings: ["API surface", "Setup", "Submitting a report"],
|
|
1944
1944
|
excerpt: "Reference for mushi-mushi/svelte, the Mushi Mushi Svelte SDK. initMushi, getMushi and the SvelteKit handleError helpers that send browser errors to your queue."
|
|
1945
1945
|
},
|
|
1946
|
+
{
|
|
1947
|
+
title: "Theming the bug widget",
|
|
1948
|
+
url: docUrl("/sdks/theming"),
|
|
1949
|
+
route: "/sdks/theming",
|
|
1950
|
+
markdown: "sdks/theming.md",
|
|
1951
|
+
keywords: ["sdks", "theming", "bug", "widget"],
|
|
1952
|
+
headings: ["Three easy ways", "1. Script tag (Lovable, Bolt, plain HTML)", "2. In code", "3. In the console", "What can be set where", "CSS tokens", "Contrast rule", "Route rules"],
|
|
1953
|
+
excerpt: "Match the Mushi Mushi bug widget to your app: accent, theme, corner, language and hidden pages from a script tag, code or the console, plus 13 CSS tokens."
|
|
1954
|
+
},
|
|
1946
1955
|
{
|
|
1947
1956
|
title: "@mushi-mushi/ux",
|
|
1948
1957
|
url: docUrl("/sdks/ux"),
|
|
@@ -2373,6 +2382,46 @@ function sdkKeyNextAction(consoleUrl, ctx = {}) {
|
|
|
2373
2382
|
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.`;
|
|
2374
2383
|
}
|
|
2375
2384
|
|
|
2385
|
+
// src/widget-settings.ts
|
|
2386
|
+
var WIDGET_POSITIONS = ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
2387
|
+
var WIDGET_THEMES = ["auto", "light", "dark", "inherit"];
|
|
2388
|
+
var WIDGET_LAUNCHERS = ["auto", "banner", "edge-tab", "attach", "manual", "hidden"];
|
|
2389
|
+
function widgetSettingsBody(input) {
|
|
2390
|
+
const widget = {};
|
|
2391
|
+
if (input.accent !== void 0) {
|
|
2392
|
+
const a = input.accent.trim();
|
|
2393
|
+
widget.accent = a === "" || a.toLowerCase() === "auto" ? null : a;
|
|
2394
|
+
}
|
|
2395
|
+
if (input.position !== void 0) widget.position = input.position;
|
|
2396
|
+
if (input.theme !== void 0) widget.theme = input.theme;
|
|
2397
|
+
if (input.triggerText !== void 0) widget.triggerText = input.triggerText.trim() ? input.triggerText : null;
|
|
2398
|
+
if (input.launcher !== void 0) widget.launcher = input.launcher;
|
|
2399
|
+
return { widget };
|
|
2400
|
+
}
|
|
2401
|
+
function widgetSettingsView(data) {
|
|
2402
|
+
const d = data && typeof data === "object" ? data : {};
|
|
2403
|
+
const w = d.widget && typeof d.widget === "object" ? d.widget : {};
|
|
2404
|
+
const str = (v) => typeof v === "string" && v ? v : null;
|
|
2405
|
+
return {
|
|
2406
|
+
projectId: str(d.projectId),
|
|
2407
|
+
enabled: d.enabled !== false,
|
|
2408
|
+
canEdit: typeof d.canEdit === "boolean" ? d.canEdit : null,
|
|
2409
|
+
widget: {
|
|
2410
|
+
position: str(w.position) ?? "bottom-right",
|
|
2411
|
+
theme: str(w.theme) ?? "auto",
|
|
2412
|
+
triggerText: str(w.triggerText),
|
|
2413
|
+
accent: str(w.accent) ?? "auto",
|
|
2414
|
+
accentText: str(w.accentText),
|
|
2415
|
+
launcher: str(w.launcher) ?? "auto"
|
|
2416
|
+
}
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
function changedWidgetKeys(before, after) {
|
|
2420
|
+
return Object.keys(after.widget).filter(
|
|
2421
|
+
(k) => before.widget[k] !== after.widget[k]
|
|
2422
|
+
);
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2376
2425
|
// src/arg-aliases.ts
|
|
2377
2426
|
function snakeAliasOf(name) {
|
|
2378
2427
|
return name.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
|
|
@@ -4178,6 +4227,46 @@ function createMushiServer(config) {
|
|
|
4178
4227
|
return jsonText(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/design/settings`, { method: "PUT", body: JSON.stringify(body) }));
|
|
4179
4228
|
}
|
|
4180
4229
|
);
|
|
4230
|
+
server.registerTool(
|
|
4231
|
+
"get_widget_settings",
|
|
4232
|
+
{
|
|
4233
|
+
title: titleOf("get_widget_settings"),
|
|
4234
|
+
description: descOf("get_widget_settings"),
|
|
4235
|
+
annotations: annotationsFor("get_widget_settings"),
|
|
4236
|
+
inputSchema: PROJECT_ID_INPUT
|
|
4237
|
+
},
|
|
4238
|
+
async (args) => {
|
|
4239
|
+
const pid = await resolveProjectId(args.projectId);
|
|
4240
|
+
return jsonText(widgetSettingsView(await apiCall(`/v1/admin/projects/${encodeURIComponent(pid)}/sdk-config`)));
|
|
4241
|
+
}
|
|
4242
|
+
);
|
|
4243
|
+
server.registerTool(
|
|
4244
|
+
"set_widget_settings",
|
|
4245
|
+
{
|
|
4246
|
+
title: titleOf("set_widget_settings"),
|
|
4247
|
+
description: descOf("set_widget_settings"),
|
|
4248
|
+
annotations: annotationsFor("set_widget_settings"),
|
|
4249
|
+
inputSchema: z.object({
|
|
4250
|
+
projectId: z.string().optional().describe("Project UUID \u2014 defaults to the server-configured project when omitted"),
|
|
4251
|
+
accent: z.string().max(20).optional().describe('Hex colour like #3b5bdb, or "auto" to match the site'),
|
|
4252
|
+
position: z.enum(WIDGET_POSITIONS).optional().describe("Corner of the launcher"),
|
|
4253
|
+
theme: z.enum(WIDGET_THEMES).optional().describe("auto follows the OS; inherit follows the page"),
|
|
4254
|
+
triggerText: z.string().max(24).optional().describe('Launcher label, up to 24 characters; "" restores the default icon'),
|
|
4255
|
+
launcher: z.enum(WIDGET_LAUNCHERS).optional().describe("How the widget opens")
|
|
4256
|
+
})
|
|
4257
|
+
},
|
|
4258
|
+
async (args) => {
|
|
4259
|
+
const body = widgetSettingsBody(args);
|
|
4260
|
+
if (Object.keys(body.widget).length === 0) {
|
|
4261
|
+
throw new MushiApiError(400, "VALIDATION_ERROR", "Send at least one of accent, position, theme, triggerText or launcher.");
|
|
4262
|
+
}
|
|
4263
|
+
const pid = await resolveProjectId(args.projectId);
|
|
4264
|
+
const path = `/v1/admin/projects/${encodeURIComponent(pid)}/sdk-config`;
|
|
4265
|
+
const before = widgetSettingsView(await apiCall(path));
|
|
4266
|
+
const after = widgetSettingsView(await apiCall(path, { method: "PUT", body: JSON.stringify(body) }));
|
|
4267
|
+
return jsonText({ before, after, changed: changedWidgetKeys(before, after) });
|
|
4268
|
+
}
|
|
4269
|
+
);
|
|
4181
4270
|
server.registerTool(
|
|
4182
4271
|
"get_recipe_sources",
|
|
4183
4272
|
{
|
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.
|
|
4
|
+
"version": "0.32.0",
|
|
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.
|
|
48
|
+
"@mushi-mushi/core": "^1.39.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sentry/node": "^10.57.0"
|