@mcpview/compose 0.10.0 → 0.12.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +92 -2
  3. package/esm/_dnt.polyfills.d.ts +6 -6
  4. package/esm/_dnt.polyfills.d.ts.map +1 -1
  5. package/esm/src/code-mode/board.d.ts +62 -0
  6. package/esm/src/code-mode/board.d.ts.map +1 -0
  7. package/esm/src/code-mode/board.js +86 -0
  8. package/esm/src/code-mode/chain.d.ts +20 -0
  9. package/esm/src/code-mode/chain.d.ts.map +1 -0
  10. package/esm/src/code-mode/chain.js +240 -0
  11. package/esm/src/code-mode/connections.d.ts +33 -0
  12. package/esm/src/code-mode/connections.d.ts.map +1 -0
  13. package/esm/src/code-mode/connections.js +120 -0
  14. package/esm/src/code-mode/mod.d.ts +8 -0
  15. package/esm/src/code-mode/mod.d.ts.map +1 -0
  16. package/esm/src/code-mode/mod.js +6 -0
  17. package/esm/src/code-mode/provider-tools.d.ts +38 -0
  18. package/esm/src/code-mode/provider-tools.d.ts.map +1 -0
  19. package/esm/src/code-mode/provider-tools.js +113 -0
  20. package/esm/src/code-mode/providers.d.ts +20 -0
  21. package/esm/src/code-mode/providers.d.ts.map +1 -0
  22. package/esm/src/code-mode/providers.js +9 -0
  23. package/esm/src/code-mode/sandbox.d.ts +10 -0
  24. package/esm/src/code-mode/sandbox.d.ts.map +1 -0
  25. package/esm/src/code-mode/sandbox.js +147 -0
  26. package/esm/src/code-mode/tool.d.ts +13 -0
  27. package/esm/src/code-mode/tool.d.ts.map +1 -0
  28. package/esm/src/code-mode/tool.js +54 -0
  29. package/esm/src/core/types/mcp-apps.d.ts +1 -1
  30. package/esm/src/host/renderer/js/event-bus.d.ts.map +1 -1
  31. package/esm/src/host/renderer/js/event-bus.js +4 -3
  32. package/esm/src/runtime/cluster.d.ts.map +1 -1
  33. package/esm/src/runtime/cluster.js +38 -10
  34. package/esm/src/runtime/types.d.ts +3 -3
  35. package/esm/src/runtime/types.d.ts.map +1 -1
  36. package/esm/src/sdk/mcp-sdk.d.ts +4 -4
  37. package/esm/src/sdk/mcp-sdk.js +2 -2
  38. package/esm/src/version.d.ts +1 -1
  39. package/esm/src/version.js +1 -1
  40. package/package.json +17 -3
  41. package/script/_dnt.polyfills.d.ts +6 -6
  42. package/script/_dnt.polyfills.d.ts.map +1 -1
  43. package/script/src/code-mode/board.d.ts +62 -0
  44. package/script/src/code-mode/board.d.ts.map +1 -0
  45. package/script/src/code-mode/board.js +91 -0
  46. package/script/src/code-mode/chain.d.ts +20 -0
  47. package/script/src/code-mode/chain.d.ts.map +1 -0
  48. package/script/src/code-mode/chain.js +243 -0
  49. package/script/src/code-mode/connections.d.ts +33 -0
  50. package/script/src/code-mode/connections.d.ts.map +1 -0
  51. package/script/src/code-mode/connections.js +123 -0
  52. package/script/src/code-mode/mod.d.ts +8 -0
  53. package/script/src/code-mode/mod.d.ts.map +1 -0
  54. package/script/src/code-mode/mod.js +13 -0
  55. package/script/src/code-mode/provider-tools.d.ts +38 -0
  56. package/script/src/code-mode/provider-tools.d.ts.map +1 -0
  57. package/script/src/code-mode/provider-tools.js +116 -0
  58. package/script/src/code-mode/providers.d.ts +20 -0
  59. package/script/src/code-mode/providers.d.ts.map +1 -0
  60. package/script/src/code-mode/providers.js +13 -0
  61. package/script/src/code-mode/sandbox.d.ts +10 -0
  62. package/script/src/code-mode/sandbox.d.ts.map +1 -0
  63. package/script/src/code-mode/sandbox.js +152 -0
  64. package/script/src/code-mode/tool.d.ts +13 -0
  65. package/script/src/code-mode/tool.d.ts.map +1 -0
  66. package/script/src/code-mode/tool.js +57 -0
  67. package/script/src/core/types/mcp-apps.d.ts +1 -1
  68. package/script/src/host/renderer/js/event-bus.d.ts.map +1 -1
  69. package/script/src/host/renderer/js/event-bus.js +4 -3
  70. package/script/src/runtime/cluster.d.ts.map +1 -1
  71. package/script/src/runtime/cluster.js +60 -32
  72. package/script/src/runtime/types.d.ts +3 -3
  73. package/script/src/runtime/types.d.ts.map +1 -1
  74. package/script/src/sdk/mcp-sdk.d.ts +4 -4
  75. package/script/src/sdk/mcp-sdk.js +2 -2
  76. package/script/src/version.d.ts +1 -1
  77. package/script/src/version.js +1 -1
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maxCodeLength = void 0;
4
+ exports.encodeValue = encodeValue;
5
+ exports.runProgram = runProgram;
6
+ const quickjs_emscripten_1 = require("quickjs-emscripten");
7
+ /** Maximum source length accepted by the code-mode execute tool. */
8
+ exports.maxCodeLength = 16_384;
9
+ const maxValueLength = 128 * 1024;
10
+ const maxOperations = 16;
11
+ /** Serialize data crossing the QuickJS boundary within the supplied limit. */
12
+ function encodeValue(value, limit = maxValueLength) {
13
+ const text = JSON.stringify(value);
14
+ if (text === undefined || text.length > limit) {
15
+ throw new Error("Expected a JSON value within the size limit.");
16
+ }
17
+ return text;
18
+ }
19
+ /** Wait for host I/O without allowing a provider that ignores cancellation to hold the VM open. */
20
+ function waitForOperation(invoke, signal) {
21
+ signal.throwIfAborted();
22
+ return new Promise((resolve, reject) => {
23
+ const abort = () => reject(signal.reason);
24
+ signal.addEventListener("abort", abort, { once: true });
25
+ Promise.resolve().then(() => {
26
+ signal.throwIfAborted();
27
+ return invoke();
28
+ }).then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
29
+ });
30
+ }
31
+ /**
32
+ * Run a function body in an isolated QuickJS context. Only JSON and explicit snippet
33
+ * operations cross into the host. Execute host requests when the guest yields.
34
+ */
35
+ async function runProgram(code, params, invoke, callerSignal) {
36
+ if (typeof code !== "string" || !code.trim() || code.length > exports.maxCodeLength) {
37
+ throw new Error("Supply a JavaScript function body of at most 16 KiB.");
38
+ }
39
+ callerSignal?.throwIfAborted();
40
+ const wasm = await (0, quickjs_emscripten_1.getQuickJS)();
41
+ callerSignal?.throwIfAborted();
42
+ const controller = new AbortController();
43
+ const signal = controller.signal;
44
+ const abort = () => controller.abort(callerSignal?.reason);
45
+ callerSignal?.addEventListener("abort", abort, { once: true });
46
+ const timer = setTimeout(() => controller.abort(new Error("JavaScript exceeded its time limit.")), 30_000);
47
+ try {
48
+ return await quickjs_emscripten_1.Scope.withScopeAsync(async (scope) => {
49
+ const vm = scope.manage(wasm.newContext());
50
+ let cpuDeadline = performance.now() + 2000;
51
+ vm.runtime.setMemoryLimit(12 * 1024 * 1024);
52
+ vm.runtime.setMaxStackSize(192 * 1024);
53
+ vm.runtime.setInterruptHandler(() => signal.aborted || performance.now() >= cpuDeadline);
54
+ const stringify = scope.manage(vm.unwrapResult(vm.evalCode("JSON.stringify.bind(JSON)")));
55
+ const parse = scope.manage(vm.unwrapResult(vm.evalCode("JSON.parse.bind(JSON)")));
56
+ const pending = [];
57
+ let calls = 0;
58
+ function read(handle) {
59
+ const encoded = vm.unwrapResult(vm.callFunction(stringify, vm.undefined, handle));
60
+ try {
61
+ if (vm.typeof(encoded) !== "string")
62
+ throw new Error("Expected a JSON value.");
63
+ const text = vm.getString(encoded);
64
+ if (text.length > maxValueLength)
65
+ throw new Error("JSON value exceeds the size limit.");
66
+ return JSON.parse(text);
67
+ }
68
+ finally {
69
+ encoded.dispose();
70
+ }
71
+ }
72
+ function decode(value) {
73
+ const encoded = vm.newString(encodeValue(value));
74
+ try {
75
+ return scope.manage(vm.unwrapResult(vm.callFunction(parse, vm.undefined, encoded)));
76
+ }
77
+ finally {
78
+ encoded.dispose();
79
+ }
80
+ }
81
+ const dispatch = scope.manage(vm.newFunction("dispatch", (name, args) => {
82
+ if (++calls > maxOperations || vm.typeof(name) !== "string") {
83
+ throw new Error("Snippet operation limit exceeded.");
84
+ }
85
+ const operation = vm.getString(name);
86
+ const arguments_ = read(args);
87
+ if (!Array.isArray(arguments_))
88
+ throw new Error("Expected snippet arguments.");
89
+ const deferred = scope.manage(vm.newPromise());
90
+ pending.push(async () => {
91
+ try {
92
+ const result = await waitForOperation(() => invoke(operation, arguments_, signal), signal);
93
+ signal.throwIfAborted();
94
+ deferred.resolve(decode(result));
95
+ }
96
+ catch (error) {
97
+ const message = scope.manage(vm.newString(error instanceof Error ? error.message : "Snippet failed."));
98
+ deferred.reject(message);
99
+ }
100
+ });
101
+ return deferred.handle.dup();
102
+ }));
103
+ vm.setProp(vm.global, "dispatch", dispatch);
104
+ vm.setProp(vm.global, "params", decode(params));
105
+ const promise = scope.manage(vm.unwrapResult(vm.evalCode(`(() => {
106
+ const call = globalThis.dispatch, params = globalThis.params;
107
+ delete globalThis.dispatch;
108
+ delete globalThis.params;
109
+ const api = Object.freeze({
110
+ params,
111
+ listSnippets: (...args) => call("listSnippets", args),
112
+ runSnippet: (...args) => call("runSnippet", args),
113
+ panel: (...args) => call("panel", args),
114
+ });
115
+ return (async function(api) { "use strict";\n${code}\n})(api);
116
+ })()`, "mcpview-code-mode.js", { type: "global" })));
117
+ for (;;) {
118
+ signal.throwIfAborted();
119
+ if (performance.now() >= cpuDeadline) {
120
+ throw new Error("JavaScript exceeded its time limit.");
121
+ }
122
+ const state = vm.getPromiseState(promise);
123
+ if (state.type === "fulfilled") {
124
+ const value = scope.manage(state.value);
125
+ if (pending.length) {
126
+ throw new Error("Await every snippet operation, including api.panel().");
127
+ }
128
+ return vm.typeof(value) === "undefined" ? null : read(value);
129
+ }
130
+ if (state.type === "rejected") {
131
+ const reason = scope.manage(state.error);
132
+ throw new Error(vm.typeof(reason) === "string" ? vm.getString(reason) : "JavaScript failed.");
133
+ }
134
+ if (vm.runtime.hasPendingJob()) {
135
+ vm.unwrapResult(vm.runtime.executePendingJobs(1));
136
+ }
137
+ else if (pending.length) {
138
+ const before = performance.now();
139
+ await pending.shift()();
140
+ cpuDeadline += performance.now() - before;
141
+ }
142
+ else {
143
+ throw new Error("JavaScript is waiting on an unresolved promise.");
144
+ }
145
+ }
146
+ });
147
+ }
148
+ finally {
149
+ clearTimeout(timer);
150
+ callerSignal?.removeEventListener("abort", abort);
151
+ }
152
+ }
@@ -0,0 +1,13 @@
1
+ import type { MCPTool } from "@mcpview/server";
2
+ import type { SnippetProvider } from "./providers.js";
3
+ /** Configure the single model-facing tool and its MCP Apps board resource. */
4
+ export interface SnippetExecuteToolOptions {
5
+ readonly resourceUri: string;
6
+ readonly providers: ReadonlyMap<string, Pick<SnippetProvider, "names">>;
7
+ /** Enable this when the chain uses a catalog and the host supplies a trusted scope. */
8
+ readonly savedChains?: boolean;
9
+ readonly annotations?: MCPTool["annotations"];
10
+ }
11
+ /** Build the tool declaration for registration with an MCPView server. */
12
+ export declare function createSnippetExecuteTool(options: SnippetExecuteToolOptions): MCPTool;
13
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/src/code-mode/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE,uFAAuF;IACvF,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC/C;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAqDpF"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSnippetExecuteTool = createSnippetExecuteTool;
4
+ const sandbox_js_1 = require("./sandbox.js");
5
+ /** Build the tool declaration for registration with an MCPView server. */
6
+ function createSnippetExecuteTool(options) {
7
+ if (!options.resourceUri.startsWith("ui://") || !URL.canParse(options.resourceUri) ||
8
+ !new URL(options.resourceUri).host) {
9
+ throw new Error("Supply a ui:// resource URI for the board.");
10
+ }
11
+ const available = [...options.providers.keys()];
12
+ return {
13
+ name: "execute",
14
+ description: [
15
+ "Run a JavaScript function body with api.params (the supplied JSON object).",
16
+ "Use await api.listSnippets(provider) to discover approved snippets.",
17
+ "Configured provider aliases: " + JSON.stringify(available) + ".",
18
+ "await api.runSnippet(provider, name, input) returns a receipt {id, value}.",
19
+ "Pass values between calls. Use await api.panel(receipt.id, optionalTitle) for each result to display, in display order. Return a JSON summary.",
20
+ ...(options.savedChains
21
+ ? [
22
+ "Use saveAs to save a successful chain, listSaved to list your saved chains, or replay with the saved name and new params.",
23
+ ]
24
+ : []),
25
+ ].join(" "),
26
+ inputSchema: {
27
+ type: "object",
28
+ additionalProperties: false,
29
+ properties: {
30
+ code: { type: "string", minLength: 1, maxLength: sandbox_js_1.maxCodeLength },
31
+ params: { type: "object" },
32
+ ...(options.savedChains
33
+ ? {
34
+ saveAs: { type: "string", minLength: 1, maxLength: 256 },
35
+ replay: { type: "string", minLength: 1, maxLength: 256 },
36
+ listSaved: { type: "boolean", const: true },
37
+ }
38
+ : {}),
39
+ },
40
+ ...(options.savedChains
41
+ ? { oneOf: [{ required: ["code"] }, { required: ["replay"] }, { required: ["listSaved"] }] }
42
+ : { required: ["code"] }),
43
+ },
44
+ annotations: {
45
+ readOnlyHint: false,
46
+ destructiveHint: true,
47
+ idempotentHint: false,
48
+ openWorldHint: true,
49
+ ...options.annotations,
50
+ ...(options.savedChains ? { readOnlyHint: false } : {}),
51
+ },
52
+ _meta: {
53
+ ui: { resourceUri: options.resourceUri, visibility: ["model"] },
54
+ ...{ "openai/outputTemplate": options.resourceUri },
55
+ },
56
+ };
57
+ }
@@ -31,7 +31,7 @@ export type McpUiPermissions = McpUiResourcePermissions;
31
31
  * Shape of an MCP tool call result that may contain UI metadata.
