1- import { Client } from "@modelcontextprotocol/sdk/ client/index.js " ;
2- import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js " ;
1+ import { Client } from "@modelcontextprotocol/client" ;
2+ import { Transport } from "@modelcontextprotocol/client " ;
33import {
44 CallToolRequest ,
55 CallToolRequestSchema ,
@@ -37,11 +37,11 @@ import {
3737 Tool ,
3838 ToolListChangedNotification ,
3939 ToolListChangedNotificationSchema ,
40- } from "@modelcontextprotocol/sdk/types.js " ;
40+ } from "@modelcontextprotocol/client " ;
4141import {
4242 ProtocolOptions ,
4343 RequestOptions ,
44- } from "@modelcontextprotocol/sdk/shared/protocol.js " ;
44+ } from "@modelcontextprotocol/client " ;
4545import { ProtocolWithEvents } from "./events" ;
4646
4747import {
@@ -1033,10 +1033,7 @@ export class AppBridge extends ProtocolWithEvents<
10331033 * @see `ToolListChangedNotification` from @modelcontextprotocol/sdk for the notification type
10341034 */
10351035 sendToolListChanged ( params : ToolListChangedNotification [ "params" ] = { } ) {
1036- return this . notification ( {
1037- method : "notifications/tools/list_changed" as const ,
1038- params,
1039- } ) ;
1036+ return this . notification ( "notifications/tools/list_changed" , params ) ;
10401037 }
10411038
10421039 /**
@@ -1232,10 +1229,7 @@ export class AppBridge extends ProtocolWithEvents<
12321229 sendResourceListChanged (
12331230 params : ResourceListChangedNotification [ "params" ] = { } ,
12341231 ) {
1235- return this . notification ( {
1236- method : "notifications/resources/list_changed" as const ,
1237- params,
1238- } ) ;
1232+ return this . notification ( "notifications/resources/list_changed" , params ) ;
12391233 }
12401234
12411235 /**
@@ -1315,10 +1309,7 @@ export class AppBridge extends ProtocolWithEvents<
13151309 * @see `PromptListChangedNotification` from @modelcontextprotocol/sdk for the notification type
13161310 */
13171311 sendPromptListChanged ( params : PromptListChangedNotification [ "params" ] = { } ) {
1318- return this . notification ( {
1319- method : "notifications/prompts/list_changed" as const ,
1320- params,
1321- } ) ;
1312+ return this . notification ( "notifications/prompts/list_changed" , params ) ;
13221313 }
13231314
13241315 /**
@@ -1462,10 +1453,7 @@ export class AppBridge extends ProtocolWithEvents<
14621453 sendHostContextChange (
14631454 params : McpUiHostContextChangedNotification [ "params" ] ,
14641455 ) : Promise < void > | void {
1465- return this . notification ( {
1466- method : "ui/notifications/host-context-changed" as const ,
1467- params,
1468- } ) ;
1456+ return this . notification ( "ui/notifications/host-context-changed" , params ) ;
14691457 }
14701458
14711459 /**
@@ -1491,10 +1479,7 @@ export class AppBridge extends ProtocolWithEvents<
14911479 * @see {@link sendToolResult `sendToolResult` } for sending results after execution
14921480 */
14931481 sendToolInput ( params : McpUiToolInputNotification [ "params" ] ) {
1494- return this . notification ( {
1495- method : "ui/notifications/tool-input" as const ,
1496- params,
1497- } ) ;
1482+ return this . notification ( "ui/notifications/tool-input" , params ) ;
14981483 }
14991484
15001485 /**
@@ -1527,10 +1512,7 @@ export class AppBridge extends ProtocolWithEvents<
15271512 * @see {@link sendToolInput `sendToolInput` } for sending complete arguments
15281513 */
15291514 sendToolInputPartial ( params : McpUiToolInputPartialNotification [ "params" ] ) {
1530- return this . notification ( {
1531- method : "ui/notifications/tool-input-partial" as const ,
1532- params,
1533- } ) ;
1515+ return this . notification ( "ui/notifications/tool-input-partial" , params ) ;
15341516 }
15351517
15361518 /**
@@ -1556,10 +1538,7 @@ export class AppBridge extends ProtocolWithEvents<
15561538 * @see {@link sendToolInput `sendToolInput` } for sending tool arguments before results
15571539 */
15581540 sendToolResult ( params : McpUiToolResultNotification [ "params" ] ) {
1559- return this . notification ( {
1560- method : "ui/notifications/tool-result" as const ,
1561- params,
1562- } ) ;
1541+ return this . notification ( "ui/notifications/tool-result" , params ) ;
15631542 }
15641543
15651544 /**
@@ -1593,10 +1572,7 @@ export class AppBridge extends ProtocolWithEvents<
15931572 * @see {@link sendToolInput `sendToolInput` } for sending tool arguments
15941573 */
15951574 sendToolCancelled ( params : McpUiToolCancelledNotification [ "params" ] ) {
1596- return this . notification ( {
1597- method : "ui/notifications/tool-cancelled" as const ,
1598- params,
1599- } ) ;
1575+ return this . notification ( "ui/notifications/tool-cancelled" , params ) ;
16001576 }
16011577
16021578 /**
@@ -1617,10 +1593,7 @@ export class AppBridge extends ProtocolWithEvents<
16171593 sendSandboxResourceReady (
16181594 params : McpUiSandboxResourceReadyNotification [ "params" ] ,
16191595 ) {
1620- return this . notification ( {
1621- method : "ui/notifications/sandbox-resource-ready" as const ,
1622- params,
1623- } ) ;
1596+ return this . notification ( "ui/notifications/sandbox-resource-ready" , params ) ;
16241597 }
16251598
16261599 /**
@@ -1651,12 +1624,7 @@ export class AppBridge extends ProtocolWithEvents<
16511624 params : McpUiResourceTeardownRequest [ "params" ] ,
16521625 options ?: RequestOptions ,
16531626 ) {
1654- return this . request (
1655- {
1656- method : "ui/resource-teardown" as const ,
1657- params,
1658- } ,
1659- McpUiResourceTeardownResultSchema ,
1627+ return this . request ( "ui/resource-teardown" , params , McpUiResourceTeardownResultSchema ,
16601628 options ,
16611629 ) ;
16621630 }
@@ -1674,9 +1642,7 @@ export class AppBridge extends ProtocolWithEvents<
16741642 * @returns Promise resolving to the tool call result
16751643 */
16761644 callTool ( params : CallToolRequest [ "params" ] , options ?: RequestOptions ) {
1677- return this . request (
1678- { method : "tools/call" , params } ,
1679- CallToolResultSchema ,
1645+ return this . request ( "tools/call" , params , CallToolResultSchema ,
16801646 options ,
16811647 ) ;
16821648 }
@@ -1691,9 +1657,7 @@ export class AppBridge extends ProtocolWithEvents<
16911657 * @returns Promise resolving to the list of tools
16921658 */
16931659 listTools ( params : ListToolsRequest [ "params" ] , options ?: RequestOptions ) {
1694- return this . request (
1695- { method : "tools/list" , params } ,
1696- ListToolsResultSchema ,
1660+ return this . request ( "tools/list" , params , ListToolsResultSchema ,
16971661 options ,
16981662 ) ;
16991663 }
0 commit comments