@mcpview/compose 0.10.0 → 0.11.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 +26 -0
- package/README.md +32 -2
- package/esm/src/core/types/mcp-apps.d.ts +1 -1
- package/esm/src/host/renderer/js/event-bus.d.ts.map +1 -1
- package/esm/src/host/renderer/js/event-bus.js +4 -3
- package/esm/src/runtime/cluster.d.ts.map +1 -1
- package/esm/src/runtime/cluster.js +38 -10
- package/esm/src/runtime/types.d.ts +3 -3
- package/esm/src/runtime/types.d.ts.map +1 -1
- package/esm/src/sdk/mcp-sdk.d.ts +4 -4
- package/esm/src/sdk/mcp-sdk.js +2 -2
- package/esm/src/version.d.ts +1 -1
- package/esm/src/version.js +1 -1
- package/package.json +6 -3
- package/script/src/core/types/mcp-apps.d.ts +1 -1
- package/script/src/host/renderer/js/event-bus.d.ts.map +1 -1
- package/script/src/host/renderer/js/event-bus.js +4 -3
- package/script/src/runtime/cluster.d.ts.map +1 -1
- package/script/src/runtime/cluster.js +60 -32
- package/script/src/runtime/types.d.ts +3 -3
- package/script/src/runtime/types.d.ts.map +1 -1
- package/script/src/sdk/mcp-sdk.d.ts +4 -4
- package/script/src/sdk/mcp-sdk.js +2 -2
- package/script/src/version.d.ts +1 -1
- package/script/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ documented in this file.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.11.0] - 2026-10-24
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **BREAKING:** MCP Apps 2.x now requires Zod 4.2+ and Node.js 20+. Direct SDK imports move from
|
|
13
|
+
`@modelcontextprotocol/sdk` to the split client/core packages. SDK `callTool(params, options)`
|
|
14
|
+
takes two arguments; Compose’s public `McpConnection.callTool(name, args)` signature remains
|
|
15
|
+
unchanged.
|
|
16
|
+
- Migrate the runtime client to the split MCP SDK 2.x packages and MCP Apps 2.x, with Zod 4.2+
|
|
17
|
+
peers. Update the two-argument tool-call API and recognize local `SdkError` request timeouts while
|
|
18
|
+
retaining Compose's public runtime error codes and original error causes.
|
|
19
|
+
- Preserve explicit stateless-first protocol selection, initialized Streamable HTTP sessions,
|
|
20
|
+
one-page list results and cursors, tool output-schema validation, and fresh resource reads despite
|
|
21
|
+
SDK 2.x list aggregation and response caching defaults. Listed definitions are isolated per
|
|
22
|
+
connection and invalidated on catalog changes and closure. The structural collector remains
|
|
23
|
+
compatible with existing client result objects. Conversation and model-context host callbacks
|
|
24
|
+
remain deferred.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Stop advertising `message.text` in the Compose host's initialization response: Compose has no
|
|
29
|
+
conversation/model delivery path. Direct `ui/message` requests now return JSON-RPC error `-32601`
|
|
30
|
+
instead of logging the payload and acknowledging `{}`, so a viewer cannot mistake a console log
|
|
31
|
+
for a delivered message. Viewers should treat the missing `message` capability as unsupported,
|
|
32
|
+
following view ADR 0005's "No false success" rule.
|
|
33
|
+
|
|
8
34
|
## [0.10.0] - 2026-10-17
|
|
9
35
|
|
|
10
36
|
### Changed
|
package/README.md
CHANGED
|
@@ -67,6 +67,30 @@ npm i @mcpview/compose
|
|
|
67
67
|
import { buildCompositeUi, createCollector, renderComposite } from "@mcpview/compose";
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## MCP SDK compatibility
|
|
71
|
+
|
|
72
|
+
Compose uses MCP Apps 2.x and the split MCP SDK 2.x packages. Integrations importing SDK types or
|
|
73
|
+
classes should use `@modelcontextprotocol/client` instead of the former monolithic SDK package. MCP
|
|
74
|
+
Apps 2.x requires `@modelcontextprotocol/client@^2.0.0` and `zod@^4.2.0`; this workspace uses
|
|
75
|
+
client/core `^2.3.1` and ext-apps `^2.0.3`. Node consumers require Node.js 20 or later. The
|
|
76
|
+
structural `createMcpSdkCollector()` adapter also accepts results from existing SDK clients without
|
|
77
|
+
importing those clients into the composition core.
|
|
78
|
+
|
|
79
|
+
The runtime retains its stateless-first transport selection and its initialized Streamable HTTP
|
|
80
|
+
fallback. Each connection owns its SDK client and session; closing it terminates the remote session
|
|
81
|
+
before closing the client. `listTools()` and `listResources()` return one page plus `nextCursor`,
|
|
82
|
+
and `readResource()` always reads from its source. Listed tool definitions retain SDK output-schema
|
|
83
|
+
validation across explicitly fetched pages; refreshing the first page, a tool-list change, or
|
|
84
|
+
closing the connection invalidates them. Tool results with `isError: true` remain results; remote
|
|
85
|
+
protocol failures and local request timeouts become the existing Compose `RuntimeError` codes, with
|
|
86
|
+
the original SDK error available as `cause`.
|
|
87
|
+
|
|
88
|
+
The Apps iframe protocol is unchanged by the dependency migration. Compose's conversation and
|
|
89
|
+
model-context host callbacks remain deferred; this migration adds no runtime agent or callbacks. See
|
|
90
|
+
the
|
|
91
|
+
[official MCP Apps migration guide](https://apps.extensions.modelcontextprotocol.io/api/documents/migrate-to-v2.html)
|
|
92
|
+
for SDK import, peer dependency, and error-class changes.
|
|
93
|
+
|
|
70
94
|
## Quick Start
|
|
71
95
|
|
|
72
96
|
A complete, runnable example — from MCP tool results to rendered HTML:
|
|
@@ -258,7 +282,8 @@ collector.clear(); // Reset
|
|
|
258
282
|
|
|
259
283
|
## MCP SDK Adapter
|
|
260
284
|
|
|
261
|
-
For projects using `@modelcontextprotocol/
|
|
285
|
+
For projects using `CallToolResult` from `@modelcontextprotocol/client` (or an existing client with
|
|
286
|
+
the same result shape):
|
|
262
287
|
|
|
263
288
|
```typescript
|
|
264
289
|
import { createMcpSdkCollector } from "@mcpview/compose";
|
|
@@ -428,10 +453,15 @@ The rendered HTML includes a JavaScript event bus implementing:
|
|
|
428
453
|
- **`ui/notifications/tool-result`** -- Full initiating result delivered after initialization
|
|
429
454
|
- **`tools/call` / `tools/list`** -- Only when the slot has a local route and manifest grant
|
|
430
455
|
- **`resources/read` / `resources/list`** -- Only for the resource bound to that slot
|
|
431
|
-
- **`ui/message`** -- Logging/debugging channel
|
|
432
456
|
|
|
433
457
|
All messages use JSON-RPC 2.0 via `postMessage`.
|
|
434
458
|
|
|
459
|
+
Compose does not deliver messages to a conversation or model, so it does not advertise the `message`
|
|
460
|
+
host capability (including `message.text`). Viewers should treat this channel as unsupported. Direct
|
|
461
|
+
`ui/message` requests receive JSON-RPC error `-32601` (method not found), never a delivery
|
|
462
|
+
acknowledgement; notifications without an `id` receive no response. This follows the
|
|
463
|
+
[three-channel ADR's "No false success" rule](../view/docs/decision-records/0005-three-view-channels.md).
|
|
464
|
+
|
|
435
465
|
## Error Codes
|
|
436
466
|
|
|
437
467
|
**Core errors (`ErrorCode`):**
|
|
@@ -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/
|
|
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,
|
|
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"}
|
|
@@ -127,7 +127,6 @@ export function generateEventBusScript(descriptor, slots = new Map()) {
|
|
|
127
127
|
const config = getSlotConfig(slot);
|
|
128
128
|
const capabilities = {
|
|
129
129
|
logging: {},
|
|
130
|
-
message: { text: {} },
|
|
131
130
|
experimental: {
|
|
132
131
|
[COMPONENT_CAPABILITY]: {
|
|
133
132
|
version: '1',
|
|
@@ -513,8 +512,10 @@ export function generateEventBusScript(descriptor, slots = new Map()) {
|
|
|
513
512
|
}
|
|
514
513
|
|
|
515
514
|
if (message.method === 'ui/message') {
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
// Compose ne livre aucun message au modèle : ne jamais acquitter un faux succès.
|
|
516
|
+
if (hasRequestId(message)) {
|
|
517
|
+
respondError(event.source, message.id, -32601, '[mcp-compose] ui/message is not supported', targetOrigin);
|
|
518
|
+
}
|
|
518
519
|
return;
|
|
519
520
|
}
|
|
520
521
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/cluster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
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"}
|
|
@@ -25,9 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @module runtime/cluster
|
|
27
27
|
*/
|
|
28
|
-
import { Client } from "@modelcontextprotocol/
|
|
29
|
-
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
30
|
-
import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
28
|
+
import { Client, SdkError, SdkErrorCode, StreamableHTTPClientTransport, } from "@modelcontextprotocol/client";
|
|
31
29
|
import { COMPOSE_VERSION } from "../version.js";
|
|
32
30
|
import { RuntimeErrorCode } from "./types.js";
|
|
33
31
|
/** Default timeout for server startup (ms). */
|
|
@@ -445,7 +443,17 @@ async function createMcpConnection(name, transportType, baseUrl, protocol, stopO
|
|
|
445
443
|
*/
|
|
446
444
|
async function createStreamableConnection(name, transportType, baseUrl, stopOwnedProcess) {
|
|
447
445
|
const transport = new StreamableHTTPClientTransport(mcpEndpointUrl(baseUrl));
|
|
448
|
-
const client = new Client({ name: "@mcpview/compose", version: COMPOSE_VERSION }, { capabilities: {} });
|
|
446
|
+
const client = new Client({ name: "@mcpview/compose", version: COMPOSE_VERSION }, { capabilities: {}, versionNegotiation: { mode: "legacy" } });
|
|
447
|
+
// The SDK list helper aggregates pages. Keep the definitions from our single-page
|
|
448
|
+
// requests so callTool still applies the SDK's output-schema validation.
|
|
449
|
+
const toolDefinitions = new Map();
|
|
450
|
+
let toolDefinitionGeneration = 0;
|
|
451
|
+
const invalidateToolDefinitions = () => {
|
|
452
|
+
toolDefinitionGeneration++;
|
|
453
|
+
toolDefinitions.clear();
|
|
454
|
+
};
|
|
455
|
+
client.onclose = invalidateToolDefinitions;
|
|
456
|
+
client.setNotificationHandler("notifications/tools/list_changed", invalidateToolDefinitions);
|
|
449
457
|
try {
|
|
450
458
|
await client.connect(transport, { timeout: DEFAULT_STARTUP_TIMEOUT_MS });
|
|
451
459
|
}
|
|
@@ -462,6 +470,7 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
|
|
|
462
470
|
if (closed)
|
|
463
471
|
return;
|
|
464
472
|
closed = true;
|
|
473
|
+
invalidateToolDefinitions();
|
|
465
474
|
try {
|
|
466
475
|
// Streamable HTTP sessions are server-side state. Terminate them while
|
|
467
476
|
// the transport is still open, then close local listeners regardless
|
|
@@ -482,7 +491,10 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
|
|
|
482
491
|
},
|
|
483
492
|
async callTool(toolName, args) {
|
|
484
493
|
try {
|
|
485
|
-
return await client.callTool({ name: toolName, arguments: args ?? {} },
|
|
494
|
+
return await client.callTool({ name: toolName, arguments: args ?? {} }, {
|
|
495
|
+
timeout: DEFAULT_REQUEST_TIMEOUT_MS,
|
|
496
|
+
toolDefinition: toolDefinitions.get(toolName),
|
|
497
|
+
});
|
|
486
498
|
}
|
|
487
499
|
catch (cause) {
|
|
488
500
|
throw requestError({
|
|
@@ -496,7 +508,11 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
|
|
|
496
508
|
},
|
|
497
509
|
async readResource(uri) {
|
|
498
510
|
try {
|
|
499
|
-
|
|
511
|
+
// Each Compose read must reach its source, even when it supplies cache hints.
|
|
512
|
+
return await client.readResource({ uri }, {
|
|
513
|
+
timeout: DEFAULT_REQUEST_TIMEOUT_MS,
|
|
514
|
+
cacheMode: "bypass",
|
|
515
|
+
});
|
|
500
516
|
}
|
|
501
517
|
catch (cause) {
|
|
502
518
|
throw requestError({
|
|
@@ -510,7 +526,19 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
|
|
|
510
526
|
},
|
|
511
527
|
async listTools(cursor) {
|
|
512
528
|
try {
|
|
513
|
-
|
|
529
|
+
// Start a fresh catalog on page one, then retain each explicitly fetched page.
|
|
530
|
+
if (cursor === undefined)
|
|
531
|
+
invalidateToolDefinitions();
|
|
532
|
+
const generation = toolDefinitionGeneration;
|
|
533
|
+
const page = await client.request({ method: "tools/list", params: cursor === undefined ? {} : { cursor } }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
|
|
534
|
+
// A list_changed notification or disconnect may have invalidated this reply
|
|
535
|
+
// while it was in flight. Do not restore stale definitions after either.
|
|
536
|
+
if (!closed && generation === toolDefinitionGeneration) {
|
|
537
|
+
for (const tool of page.tools) {
|
|
538
|
+
toolDefinitions.set(tool.name, structuredClone(tool));
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return page;
|
|
514
542
|
}
|
|
515
543
|
catch (cause) {
|
|
516
544
|
throw requestError({
|
|
@@ -523,7 +551,7 @@ async function createStreamableConnection(name, transportType, baseUrl, stopOwne
|
|
|
523
551
|
},
|
|
524
552
|
async listResources(cursor) {
|
|
525
553
|
try {
|
|
526
|
-
return await client.
|
|
554
|
+
return await client.request({ method: "resources/list", params: cursor === undefined ? {} : { cursor } }, { timeout: DEFAULT_REQUEST_TIMEOUT_MS });
|
|
527
555
|
}
|
|
528
556
|
catch (cause) {
|
|
529
557
|
throw requestError({
|
|
@@ -847,8 +875,8 @@ function formatCause(cause) {
|
|
|
847
875
|
return cause instanceof Error ? cause.message : String(cause);
|
|
848
876
|
}
|
|
849
877
|
function isRequestTimeout(cause) {
|
|
850
|
-
if (cause instanceof
|
|
851
|
-
return cause.code ===
|
|
878
|
+
if (cause instanceof SdkError) {
|
|
879
|
+
return cause.code === SdkErrorCode.RequestTimeout;
|
|
852
880
|
}
|
|
853
881
|
if (cause instanceof StatelessProtocolError)
|
|
854
882
|
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/
|
|
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
|
|
186
|
+
/** List one page of tools; pass the returned nextCursor to continue. */
|
|
187
187
|
listTools(cursor?: string): Promise<McpListToolsResult>;
|
|
188
|
-
/** List resources
|
|
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,MAA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C;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
package/esm/src/sdk/mcp-sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/
|
|
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/
|
|
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/
|
|
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/
|
|
71
|
+
* `@modelcontextprotocol/client` `CallToolResult` objects directly.
|
|
72
72
|
* Error results (`isError: true`) are automatically skipped.
|
|
73
73
|
*
|
|
74
74
|
* @returns A new `McpSdkCollector` instance
|
package/esm/src/sdk/mcp-sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP SDK adapter — wraps the collector for use with `@modelcontextprotocol/
|
|
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,7 +12,7 @@ import { createCollector } from "../core/collector/collector.js";
|
|
|
12
12
|
* Create an MCP SDK-aware collector.
|
|
13
13
|
*
|
|
14
14
|
* Wraps the core `UiCollector` with an interface that accepts
|
|
15
|
-
* `@modelcontextprotocol/
|
|
15
|
+
* `@modelcontextprotocol/client` `CallToolResult` objects directly.
|
|
16
16
|
* Error results (`isError: true`) are automatically skipped.
|
|
17
17
|
*
|
|
18
18
|
* @returns A new `McpSdkCollector` instance
|
package/esm/src/version.d.ts
CHANGED
package/esm/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpview/compose",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Compose and synchronize multiple MCP Apps UIs into composite dashboards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -48,9 +48,12 @@
|
|
|
48
48
|
"require": "./script/src/deploy/mod.js"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=20"
|
|
53
|
+
},
|
|
51
54
|
"dependencies": {
|
|
52
|
-
"@modelcontextprotocol/
|
|
53
|
-
"@modelcontextprotocol/
|
|
55
|
+
"@modelcontextprotocol/client": "^2.3.1",
|
|
56
|
+
"@modelcontextprotocol/ext-apps": "^2.0.3"
|
|
54
57
|
},
|
|
55
58
|
"_generatedBy": "dnt@dev",
|
|
56
59
|
"types": "./esm/mod.d.ts"
|
|
@@ -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/
|
|
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,
|
|
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
|
-
|
|
520
|
-
|
|
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;
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
453
|
-
const client = new
|
|
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 ?? {} },
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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 ?
|
|
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
|
-
?
|
|
842
|
-
:
|
|
869
|
+
? types_js_1.RuntimeErrorCode.RESOURCE_READ_TIMEOUT
|
|
870
|
+
: types_js_1.RuntimeErrorCode.RESOURCE_READ_FAILED;
|
|
843
871
|
case "tool-list":
|
|
844
|
-
return timedOut ?
|
|
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
|
-
?
|
|
848
|
-
:
|
|
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
|
|
856
|
-
return cause.code ===
|
|
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/
|
|
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
|
|
186
|
+
/** List one page of tools; pass the returned nextCursor to continue. */
|
|
187
187
|
listTools(cursor?: string): Promise<McpListToolsResult>;
|
|
188
|
-
/** List resources
|
|
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,
|
|
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,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAMpE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAc;IAC7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AC5B,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC1C,qFAAqF;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAMD,2BAA2B;AAC3B,oBAAY,gBAAgB;IAC1B,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;IACvC,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,YAAY,iBAAiB;CAC9B;AAED,gCAAgC;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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
18
|
+
* `@modelcontextprotocol/client` `CallToolResult` objects directly.
|
|
19
19
|
* Error results (`isError: true`) are automatically skipped.
|
|
20
20
|
*
|
|
21
21
|
* @returns A new `McpSdkCollector` instance
|
package/script/src/version.d.ts
CHANGED
package/script/src/version.js
CHANGED
|
@@ -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.
|
|
23
|
+
exports.COMPOSE_VERSION = "0.11.0";
|
|
24
24
|
/**
|
|
25
25
|
* MCP Apps protocol version targeted by compose.
|
|
26
26
|
*
|