32
32
  *
33
33
  * Structural subset used by the compose collector to extract `_meta.ui`
34
- * without pulling the full `@modelcontextprotocol/sdk` `CallToolResult` type.
34
+ * without pulling the full `@modelcontextprotocol/client` `CallToolResult` type.
35
35
  * Kept compose-local on purpose: the collector is intentionally loose
36
36
  * (`content?: unknown[]`) to accept any SDK shape.
37
37
  *
@@ -1 +1 @@
1
- {"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../../../../src/src/host/renderer/js/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAMjE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,qBAAqB,EACjC,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAa,GAClE,MAAM,CAkiBR"}
1
+ {"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../../../../src/src/host/renderer/js/event-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAMjE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,qBAAqB,EACjC,KAAK,GAAE,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAa,GAClE,MAAM,CAmiBR"}
@@ -130,7 +130,6 @@ function generateEventBusScript(descriptor, slots = new Map()) {
130
130
  const config = getSlotConfig(slot);
131
131
  const capabilities = {
132
132
  logging: {},
133
- message: { text: {} },
134
133
  experimental: {
135
134
  [COMPONENT_CAPABILITY]: {
136
135
  version: '1',
@@ -516,8 +515,10 @@ function generateEventBusScript(descriptor, slots = new Map()) {
516
515
  }
517
516
 
518
517
  if (message.method === 'ui/message') {
519
- console.log('[mcp-compose] UI message from slot', sourceSlot, ':', message.params);
520
- ackIfRequested(event.source, message, targetOrigin);
518
+ // Compose ne livre aucun message au modèle : ne jamais acquitter un faux succès.
519
+ if (hasRequestId(message)) {
520
+ respondError(event.source, message.id, -32601, '[mcp-compose] ui/message is not supported', targetOrigin);
521
+ }
521
522
  return;
522
523
  }
523
524
 
@@ -1 +1 @@
1
- {"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EAIb,WAAW,EAGZ,MAAM,YAAY,CAAC;AAcpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CA2B/E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,aAAa,CAAC,CAsFxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,WAAW,EAAE,MAAM,EAAE,GACpB,UAAU,CAwJZ"}
1
+ {"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAUH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EAIb,WAAW,EAGZ,MAAM,YAAY,CAAC;AAcpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CA2B/E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,aAAa,CAAC,CAsFxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,WAAW,EAAE,MAAM,EAAE,GACpB,UAAU,CAwJZ"}
@@ -30,11 +30,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.connectHttp = connectHttp;
31
31
  exports.startServer = startServer;
32
32
  exports.createCluster = createCluster;
33
- const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
34
- const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
35
- const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
33
+ const client_1 = require("@modelcontextprotocol/client");
36
34
  const version_js_1 = require("../version.js");
37
- const types_js_2 = require("./types.js");
35
+ const types_js_1 = require("./types.js");
38
36
  /** Default timeout for server startup (ms). */
39
37
  const DEFAULT_STARTUP_TIMEOUT_MS = 15_000;
40
38
  /** Default timeout for tool and resource calls (ms). */
@@ -66,7 +64,7 @@ const LISTEN_URL_PATTERN = /listening on (https?:\/\/[^\s]+)/;
66
64
  async function connectHttp(manifest) {
67
65
  if (manifest.transport.type !== "http") {
68
66
  throw {
69
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
67
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
70
68
  message: `Expected http transport for "${manifest.name}", got "${manifest.transport.type}"`,
71
69
  server: manifest.name,
72
70
  };
@@ -78,7 +76,7 @@ async function connectHttp(manifest) {
78
76
  }
79
77
  catch (cause) {
80
78
  throw {
81
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
79
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
82
80
  message: `Cannot initialize MCP connection to "${manifest.name}" at ${baseUrl}: ${cause instanceof Error ? cause.message : String(cause)}`,
83
81
  server: manifest.name,
84
82
  cause,
@@ -108,7 +106,7 @@ async function connectHttp(manifest) {
108
106
  async function startServer(manifest, options) {
109
107
  if (manifest.transport.type !== "stdio") {
110
108
  throw {
111
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
109
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
112
110
  message: `Expected stdio transport for "${manifest.name}", got "${manifest.transport.type}"`,
113
111
  server: manifest.name,
114
112
  };
@@ -121,7 +119,7 @@ async function startServer(manifest, options) {
121
119
  const missing = manifest.requiredEnv.filter((k) => !env[k] && !Deno.env.get(k));
122
120
  if (missing.length > 0) {
123
121
  throw {
124
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
122
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
125
123
  message: `Server "${manifest.name}" requires env vars: ${missing.join(", ")}`,
126
124
  server: manifest.name,
127
125
  };
@@ -146,7 +144,7 @@ async function startServer(manifest, options) {
146
144
  }
147
145
  catch (cause) {
148
146
  throw {
149
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
147
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
150
148
  message: `Failed to start "${manifest.name}": ${cause instanceof Error ? cause.message : String(cause)}`,
151
149
  server: manifest.name,
152
150
  cause,
@@ -170,7 +168,7 @@ async function startServer(manifest, options) {
170
168
  catch (cause) {
171
169
  await stopProcess(process);
172
170
  throw {
173
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
171
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
174
172
  message: `Cannot initialize MCP connection to "${manifest.name}" at ${baseUrl}: ${cause instanceof Error ? cause.message : String(cause)}`,
175
173
  server: manifest.name,
176
174
  cause,
@@ -207,7 +205,7 @@ function createCluster(manifests, serverNames) {
207
205
  const manifest = manifests.get(name);
208
206
  if (!manifest) {
209
207
  throw {
210
- code: types_js_2.RuntimeErrorCode.MANIFEST_NOT_FOUND,
208
+ code: types_js_1.RuntimeErrorCode.MANIFEST_NOT_FOUND,
211
209
  message: `Manifest "${name}" not found`,
212
210
  server: name,
213
211
  };
@@ -234,7 +232,7 @@ function createCluster(manifests, serverNames) {
234
232
  await Promise.allSettled([...connections.values()].map((conn) => conn.close()));
235
233
  connections.clear();
236
234
  throw {
237
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
235
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
238
236
  message: `Failed to start ${failures.length} server(s): ${failures.join("; ")}`,
239
237
  };
240
238
  }
@@ -262,7 +260,7 @@ function createCluster(manifests, serverNames) {
262
260
  const conn = connections.get(serverName);
263
261
  if (!conn) {
264
262
  throw {
265
- code: types_js_2.RuntimeErrorCode.TOOL_CALL_FAILED,
263
+ code: types_js_1.RuntimeErrorCode.TOOL_CALL_FAILED,
266
264
  message: `No connection for server "${serverName}". Did you call startAll()?`,
267
265
  server: serverName,
268
266
  tool: toolName,
@@ -277,7 +275,7 @@ function createCluster(manifests, serverNames) {
277
275
  const conn = connections.get(serverName);
278
276
  if (!conn) {
279
277
  throw {
280
- code: types_js_2.RuntimeErrorCode.RESOURCE_READ_FAILED,
278
+ code: types_js_1.RuntimeErrorCode.RESOURCE_READ_FAILED,
281
279
  message: `No connection for server "${serverName}". Did you call startAll()?`,
282
280
  server: serverName,
283
281
  };
@@ -291,7 +289,7 @@ function createCluster(manifests, serverNames) {
291
289
  const conn = connections.get(serverName);
292
290
  if (!conn) {
293
291
  throw {
294
- code: types_js_2.RuntimeErrorCode.TOOL_LIST_FAILED,
292
+ code: types_js_1.RuntimeErrorCode.TOOL_LIST_FAILED,
295
293
  message: `No connection for server "${serverName}". Did you call startAll()?`,
296
294
  server: serverName,
297
295
  };
@@ -305,7 +303,7 @@ function createCluster(manifests, serverNames) {
305
303
  const conn = connections.get(serverName);
306
304
  if (!conn) {
307
305
  throw {
308
- code: types_js_2.RuntimeErrorCode.RESOURCE_LIST_FAILED,
306
+ code: types_js_1.RuntimeErrorCode.RESOURCE_LIST_FAILED,
309
307
  message: `No connection for server "${serverName}". Did you call startAll()?`,
310
308
  server: serverName,
311
309
  };
@@ -347,7 +345,7 @@ async function detectListenUrl(serverName, stderr, timeoutMs) {
347
345
  reader.releaseLock();
348
346
  drainStream(stderr);
349
347
  reject({
350
- code: types_js_2.RuntimeErrorCode.PROCESS_START_FAILED,
348
+ code: types_js_1.RuntimeErrorCode.PROCESS_START_FAILED,
351
349
  message: `Server "${serverName}" did not report a listening URL within ${timeoutMs}ms`,
352
350
  server: serverName,
353
351
  });
@@ -359,7 +357,7 @@ async function detectListenUrl(serverName, stderr, timeoutMs) {
359
357
  const { value, done } = await reader.read();
360
358
  if (done) {
361
359
  throw {
362
- code: types_js_2.RuntimeErrorCode.PROCESS_DIED,
360
+ code: types_js_1.RuntimeErrorCode.PROCESS_DIED,
363
361
  message: `Server "${serverName}" exited before reporting a listening URL. Stderr: ${buffer}`,
364
362
  server: serverName,
365
363
  };
@@ -449,8 +447,18 @@ async function createMcpConnection(name, transportType, baseUrl, protocol, stopO
449
447
  * and session ID, and adds those details to later requests.
450
448
  */
451
449
  async function createStreamableConnection(name, transportType, baseUrl, stopOwnedProcess) {
452
- const transport = new streamableHttp_js_1.StreamableHTTPClientTransport(mcpEndpointUrl(baseUrl));
453
- const client = new index_js_1.Client({ name: "@mcpview/compose", version: version_js_1.COMPOSE_VERSION }, { capabilities: {} });
450
+ const transport = new client_1.StreamableHTTPClientTransport(mcpEndpointUrl(baseUrl));
451
+ const client = new client_1.Client({ name: "@mcpview/compose", version: version_js_1.COMPOSE_VERSION }, { capabilities: {}, versionNegotiation: { mode: "legacy" } });
452
+ // The SDK list helper aggregates pages. Keep the definitions from our single-page
453
+ // requests so callTool still applies the SDK's output-schema validation.
454
+ const toolDefinitions = new Map();
455
+ let toolDefinitionGeneration = 0;
456
+ const invalidateToolDefinitions = () => {
457
+ toolDefinitionGeneration++;
458
+ toolDefinitions.clear();
459
+ };
460
+ client.onclose = invalidateToolDefinitions;
461
+ client.setNotificationHandler("notifications/tools/list_changed", invalidateToolDefinitions);
454
462
  try {
455
463
  await client.connect(transport, { timeout: DEFAULT_STARTUP_TIMEOUT_MS });
456
464
  }
@@ -467,6 +475,7 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
467
475
  if (closed)
468
476
  return;
469
477
  closed = true;
478
+ invalidateToolDefinitions();
470
479
  try {
471
480
  // Streamable HTTP sessions are server-side state. Terminate them while
472
481
  // the transport is still open, then close local listeners regardless
@@ -487,7 +496,10 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
487
496
  },
488
497
  async callTool(toolName, args) {
489
498
  try {
490
- return await client.callTool({ name: toolName, arguments: args ?? {} }, undefined, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
499
+ return await client.callTool({ name: toolName, arguments: args ?? {} }, {
500
+ timeout: DEFAULT_REQUEST_TIMEOUT_MS,
501
+ toolDefinition: toolDefinitions.get(toolName),
502
+ });
491
503
  }
492
504
  catch (cause) {
493
505
  throw requestError({
@@ -501,7 +513,11 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
501
513
  },
502
514
  async readResource(uri) {
503
515
  try {
504
- return await client.readResource({ uri }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
516
+ // Each Compose read must reach its source, even when it supplies cache hints.
517
+ return await client.readResource({ uri }, {
518
+ timeout: DEFAULT_REQUEST_TIMEOUT_MS,
519
+ cacheMode: "bypass",
520
+ });
505
521
  }
506
522
  catch (cause) {
507
523
  throw requestError({
@@ -515,7 +531,19 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
515
531
  },
516
532
  async listTools(cursor) {
517
533
  try {
518
- return await client.listTools(cursor === undefined ? undefined : { cursor }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
534
+ // Start a fresh catalog on page one, then retain each explicitly fetched page.
535
+ if (cursor === undefined)
536
+ invalidateToolDefinitions();
537
+ const generation = toolDefinitionGeneration;
538
+ const page = await client.request({ method: "tools/list", params: cursor === undefined ? {} : { cursor } }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
539
+ // A list_changed notification or disconnect may have invalidated this reply
540
+ // while it was in flight. Do not restore stale definitions after either.
541
+ if (!closed && generation === toolDefinitionGeneration) {
542
+ for (const tool of page.tools) {
543
+ toolDefinitions.set(tool.name, structuredClone(tool));
544
+ }
545
+ }
546
+ return page;
519
547
  }
520
548
  catch (cause) {
521
549
  throw requestError({
@@ -528,7 +556,7 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
528
556
  },
529
557
  async listResources(cursor) {
530
558
  try {
531
- return await client.listResources(cursor === undefined ? undefined : { cursor }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
559
+ return await client.request({ method: "resources/list", params: cursor === undefined ? {} : { cursor } }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
532
560
  }
533
561
  catch (cause) {
534
562
  throw requestError({
@@ -835,25 +863,25 @@ function requestTarget(input) {
835
863
  function requestErrorCode(kind, timedOut) {
836
864
  switch (kind) {
837
865
  case "tool-call":
838
- return timedOut ? types_js_2.RuntimeErrorCode.TOOL_CALL_TIMEOUT : types_js_2.RuntimeErrorCode.TOOL_CALL_FAILED;
866
+ return timedOut ? types_js_1.RuntimeErrorCode.TOOL_CALL_TIMEOUT : types_js_1.RuntimeErrorCode.TOOL_CALL_FAILED;
839
867
  case "resource-read":
840
868
  return timedOut
841
- ? types_js_2.RuntimeErrorCode.RESOURCE_READ_TIMEOUT
842
- : types_js_2.RuntimeErrorCode.RESOURCE_READ_FAILED;
869
+ ? types_js_1.RuntimeErrorCode.RESOURCE_READ_TIMEOUT
870
+ : types_js_1.RuntimeErrorCode.RESOURCE_READ_FAILED;
843
871
  case "tool-list":
844
- return timedOut ? types_js_2.RuntimeErrorCode.TOOL_LIST_TIMEOUT : types_js_2.RuntimeErrorCode.TOOL_LIST_FAILED;
872
+ return timedOut ? types_js_1.RuntimeErrorCode.TOOL_LIST_TIMEOUT : types_js_1.RuntimeErrorCode.TOOL_LIST_FAILED;
845
873
  case "resource-list":
846
874
  return timedOut
847
- ? types_js_2.RuntimeErrorCode.RESOURCE_LIST_TIMEOUT
848
- : types_js_2.RuntimeErrorCode.RESOURCE_LIST_FAILED;
875
+ ? types_js_1.RuntimeErrorCode.RESOURCE_LIST_TIMEOUT
876
+ : types_js_1.RuntimeErrorCode.RESOURCE_LIST_FAILED;
849
877
  }
850
878
  }
851
879
  function formatCause(cause) {
852
880
  return cause instanceof Error ? cause.message : String(cause);
853
881
  }
854
882
  function isRequestTimeout(cause) {
855
- if (cause instanceof types_js_1.McpError) {
856
- return cause.code === types_js_1.ErrorCode.RequestTimeout;
883
+ if (cause instanceof client_1.SdkError) {
884
+ return cause.code === client_1.SdkErrorCode.RequestTimeout;
857
885
  }
858
886
  if (cause instanceof StatelessProtocolError)
859
887
  return isRequestTimeout(cause.cause);
@@ -9,7 +9,7 @@
9
9
  import type { UiLayout } from "../core/types/layout.js";
10
10
  import type { UiPortSyncRule, UiSyncRule } from "../core/types/sync-rules.js";
11
11
  import type { CompositeUiDescriptor } from "../core/types/descriptor.js";
12
- import type { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
12
+ import type { ReadResourceResult } from "@modelcontextprotocol/client";
13
13
  import type { ComposedDashboardPanel } from "./host-dashboard-types.js";
14
14
  import type { ComponentSurface } from "../core/types/components.js";
15
15
  /**
@@ -183,9 +183,9 @@ export interface McpConnection {
183
183
  callTool(toolName: string, args?: Record<string, unknown>): Promise<unknown>;
184
184
  /** Read a resource through the server's active MCP transport. */
185
185
  readResource(uri: string): Promise<McpReadResourceResult>;
186
- /** List tools through this server's active MCP transport. */
186
+ /** List one page of tools; pass the returned nextCursor to continue. */
187
187
  listTools(cursor?: string): Promise<McpListToolsResult>;
188
- /** List resources through this server's active MCP transport. */
188
+ /** List one page of resources; pass the returned nextCursor to continue. */
189
189
  listResources(cursor?: string): Promise<McpListResourcesResult>;
190
190
  }
191
191
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAMpE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,sBAAsB,GACtB,iBAAiB,CAAC;AAEtB,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,aAAa,CAAC;AA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CAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/sdk` tool call results.
2
+ * MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/client` tool call results.
3
3
  *
4
4
  * This adapter provides a convenience wrapper around the collector that accepts
5
5
  * the shape of tool call results from the official MCP SDK. It uses generic interfaces
@@ -12,12 +12,12 @@ import type { UiCollector } from "../core/collector/collector.js";
12
12
  /**
13
13
  * Minimal shape of an MCP SDK `CallToolResult`.
14
14
  *
15
- * This is a structural subset of `@modelcontextprotocol/sdk`'s `CallToolResult`.
15
+ * This is a structural subset of `@modelcontextprotocol/client`'s `CallToolResult`.
16
16
  * Any object matching this shape will be accepted — no need to import the SDK.
17
17
  *
18
18
  * @example
19
19
  * ```typescript
20
- * // This matches the shape of @modelcontextprotocol/sdk CallToolResult
20
+ * // This matches the shape of @modelcontextprotocol/client CallToolResult
21
21
  * const result: McpSdkCallToolResult = {
22
22
  * content: [{ type: "text", text: "OK" }],
23
23
  * _meta: { ui: { resourceUri: "ui://pg/table/1" } },
@@ -68,7 +68,7 @@ export interface McpSdkCollector {
68
68
  * Create an MCP SDK-aware collector.
69
69
  *
70
70
  * Wraps the core `UiCollector` with an interface that accepts
71
- * `@modelcontextprotocol/sdk` `CallToolResult` objects directly.
71
+ * `@modelcontextprotocol/client` `CallToolResult` objects directly.
72
72
  * Error results (`isError: true`) are automatically skipped.
73
73
  *
74
74
  * @returns A new `McpSdkCollector` instance
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/sdk` tool call results.
3
+ * MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/client` tool call results.
4
4
  *
5
5
  * This adapter provides a convenience wrapper around the collector that accepts
6
6
  * the shape of tool call results from the official MCP SDK. It uses generic interfaces
@@ -15,7 +15,7 @@ const collector_js_1 = require("../core/collector/collector.js");
15
15
  * Create an MCP SDK-aware collector.
16
16
  *
17
17
  * Wraps the core `UiCollector` with an interface that accepts
18
- * `@modelcontextprotocol/sdk` `CallToolResult` objects directly.
18
+ * `@modelcontextprotocol/client` `CallToolResult` objects directly.
19
19
  * Error results (`isError: true`) are automatically skipped.
20
20
  *
21
21
  * @returns A new `McpSdkCollector` instance
@@ -17,7 +17,7 @@
17
17
  * @module lib/version
18
18
  */
19
19
  /** @mcpview/compose package version. */
20
- export declare const COMPOSE_VERSION: "0.10.0";
20
+ export declare const COMPOSE_VERSION: "0.12.0";
21
21
  /**
22
22
  * MCP Apps protocol version targeted by compose.
23
23
  *
@@ -20,7 +20,7 @@
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.MCP_APPS_PROTOCOL_VERSION = exports.COMPOSE_VERSION = void 0;
22
22
  /** @mcpview/compose package version. */
23
- exports.COMPOSE_VERSION = "0.10.0";
23
+ exports.COMPOSE_VERSION = "0.12.0";
24
24
  /**
25
25
  * MCP Apps protocol version targeted by compose.
26
26
  *