@mushi-mushi/mcp 0.17.0 → 0.18.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.
@@ -11,6 +11,7 @@ var FEATURE_GROUPS = [
11
11
  "audit",
12
12
  "docs",
13
13
  "usage",
14
+ "codebase",
14
15
  /** Deprecated aliases kept for one release — hidden unless `legacy` or `all`. */
15
16
  "legacy"
16
17
  ];
@@ -40,21 +41,16 @@ var TOOL_FEATURE_MAP = {
40
41
  triage_issue: "triage",
41
42
  query_lessons: "triage",
42
43
  list_lessons: "triage",
43
- fix_suggest: "triage",
44
- graph_neighborhood: "triage",
45
- graph_node_status: "triage",
46
- get_reporter_thread: "legacy",
44
+ suggest_fix: "triage",
45
+ get_graph_neighborhood: "triage",
46
+ get_graph_node: "triage",
47
47
  // inventory
48
- inventory_get: "inventory",
49
- inventory_diff: "inventory",
50
- inventory_findings: "inventory",
48
+ get_inventory: "inventory",
49
+ diff_inventory: "inventory",
50
+ list_gate_findings: "inventory",
51
51
  inventory_current: "admin",
52
52
  // setup
53
- diagnose_connection: "setup",
54
53
  diagnose_setup: "setup",
55
- setup_check: "legacy",
56
- ingest_setup_check: "legacy",
57
- get_activation_status: "legacy",
58
54
  activation_status: "setup",
59
55
  project_integration_health: "setup",
60
56
  setup_repo_for_mushi: "setup",
@@ -107,14 +103,31 @@ var TOOL_FEATURE_MAP = {
107
103
  // audit
108
104
  run_fullstack_audit: "audit",
109
105
  get_backend_health: "audit",
106
+ // codebase understand
107
+ ask_codebase: "codebase",
108
+ get_file_summary: "codebase",
109
+ get_codebase_tour: "codebase",
110
+ search_codebase: "codebase",
111
+ get_codebase_domains: "codebase",
112
+ analyze_codebase_impact: "codebase",
113
+ analyze_wiki_knowledge: "codebase",
110
114
  // docs
111
115
  search_mushi_docs: "docs"
112
116
  };
113
117
  var DEPRECATED_TOOL_ALIASES = {
118
+ // Removed deprecated tools → successor.
114
119
  setup_check: "diagnose_setup",
115
120
  ingest_setup_check: "diagnose_setup",
121
+ diagnose_connection: "diagnose_setup",
116
122
  get_activation_status: "activation_status",
117
- get_reporter_thread: "get_report_timeline"
123
+ get_reporter_thread: "get_report_timeline",
124
+ // Renamed to verb_object → new name.
125
+ fix_suggest: "suggest_fix",
126
+ inventory_get: "get_inventory",
127
+ inventory_diff: "diff_inventory",
128
+ inventory_findings: "list_gate_findings",
129
+ graph_neighborhood: "get_graph_neighborhood",
130
+ graph_node_status: "get_graph_node"
118
131
  };
119
132
  function parseFeaturesParam(raw) {
120
133
  if (raw == null || raw.trim() === "") return "all";
@@ -122,7 +135,12 @@ function parseFeaturesParam(raw) {
122
135
  if (normalized === "all" || normalized === "*") return "all";
123
136
  const groups = normalized.split(",").map((s) => s.trim()).filter(Boolean);
124
137
  const valid = groups.filter((g) => FEATURE_GROUPS.includes(g));
125
- if (valid.length === 0) return "all";
138
+ if (valid.length === 0) {
139
+ console.warn(
140
+ `[mushi-mcp] MUSHI_FEATURES="${raw}" contains no recognised groups; falling back to DEFAULT_FEATURE_GROUPS. Valid groups: ${FEATURE_GROUPS.join(", ")}`
141
+ );
142
+ return DEFAULT_FEATURE_GROUPS;
143
+ }
126
144
  return valid;
127
145
  }
128
146
  function parseFeaturesCsv(raw) {
package/dist/clients.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { FeatureGroup } from './feature-groups.js';
2
+
1
3
  /**
2
4
  * FILE: packages/mcp/src/clients.ts
3
5
  * PURPOSE: Shared, pure (React-free) client registry + install-config builders for
@@ -37,6 +39,7 @@
37
39
  * - Windsurf uses `serverUrl` for remote HTTP (NOT `url`) — encoding both would break it.
38
40
  * - The `cliIde` field drives `mushi setup --ide <cliIde>` in the CLI lane.
39
41
  */
42
+
40
43
  interface StdioConfig {
41
44
  command: string;
42
45
  args: string[];
@@ -61,6 +64,19 @@ interface McpBuildInput {
61
64
  endpoint: string;
62
65
  /** Hosted Streamable HTTP MCP URL (`RESOLVED_MCP_HTTP_URL`). */
63
66
  mcpHttpUrl: string;
67
+ /**
68
+ * Restrict the exposed tool groups. Omitted → each client's existing default
69
+ * (the lean `DEFAULT_FEATURE_GROUPS` for stdio deeplinks; all tools for the
70
+ * config-json clients that historically set no `MUSHI_FEATURES`). The public
71
+ * keyless demo passes an explicit read-only subset here.
72
+ */
73
+ features?: readonly FeatureGroup[];
74
+ /**
75
+ * Hosted HTTP transport only: append `?read_only=1` so the server hides and
76
+ * blocks write tools regardless of key scope. Used by the public demo on top
77
+ * of an `mcp:read` key for defence in depth. No-op for stdio configs.
78
+ */
79
+ readOnly?: boolean;
64
80
  }
65
81
  type McpBuildResult = {
66
82
  kind: 'deeplink';
@@ -91,7 +107,7 @@ interface McpClientDef {
91
107
  /** Build a stable, unique, human-readable MCP server slug for a project. */
92
108
  declare function projectServerName(projectId: string, projectName: string): string;
93
109
  declare function buildStdioConfigObj(projectId: string | undefined, apiKey: string, apiEndpoint: string, features?: readonly string[]): StdioConfig;
94
- declare function buildHttpConfigObj(projectId: string | undefined, apiKey: string, mcpHttpUrl: string, features?: readonly string[]): HttpConfig;
110
+ declare function buildHttpConfigObj(projectId: string | undefined, apiKey: string, mcpHttpUrl: string, features?: readonly string[], readOnly?: boolean): HttpConfig;
95
111
  declare const MCP_CLIENTS: McpClientDef[];
96
112
  /** Look up a client by id — throws if not found. */
97
113
  declare function getMcpClient(id: McpClientId): McpClientDef;
package/dist/clients.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  MUSHI_ICON_PNG_URL
3
- } from "./chunk-EHB2BGWX.js";
3
+ } from "./chunk-EANW5YTI.js";
4
4
  import {
5
5
  DEFAULT_FEATURE_GROUPS,
6
6
  appendFeaturesToUrl,
7
7
  featuresQueryString
8
- } from "./chunk-ZX3XIJ7S.js";
8
+ } from "./chunk-VBXXUK5G.js";
9
9
 
10
10
  // src/clients.ts
11
11
  function projectServerName(projectId, projectName) {
@@ -27,8 +27,17 @@ function buildStdioConfigObj(projectId, apiKey, apiEndpoint, features = DEFAULT_
27
27
  icon: MUSHI_ICON_PNG_URL
28
28
  };
29
29
  }
30
- function buildHttpConfigObj(projectId, apiKey, mcpHttpUrl, features = DEFAULT_FEATURE_GROUPS) {
31
- const url = appendFeaturesToUrl(mcpHttpUrl, features);
30
+ function withReadOnly(baseUrl, readOnly) {
31
+ if (!readOnly) return baseUrl;
32
+ const url = new URL(baseUrl);
33
+ url.searchParams.set("read_only", "1");
34
+ return url.toString();
35
+ }
36
+ function buildHttpConfigObj(projectId, apiKey, mcpHttpUrl, features = DEFAULT_FEATURE_GROUPS, readOnly = false) {
37
+ const url = withReadOnly(
38
+ appendFeaturesToUrl(mcpHttpUrl, features),
39
+ readOnly
40
+ );
32
41
  const headers = {
33
42
  Authorization: `Bearer ${apiKey}`,
34
43
  "X-Mushi-Api-Key": apiKey
@@ -57,9 +66,9 @@ var MCP_CLIENTS = [
57
66
  method: "deeplink",
58
67
  transport: "stdio",
59
68
  cliIde: "cursor",
60
- build({ projectId, projectName, apiKey, endpoint }) {
69
+ build({ projectId, projectName, apiKey, endpoint, features }) {
61
70
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
62
- const config = buildStdioConfigObj(projectId, apiKey, endpoint);
71
+ const config = buildStdioConfigObj(projectId, apiKey, endpoint, features);
63
72
  return { kind: "deeplink", url: encodeCursorDeeplink(name, config) };
64
73
  }
65
74
  },
@@ -70,9 +79,9 @@ var MCP_CLIENTS = [
70
79
  description: "One-click install via VS Code MCP extension",
71
80
  method: "deeplink",
72
81
  transport: "stdio",
73
- build({ projectId, projectName, apiKey, endpoint }) {
82
+ build({ projectId, projectName, apiKey, endpoint, features }) {
74
83
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
75
- const config = buildStdioConfigObj(projectId, apiKey, endpoint);
84
+ const config = buildStdioConfigObj(projectId, apiKey, endpoint, features);
76
85
  return { kind: "deeplink", url: encodeVsCodeDeeplink("vscode", name, config) };
77
86
  }
78
87
  },
@@ -83,9 +92,9 @@ var MCP_CLIENTS = [
83
92
  description: "One-click install via VS Code Insiders MCP extension",
84
93
  method: "deeplink",
85
94
  transport: "stdio",
86
- build({ projectId, projectName, apiKey, endpoint }) {
95
+ build({ projectId, projectName, apiKey, endpoint, features }) {
87
96
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
88
- const config = buildStdioConfigObj(projectId, apiKey, endpoint);
97
+ const config = buildStdioConfigObj(projectId, apiKey, endpoint, features);
89
98
  return { kind: "deeplink", url: encodeVsCodeDeeplink("vscode-insiders", name, config) };
90
99
  }
91
100
  },
@@ -96,9 +105,12 @@ var MCP_CLIENTS = [
96
105
  description: "Copy config into ~/.codeium/windsurf/mcp_config.json",
97
106
  method: "config-json",
98
107
  transport: "http",
99
- build({ projectId, projectName, apiKey, mcpHttpUrl }) {
108
+ build({ projectId, projectName, apiKey, mcpHttpUrl, features, readOnly }) {
100
109
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
101
- const url = appendFeaturesToUrl(mcpHttpUrl, DEFAULT_FEATURE_GROUPS);
110
+ const url = withReadOnly(
111
+ appendFeaturesToUrl(mcpHttpUrl, features ?? DEFAULT_FEATURE_GROUPS),
112
+ readOnly
113
+ );
102
114
  const headers = {
103
115
  Authorization: `Bearer ${apiKey}`,
104
116
  "X-Mushi-Api-Key": apiKey
@@ -124,12 +136,13 @@ var MCP_CLIENTS = [
124
136
  description: "Copy config into cline_mcp_settings.json",
125
137
  method: "config-json",
126
138
  transport: "stdio",
127
- build({ projectId, projectName, apiKey, endpoint }) {
139
+ build({ projectId, projectName, apiKey, endpoint, features }) {
128
140
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
129
141
  const env = {
130
142
  MUSHI_API_ENDPOINT: endpoint,
131
143
  MUSHI_API_KEY: apiKey
132
144
  };
145
+ if (features) env.MUSHI_FEATURES = featuresQueryString(features);
133
146
  if (projectId) env.MUSHI_PROJECT_ID = projectId;
134
147
  const clineConfig = {
135
148
  mcpServers: {
@@ -152,9 +165,12 @@ var MCP_CLIENTS = [
152
165
  method: "cli-command",
153
166
  transport: "http",
154
167
  cliIde: "claude",
155
- build({ projectId, projectName, apiKey, mcpHttpUrl }) {
168
+ build({ projectId, projectName, apiKey, mcpHttpUrl, features, readOnly }) {
156
169
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
157
- const url = appendFeaturesToUrl(mcpHttpUrl, DEFAULT_FEATURE_GROUPS);
170
+ const url = withReadOnly(
171
+ appendFeaturesToUrl(mcpHttpUrl, features ?? DEFAULT_FEATURE_GROUPS),
172
+ readOnly
173
+ );
158
174
  const cmd = `claude mcp add --transport http ${name} "${url}" --header "Authorization: Bearer ${apiKey}"`;
159
175
  return { kind: "command", text: cmd };
160
176
  }
@@ -166,12 +182,13 @@ var MCP_CLIENTS = [
166
182
  description: "Copy config into claude_desktop_config.json",
167
183
  method: "config-json",
168
184
  transport: "stdio",
169
- build({ projectId, projectName, apiKey, endpoint }) {
185
+ build({ projectId, projectName, apiKey, endpoint, features }) {
170
186
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
171
187
  const env = {
172
188
  MUSHI_API_ENDPOINT: endpoint,
173
189
  MUSHI_API_KEY: apiKey
174
190
  };
191
+ if (features) env.MUSHI_FEATURES = featuresQueryString(features);
175
192
  if (projectId) env.MUSHI_PROJECT_ID = projectId;
176
193
  const desktopConfig = {
177
194
  mcpServers: {
@@ -193,12 +210,13 @@ var MCP_CLIENTS = [
193
210
  method: "config-json",
194
211
  transport: "stdio",
195
212
  cliIde: "zed",
196
- build({ projectId, projectName, apiKey, endpoint }) {
213
+ build({ projectId, projectName, apiKey, endpoint, features }) {
197
214
  const name = projectId ? projectServerName(projectId, projectName) : `mushi-${projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 24)}`;
198
215
  const env = {
199
216
  MUSHI_API_ENDPOINT: endpoint,
200
217
  MUSHI_API_KEY: apiKey
201
218
  };
219
+ if (features) env.MUSHI_FEATURES = featuresQueryString(features);
202
220
  if (projectId) env.MUSHI_PROJECT_ID = projectId;
203
221
  const zedConfig = {
204
222
  context_servers: {
@@ -226,8 +244,11 @@ var MCP_CLIENTS = [
226
244
  description: "Streamable HTTP URL \u2014 works with OpenClaw, Hermes, Gemini CLI, ChatGPT, and more",
227
245
  method: "remote-url",
228
246
  transport: "http",
229
- build({ projectId, apiKey, mcpHttpUrl }) {
230
- const url = appendFeaturesToUrl(mcpHttpUrl, DEFAULT_FEATURE_GROUPS);
247
+ build({ projectId, apiKey, mcpHttpUrl, features, readOnly }) {
248
+ const url = withReadOnly(
249
+ appendFeaturesToUrl(mcpHttpUrl, features ?? DEFAULT_FEATURE_GROUPS),
250
+ readOnly
251
+ );
231
252
  const headerSnippet = [
232
253
  `Authorization: Bearer ${apiKey}`,
233
254
  projectId ? `X-Mushi-Project-Id: ${projectId}` : ""
@@ -4,14 +4,20 @@
4
4
  * When `features` is omitted → all tools (backward compatible).
5
5
  * New installs default to DEFAULT_FEATURE_GROUPS via deeplink / docs.
6
6
  */
7
- declare const FEATURE_GROUPS: readonly ["triage", "fixes", "inventory", "setup", "qa", "skills", "rewards", "admin", "audit", "docs", "usage", "legacy"];
7
+ declare const FEATURE_GROUPS: readonly ["triage", "fixes", "inventory", "setup", "qa", "skills", "rewards", "admin", "audit", "docs", "usage", "codebase", "legacy"];
8
8
  type FeatureGroup = (typeof FEATURE_GROUPS)[number];
9
9
  /** Lean default for new Cursor installs (~45 tools vs 70 full). */
10
10
  declare const DEFAULT_FEATURE_GROUPS: readonly FeatureGroup[];
11
11
  declare const ALL_FEATURE_GROUPS: readonly FeatureGroup[];
12
12
  /** Map every tool/resource name → feature group. */
13
13
  declare const TOOL_FEATURE_MAP: Record<string, FeatureGroup>;
14
- /** Tools superseded by another — still registered when legacy/all enabled. */
14
+ /**
15
+ * Tools that were renamed or removed. The old name maps to its successor so
16
+ * callers / docs can resolve the new tool, and a one-release deprecation
17
+ * window keeps old agent configs from silently breaking. These names are NOT
18
+ * registered as tools; the map exists so the CLI, docs, and helpful-error
19
+ * paths can point users at the replacement.
20
+ */
15
21
  declare const DEPRECATED_TOOL_ALIASES: Record<string, string>;
16
22
  type FeatureFilter = 'all' | readonly FeatureGroup[];
17
23
  declare function parseFeaturesParam(raw: string | null | undefined): FeatureFilter;
@@ -9,7 +9,7 @@ import {
9
9
  parseFeaturesCsv,
10
10
  parseFeaturesParam,
11
11
  toolMatchesFeatures
12
- } from "./chunk-ZX3XIJ7S.js";
12
+ } from "./chunk-VBXXUK5G.js";
13
13
  export {
14
14
  ALL_FEATURE_GROUPS,
15
15
  DEFAULT_FEATURE_GROUPS,