pi-mcp-adapter 5.1.0 → 5.2.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/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.2.0] - 2026-10-09
11
+
12
+ ### Highlights
13
+
14
+ - Fixes the MCP SDK security advisory GHSA-6qxp-vccf-f47h, so a malicious MCP server can no longer collect the tokens saved from an earlier sign-in.
15
+ - When the model lists a server's tools, it now sees each tool's parameter names, so fewer calls fail on guessed argument names.
16
+ - `pi-mcp-adapter doctor` now agrees with Pi about which project servers are trusted.
17
+ - Jev semantic search can use a System One server running on your own machine.
18
+
19
+ ### Changed
20
+
21
+ - `mcp({ server })` now lists each tool's parameter names, required ones first, for example `get_record(record_id, fields?)`. Models used to guess names like `id` for `record_id` and lose a turn to the validation error. Types and nested fields are still shown only by `describe`. Thanks to [@rakesh-vs](https://github.com/rakesh-vs) for [PR #817](https://github.com/nicobailon/pi-mcp-adapter/pull/817).
22
+
23
+ ### Fixed
24
+
25
+ - `pi-mcp-adapter doctor` no longer reports project servers as blocked by project trust when a Pi session in the same folder would trust the project. When the adapter is installed as a Pi package, the doctor now finds Pi through the `pi` on your PATH. Like Pi, it trusts a project that has no Pi-specific project files, such as `.pi/settings.json`. Thanks to [@felipe-saavedra](https://github.com/felipe-saavedra) for reporting it in [#809](https://github.com/nicobailon/pi-mcp-adapter/issues/809).
26
+ - Running Pi once with `--mcp-config <file>`, for example `pi -e <adapter> --mcp-config <file> -p ...`, no longer adds `"-builtin:mcp"` to your Pi `settings.json`. The same goes for a `configPath` passed to `createMcpAdapter()`. Pi already leaves its built-in MCP out of those runs. An installed adapter without a config path still turns the built-in off once, as before. Thanks to [@deniskern](https://github.com/deniskern) for reporting it in [#811](https://github.com/nicobailon/pi-mcp-adapter/issues/811).
27
+ - `SYSTEMONE_ENDPOINT` can point at a System One server on your own machine, such as `http://127.0.0.1:8080/v1/systemone`. Plain `http` is accepted only on `localhost`, `127.0.0.0/8`, and `[::1]`; every other endpoint still needs `https`. A local server that ignores keys still needs some non-empty `SYSTEMONE_API_KEY`. Thanks to [@amchen2310](https://github.com/amchen2310) for reporting it in [#810](https://github.com/nicobailon/pi-mcp-adapter/issues/810).
28
+
29
+ ### Security
30
+
31
+ - The MCP SDK packages move from 2.0.0 to 2.3.1, which fixes [GHSA-6qxp-vccf-f47h](https://github.com/advisories/GHSA-6qxp-vccf-f47h). With 2.0.0, a malicious or compromised MCP server could point sign-in at its own authorization server and receive the refresh token and client secret saved from an earlier sign-in. `npm audit` no longer flags the adapter. One side effect: a server URL that redirects to a different host is no longer followed, so put the final URL in your config. A redirect from `http` to `https` on the same host still works. Thanks to [@cash-flow-king](https://github.com/cash-flow-king) for reporting it in [#816](https://github.com/nicobailon/pi-mcp-adapter/issues/816) and to [@rakesh-vs](https://github.com/rakesh-vs) for [PR #819](https://github.com/nicobailon/pi-mcp-adapter/pull/819).
32
+
10
33
  ## [5.1.0] - 2026-10-05
11
34
 
12
35
  ### Highlights
package/cli.js CHANGED
@@ -480,6 +480,50 @@ function describeConnectError(err, definition, url) {
480
480
  return parts.length > 0 ? parts.join(" — ") : "connection failed";
481
481
  }
482
482
 
483
+ const PI_CORE_PACKAGE = "@earendil-works/pi-coding-agent";
484
+
485
+ // Pi is a peer dependency and doesn't resolve when this CLI is installed as a Pi package, so fall
486
+ // back to the Pi install behind the first `pi` on PATH, the binary the doctor runs for `pi --version`.
487
+ async function importPiCore() {
488
+ try {
489
+ return await import(PI_CORE_PACKAGE);
490
+ } catch (err) {
491
+ const names = process.platform === "win32" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").map((ext) => `pi${ext}`) : ["pi"];
492
+ const bin = (process.env.PATH ?? "").split(path.delimiter).filter(Boolean)
493
+ .flatMap((dir) => names.map((name) => path.join(dir, name)))
494
+ .find((file) => {
495
+ try {
496
+ fs.accessSync(file, fs.constants.X_OK);
497
+ return fs.statSync(file).isFile();
498
+ } catch {
499
+ return false;
500
+ }
501
+ });
502
+ if (!bin) throw err;
503
+ const isPiCore = (dir) => {
504
+ const file = path.join(dir, "package.json");
505
+ return fs.existsSync(file) && JSON.parse(fs.readFileSync(file, "utf8")).name === PI_CORE_PACKAGE;
506
+ };
507
+ let root;
508
+ if (/\.(cmd|ps1)$/i.test(bin)) {
509
+ // Windows npm shims sit beside the prefix's node_modules and name the package they launch.
510
+ const shimmed = path.join(path.dirname(bin), "node_modules", PI_CORE_PACKAGE);
511
+ if (/node_modules[\\/]@earendil-works[\\/]pi-coding-agent[\\/]/i.test(fs.readFileSync(bin, "utf8")) && isPiCore(shimmed)) root = shimmed;
512
+ } else {
513
+ // npm links bin/pi to a file inside Pi's package; only the package that owns that file counts.
514
+ for (let dir = path.dirname(fs.realpathSync(bin)); !root; dir = path.dirname(dir)) {
515
+ if (isPiCore(dir)) root = dir;
516
+ else if (path.dirname(dir) === dir) break;
517
+ }
518
+ }
519
+ if (!root) throw err;
520
+ const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
521
+ const target = pkg.exports?.["."];
522
+ const entry = typeof target === "string" ? target : target?.import ?? pkg.main;
523
+ return import(pathToFileURL(path.join(root, entry)).href);
524
+ }
525
+ }
526
+
483
527
  async function runDoctor(argv, log, error) {
484
528
  const json = argv[0] === "--json";
485
529
  if (argv.length > (json ? 1 : 0)) {
@@ -516,9 +560,13 @@ async function runDoctor(argv, log, error) {
516
560
  let projectTrusted = false;
517
561
  if (loaded.projectServers.size > 0) {
518
562
  try {
519
- // Pi is a peer dependency and may not resolve from where this CLI is installed.
520
- const { ProjectTrustStore } = await import("@earendil-works/pi-coding-agent");
521
- projectTrusted = new ProjectTrustStore(agentDir.getAgentDir()).get(cwd) === true;
563
+ const pi = await importPiCore();
564
+ // Past this check Pi first runs project_trust extension handlers, which doctor can't, so only a stored "trusted" decision counts.
565
+ if (typeof pi.hasTrustRequiringProjectResources === "function" && !pi.hasTrustRequiringProjectResources(cwd)) {
566
+ projectTrusted = true;
567
+ } else {
568
+ projectTrusted = new pi.ProjectTrustStore(agentDir.getAgentDir()).get(cwd) === true;
569
+ }
522
570
  } catch (err) {
523
571
  error(`Could not read Pi's project trust, so project servers are treated as untrusted: ${utils.formatTerminalError(err)}`);
524
572
  }
@@ -32,7 +32,14 @@ function validateApiKey(value) {
32
32
  return value;
33
33
  }
34
34
  /**
35
- * Constrains the operator-supplied endpoint to an absolute HTTPS URL without credentials, query, or fragment, so
35
+ * The endpoint receives the API key and judgment payload, so plaintext http is allowed only where it cannot leave the
36
+ * machine: literal loopback names and addresses, never names that merely resolve to loopback.
37
+ */
38
+ function isLoopbackHostname(hostname) {
39
+ return hostname === "localhost" || hostname === "[::1]" || /^127\.\d+\.\d+\.\d+$/.test(hostname);
40
+ }
41
+ /**
42
+ * Constrains the operator-supplied endpoint to an absolute HTTPS (or loopback HTTP) URL without credentials, query, or fragment, so
36
43
  * the pinned fetch can match it exactly and a stray value cannot redirect requests or smuggle a query string.
37
44
  */
38
45
  function parseEndpoint(raw, label) {
@@ -49,8 +56,9 @@ function parseEndpoint(raw, label) {
49
56
  catch {
50
57
  throw new Error(`${label} must be an absolute URL`);
51
58
  }
52
- if (url.protocol !== "https:")
53
- throw new Error(`${label} must use https`);
59
+ if (url.protocol !== "https:" && !(url.protocol === "http:" && isLoopbackHostname(url.hostname))) {
60
+ throw new Error(`${label} must use https, except http on localhost, 127.0.0.0/8, or [::1]`);
61
+ }
54
62
  if (url.username !== "" || url.password !== "")
55
63
  throw new Error(`${label} must not embed credentials`);
56
64
  if (url.search !== "")
@@ -1 +1 @@
1
- {"version":3,"file":"jev-key-store.js","sourceRoot":"","sources":["../jev-key-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA2B,MAAM,qBAAqB,CAAC;AAExF,4EAA4E;AAC5E,MAAM,CAAC,MAA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,IAAI,CAAC;QACH,WAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB;YAAE,WAAW,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,MAAM,IAAI,uBAAuB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAAC,CAAC;AACzE,CAAC"}
@@ -62,7 +62,7 @@ On Pi 0.84 to 0.87, the adapter does not read either file. If you used one with
62
62
 
63
63
  On Pi 0.99 and later, the adapter replaces Pi's built-in MCP extension in sessions, except when a host supplies its own config through [`createMcpAdapter()`](extension-api.md#sdk-configuration). Both register `/mcp`, and Pi leaves the built-in out when another extension does, so `/mcp` opens the adapter and only the adapter connects the servers in Pi's `mcp.json` files.
64
64
 
65
- While the built-in is turned on, Pi warns at every startup and `/reload` that it was not loaded. So on the first start after you install or update the adapter, the adapter turns it off for you: it adds `"-builtin:mcp"` to `extensions` in Pi's user `settings.json`, the same entry `pi config` writes, and says so once. It never changes project settings and leaves any existing `builtin:mcp` entry alone, so turning the built-in back on under Built-in extensions in `pi config` sticks. If you remove the adapter, turn the built-in back on there to get Pi's MCP support again.
65
+ While the built-in is turned on, Pi warns at every startup and `/reload` that it was not loaded. So on the first start after you install or update the adapter, the adapter turns it off for you: it adds `"-builtin:mcp"` to `extensions` in Pi's user `settings.json`, the same entry `pi config` writes, and says so once. It skips this when the process was given a config path with `--mcp-config` or the `configPath` option, so a one-off run such as `pi -e <adapter> --mcp-config <file> -p ...` leaves your settings alone; the adapter still owns `/mcp` in that process. It never changes project settings and leaves any existing `builtin:mcp` entry alone, so turning the built-in back on under Built-in extensions in `pi config` sticks. If you remove the adapter, turn the built-in back on there to get Pi's MCP support again.
66
66
 
67
67
  Pi's shell commands `pi mcp add`, `list`, `login`, and `logout` still use Pi's own files. Servers added with `pi mcp add` are read as described above. Sign-ins made with `pi mcp login` stay in Pi's `mcp-auth.json`: the adapter can [import them](auth.md#import-a-sign-in-from-pis-built-in-mcp), but later sign-ins and sign-outs on either side are not shared.
68
68
 
@@ -117,7 +117,7 @@ In print, JSON, and RPC sessions, an unapproved project server is skipped. To in
117
117
 
118
118
  `pi-mcp-adapter doctor` loads the config a session in the current directory would (including Pi's own `mcp.json` files when `pi --version` reports 0.99 or later), gives each enabled server 15 seconds to connect, and prints one line per server: name, state (`ok`, `failed`, `needs-auth`, `blocked`, or `disabled`), tool count, and the error or a hint. Secret commands (`!command` values) run with their own timeouts. `--json` prints the same report as a JSON array. It exits 1 when an enabled server fails or needs a sign-in; blocked and disabled servers don't count.
119
119
 
120
- Project servers follow the trust and approval rules above as in a non-interactive session. If Pi can't be loaded from where the CLI is installed, the project is treated as untrusted. Doctor never starts OAuth: a server without a stored sign-in is reported as `needs-auth`; sign in with `/mcp-auth <server>` in Pi. Errors show only what the adapter can state itself, such as the HTTP status, network error code, or endpoint probe result; doctor never prints server output, response bodies, or configured secrets. Run a failing command directly to see its output.
120
+ Project servers follow the trust and approval rules above as in a non-interactive session. Like Pi, doctor trusts a project without trust-requiring Pi resources (such as `.pi/settings.json` or a project `.agents/skills`). Otherwise it needs Pi's stored trust decision for the project, because it can't run the Pi extensions a session asks first. It loads Pi from where the CLI is installed, or else from the Pi package that provides the `pi` on PATH; if neither works, the project is treated as untrusted. Doctor never starts OAuth: a server without a stored sign-in is reported as `needs-auth`; sign in with `/mcp-auth <server>` in Pi. Errors show only what the adapter can state itself, such as the HTTP status, network error code, or endpoint probe result; doctor never prints server output, response bodies, or configured secrets. Run a failing command directly to see its output.
121
121
 
122
122
  ## Lifecycle Modes
123
123
 
package/docs/scripting.md CHANGED
@@ -40,12 +40,13 @@ System One decisions are the same API at different origins, so pointing at anoth
40
40
  | OpenCode Zen | `https://opencode.ai/zen/v1/systemone` | `jev-1.13` |
41
41
  | Command Code | `https://api.commandcode.ai/provider/v1/systemone` | `typesafe/jev` |
42
42
  | OpenRouter | `https://openrouter.ai/api/alpha/decisions` | `typesafe/jev-1.13` |
43
+ | Local server | `http://127.0.0.1:8080/v1/systemone` | the model your server serves |
43
44
 
44
45
  These are example configurations, subject to each provider's current documentation ([OpenCode Zen](https://opencode.ai/docs/zen/), [Command Code](https://commandcode.ai/docs/provider), [OpenRouter](https://openrouter.ai/docs/guides/community/jev), [TypeSafe](https://docs.typesafe.ai/)).
45
46
 
46
47
  With `SYSTEMONE_ENDPOINT` pointed at OpenRouter, an existing `OPENROUTER_API_KEY` works as the key and the model defaults to `typesafe/jev-1.13`. `OPENROUTER_API_KEY` is never sent to any other endpoint, and `SYSTEMONE_API_KEY` takes precedence over it.
47
48
 
48
- The endpoint must be an absolute `https` URL with a path. A set-but-invalid `SYSTEMONE_ENDPOINT` disables Jev instead of falling back to the default. Treat the endpoint as trusted configuration: it receives the API key and the judgment payload. Credentials are stored per endpoint, so switching endpoints does not overwrite a saved key. Set the model with:
49
+ The endpoint must be an absolute `https` URL with a path; plain `http` is accepted only on `localhost`, `127.0.0.0/8`, or `[::1]`, so the key and payload never leave the machine unencrypted. A local server that ignores keys still needs some non-empty `SYSTEMONE_API_KEY`, because Jev does not run without a key. A set-but-invalid `SYSTEMONE_ENDPOINT` disables Jev instead of falling back to the default. Treat the endpoint as trusted configuration: it receives the API key and the judgment payload. Credentials are stored per endpoint, so switching endpoints does not overwrite a saved key. Set the model with:
49
50
 
50
51
  ```json
51
52
  { "settings": { "jev": { "model": "jev-1.13" } } }
package/docs/tools.md CHANGED
@@ -31,6 +31,8 @@ When a server declares MCP tool annotations, `describe` adds a `Hints:` line suc
31
31
 
32
32
  When `includeSchemas` is enabled, search and describe render common JSON Schema parameters as compact TypeScript shapes like `{ query: string; limit?: number; }`, with the older schema formatter retained as a fallback for unsupported schemas.
33
33
 
34
+ `mcp({ server: "name" })` lists each tool's top-level parameter names after its name, required ones first, such as `- search(query, limit?) - ...`. Types and nested fields stay in `describe`. A tool whose schema has no properties shows `()`. A tool with no schema, or one whose top level uses `$ref`, `allOf`, `anyOf`, `oneOf`, `not`, `if`/`then`/`else`, or dependent requirements, shows no parentheses, because those can add parameters or requirements the list would miss.
35
+
34
36
  Most tools declare no output schema. After such a tool returns structured content or a JSON text result, `describe` (and `tools.describe` in `mcpScript`) also shows the output shape seen so far: field names and types only, never values, labeled as observed, not a contract. A wide object that appears more than once, such as a user under `user`, `assignee`, and `assignees`, is written once as a named type. With `scriptMode` on, shapes are also saved in `mcp-cache.json`, so later sessions can write a script without calling the tool first. A shape is used only while the tool's description and input schema stay the same, and a saved one is dropped when they or the server's config change.
35
37
 
36
38
  When an `mcpScript` run throws, times out, or returns `[]`, `{}`, `null`, `""`, or nothing, its result ends with the shapes seen from the schemaless tools it called, so the model can fix a wrong field guess without a separate look at the data.
package/index.ts CHANGED
@@ -1342,7 +1342,8 @@ function installMcpAdapter(pi: ExtensionAPI, options: McpAdapterOptions) {
1342
1342
  }
1343
1343
 
1344
1344
  if (generation !== lifecycleGeneration || !owner.isActive()) return;
1345
- if (!programmaticConfig && piSupportsMcp(pi)) {
1345
+ // An explicit config path marks a one-off process; Pi already skips its built-in for it because /mcp is ours.
1346
+ if (!programmaticConfig && earlyConfigPath === undefined && piSupportsMcp(pi)) {
1346
1347
  const report = (message: string, level: "info" | "warning") => {
1347
1348
  if (generation !== lifecycleGeneration || !owner.isActive()) return;
1348
1349
  if (ctx.hasUI) ctx.ui.notify(message, level);
package/jev-key-store.ts CHANGED
@@ -59,7 +59,15 @@ function validateApiKey(value: unknown): string {
59
59
  }
60
60
 
61
61
  /**
62
- * Constrains the operator-supplied endpoint to an absolute HTTPS URL without credentials, query, or fragment, so
62
+ * The endpoint receives the API key and judgment payload, so plaintext http is allowed only where it cannot leave the
63
+ * machine: literal loopback names and addresses, never names that merely resolve to loopback.
64
+ */
65
+ function isLoopbackHostname(hostname: string): boolean {
66
+ return hostname === "localhost" || hostname === "[::1]" || /^127\.\d+\.\d+\.\d+$/.test(hostname);
67
+ }
68
+
69
+ /**
70
+ * Constrains the operator-supplied endpoint to an absolute HTTPS (or loopback HTTP) URL without credentials, query, or fragment, so
63
71
  * the pinned fetch can match it exactly and a stray value cannot redirect requests or smuggle a query string.
64
72
  */
65
73
  function parseEndpoint(raw: string, label: string): ResolvedJevEndpoint {
@@ -69,7 +77,9 @@ function parseEndpoint(raw: string, label: string): ResolvedJevEndpoint {
69
77
  let url: URL;
70
78
  try { url = new URL(raw); }
71
79
  catch { throw new Error(`${label} must be an absolute URL`); }
72
- if (url.protocol !== "https:") throw new Error(`${label} must use https`);
80
+ if (url.protocol !== "https:" && !(url.protocol === "http:" && isLoopbackHostname(url.hostname))) {
81
+ throw new Error(`${label} must use https, except http on localhost, 127.0.0.0/8, or [::1]`);
82
+ }
73
83
  if (url.username !== "" || url.password !== "") throw new Error(`${label} must not embed credentials`);
74
84
  if (url.search !== "") throw new Error(`${label} must not include a query string`);
75
85
  if (url.hash !== "") throw new Error(`${label} must not include a fragment`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mcp-adapter",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "MCP (Model Context Protocol) adapter extension for Pi coding agent",
5
5
  "type": "module",
6
6
  "types": "./index.ts",
@@ -182,8 +182,8 @@
182
182
  "dist"
183
183
  ],
184
184
  "dependencies": {
185
- "@modelcontextprotocol/client": "2.0.0",
186
- "@modelcontextprotocol/core": "2.0.0",
185
+ "@modelcontextprotocol/client": "2.3.1",
186
+ "@modelcontextprotocol/core": "2.3.1",
187
187
  "@modelcontextprotocol/ext-tasks": "^0.1.0",
188
188
  "@napi-rs/keyring": "^2.1.0",
189
189
  "@typesafe-ai/sdk": "0.6.0",
package/proxy-modes.ts CHANGED
@@ -1062,17 +1062,9 @@ export function executeList(state: McpExtensionState, server: string): ProxyTool
1062
1062
  }
1063
1063
  let text = `${server} (${toolNames.length} tools${cachedNote}):${descriptionText}\n\n`;
1064
1064
 
1065
- const descMap = new Map<string, string>();
1066
- if (metadata) {
1067
- for (const m of metadata) {
1068
- descMap.set(m.name, m.description);
1069
- }
1070
- }
1071
-
1072
- for (const tool of toolNames) {
1073
- const desc = descMap.get(tool) ?? "";
1074
- const truncated = truncateAtWord(desc, 50);
1075
- text += `- ${tool}`;
1065
+ for (const toolMeta of metadata ?? []) {
1066
+ const truncated = truncateAtWord(toolMeta.description, 50);
1067
+ text += `- ${toolMeta.name}${formatParameterNames(toolMeta)}`;
1076
1068
  if (truncated) text += ` - ${truncated}`;
1077
1069
  text += "\n";
1078
1070
  }
@@ -1085,6 +1077,29 @@ export function executeList(state: McpExtensionState, server: string): ProxyTool
1085
1077
  };
1086
1078
  }
1087
1079
 
1080
+ const PARAMETER_NAME_UNREADABLE_KEYWORDS = ["$ref", "allOf", "anyOf", "oneOf", "not", "if", "then", "else", "dependentRequired", "dependentSchemas", "dependencies"];
1081
+
1082
+ /** Top-level parameter names, required first, e.g. `(query, limit?)`; empty when the schema can't be read. */
1083
+ function formatParameterNames(toolMeta: ToolMetadata): string {
1084
+ if (toolMeta.resourceUri) return "()";
1085
+ const schema = toolMeta.inputSchema;
1086
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) return "";
1087
+ // Composed or conditional schemas can add properties or requirements that a top-level read would miss.
1088
+ if (PARAMETER_NAME_UNREADABLE_KEYWORDS.some(keyword => Object.hasOwn(schema, keyword))) return "";
1089
+ const { properties, required } = schema as { properties?: unknown; required?: unknown };
1090
+ if (required !== undefined && !Array.isArray(required)) return "";
1091
+ if (properties !== undefined && (!properties || typeof properties !== "object" || Array.isArray(properties))) return "";
1092
+ const requiredSet = new Set((required ?? []).filter((name): name is string => typeof name === "string"));
1093
+ if (properties === undefined && requiredSet.size === 0 && (schema as { type?: unknown }).type !== "object") return "";
1094
+ const names = properties ? Object.keys(properties) : [];
1095
+ const ordered = [
1096
+ ...names.filter(name => requiredSet.has(name)),
1097
+ ...[...requiredSet].filter(name => !names.includes(name)),
1098
+ ...names.filter(name => !requiredSet.has(name)).map(name => `${name}?`),
1099
+ ];
1100
+ return `(${ordered.join(", ")})`;
1101
+ }
1102
+
1088
1103
  export function executeInstructions(state: McpExtensionState, server: string): ProxyToolResult {
1089
1104
  const definition = state.config.mcpServers[server];
1090
1105
  if (!definition) {