@modelcontextprotocol/server-basic-react 1.2.1 → 1.3.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/dist/server.js CHANGED
@@ -147,22 +147,22 @@ var require_code = __commonJS((exports) => {
147
147
  i2++;
148
148
  }
149
149
  }
150
- function mergeExprItems(a2, b2) {
151
- if (b2 === '""')
150
+ function mergeExprItems(a2, b) {
151
+ if (b === '""')
152
152
  return a2;
153
153
  if (a2 === '""')
154
- return b2;
154
+ return b;
155
155
  if (typeof a2 == "string") {
156
- if (b2 instanceof Name || a2[a2.length - 1] !== '"')
156
+ if (b instanceof Name || a2[a2.length - 1] !== '"')
157
157
  return;
158
- if (typeof b2 != "string")
159
- return `${a2.slice(0, -1)}${b2}"`;
160
- if (b2[0] === '"')
161
- return a2.slice(0, -1) + b2.slice(1);
158
+ if (typeof b != "string")
159
+ return `${a2.slice(0, -1)}${b}"`;
160
+ if (b[0] === '"')
161
+ return a2.slice(0, -1) + b.slice(1);
162
162
  return;
163
163
  }
164
- if (typeof b2 == "string" && b2[0] === '"' && !(a2 instanceof Name))
165
- return `"${a2}${b2.slice(1)}`;
164
+ if (typeof b == "string" && b[0] === '"' && !(a2 instanceof Name))
165
+ return `"${a2}${b.slice(1)}`;
166
166
  return;
167
167
  }
168
168
  function strConcat(c1, c2) {
@@ -1997,43 +1997,43 @@ var require_subschema = __commonJS((exports) => {
1997
1997
 
1998
1998
  // ../../node_modules/fast-deep-equal/index.js
1999
1999
  var require_fast_deep_equal = __commonJS((exports, module) => {
2000
- module.exports = function equal(a2, b2) {
2001
- if (a2 === b2)
2000
+ module.exports = function equal(a2, b) {
2001
+ if (a2 === b)
2002
2002
  return true;
2003
- if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
2004
- if (a2.constructor !== b2.constructor)
2003
+ if (a2 && b && typeof a2 == "object" && typeof b == "object") {
2004
+ if (a2.constructor !== b.constructor)
2005
2005
  return false;
2006
2006
  var length, i2, keys;
2007
2007
  if (Array.isArray(a2)) {
2008
2008
  length = a2.length;
2009
- if (length != b2.length)
2009
+ if (length != b.length)
2010
2010
  return false;
2011
2011
  for (i2 = length;i2-- !== 0; )
2012
- if (!equal(a2[i2], b2[i2]))
2012
+ if (!equal(a2[i2], b[i2]))
2013
2013
  return false;
2014
2014
  return true;
2015
2015
  }
2016
2016
  if (a2.constructor === RegExp)
2017
- return a2.source === b2.source && a2.flags === b2.flags;
2017
+ return a2.source === b.source && a2.flags === b.flags;
2018
2018
  if (a2.valueOf !== Object.prototype.valueOf)
2019
- return a2.valueOf() === b2.valueOf();
2019
+ return a2.valueOf() === b.valueOf();
2020
2020
  if (a2.toString !== Object.prototype.toString)
2021
- return a2.toString() === b2.toString();
2021
+ return a2.toString() === b.toString();
2022
2022
  keys = Object.keys(a2);
2023
2023
  length = keys.length;
2024
- if (length !== Object.keys(b2).length)
2024
+ if (length !== Object.keys(b).length)
2025
2025
  return false;
2026
2026
  for (i2 = length;i2-- !== 0; )
2027
- if (!Object.prototype.hasOwnProperty.call(b2, keys[i2]))
2027
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i2]))
2028
2028
  return false;
2029
2029
  for (i2 = length;i2-- !== 0; ) {
2030
2030
  var key = keys[i2];
2031
- if (!equal(a2[key], b2[key]))
2031
+ if (!equal(a2[key], b[key]))
2032
2032
  return false;
2033
2033
  }
2034
2034
  return true;
2035
2035
  }
2036
- return a2 !== a2 && b2 !== b2;
2036
+ return a2 !== a2 && b !== b;
2037
2037
  };
2038
2038
  });
2039
2039
 
@@ -24035,7 +24035,6 @@ function date4(params) {
24035
24035
 
24036
24036
  // ../../node_modules/zod/v4/classic/external.js
24037
24037
  config(en_default2());
24038
-
24039
24038
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
24040
24039
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
24041
24040
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
@@ -26983,6 +26982,7 @@ function mergeCapabilities(base, additional) {
26983
26982
  }
26984
26983
  return result;
26985
26984
  }
26985
+
26986
26986
  // ../../node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js
26987
26987
  var F = "2026-01-26";
26988
26988
  var z2 = "ui/notifications/tool-input-partial";
@@ -27025,8 +27025,8 @@ class j {
27025
27025
  sessionId;
27026
27026
  setProtocolVersion;
27027
27027
  }
27028
- var b = exports_external.union([exports_external.literal("light"), exports_external.literal("dark")]).describe("Color theme preference for the host environment.");
27029
- var L = exports_external.union([exports_external.literal("inline"), exports_external.literal("fullscreen"), exports_external.literal("pip")]).describe("Display mode for UI presentation.");
27028
+ var g = exports_external.union([exports_external.literal("light"), exports_external.literal("dark")]).describe("Color theme preference for the host environment.");
27029
+ var G = exports_external.union([exports_external.literal("inline"), exports_external.literal("fullscreen"), exports_external.literal("pip")]).describe("Display mode for UI presentation.");
27030
27030
  var i = exports_external.union([exports_external.literal("--color-background-primary"), exports_external.literal("--color-background-secondary"), exports_external.literal("--color-background-tertiary"), exports_external.literal("--color-background-inverse"), exports_external.literal("--color-background-ghost"), exports_external.literal("--color-background-info"), exports_external.literal("--color-background-danger"), exports_external.literal("--color-background-success"), exports_external.literal("--color-background-warning"), exports_external.literal("--color-background-disabled"), exports_external.literal("--color-text-primary"), exports_external.literal("--color-text-secondary"), exports_external.literal("--color-text-tertiary"), exports_external.literal("--color-text-inverse"), exports_external.literal("--color-text-ghost"), exports_external.literal("--color-text-info"), exports_external.literal("--color-text-danger"), exports_external.literal("--color-text-success"), exports_external.literal("--color-text-warning"), exports_external.literal("--color-text-disabled"), exports_external.literal("--color-border-primary"), exports_external.literal("--color-border-secondary"), exports_external.literal("--color-border-tertiary"), exports_external.literal("--color-border-inverse"), exports_external.literal("--color-border-ghost"), exports_external.literal("--color-border-info"), exports_external.literal("--color-border-danger"), exports_external.literal("--color-border-success"), exports_external.literal("--color-border-warning"), exports_external.literal("--color-border-disabled"), exports_external.literal("--color-ring-primary"), exports_external.literal("--color-ring-secondary"), exports_external.literal("--color-ring-inverse"), exports_external.literal("--color-ring-info"), exports_external.literal("--color-ring-danger"), exports_external.literal("--color-ring-success"), exports_external.literal("--color-ring-warning"), exports_external.literal("--font-sans"), exports_external.literal("--font-mono"), exports_external.literal("--font-weight-normal"), exports_external.literal("--font-weight-medium"), exports_external.literal("--font-weight-semibold"), exports_external.literal("--font-weight-bold"), exports_external.literal("--font-text-xs-size"), exports_external.literal("--font-text-sm-size"), exports_external.literal("--font-text-md-size"), exports_external.literal("--font-text-lg-size"), exports_external.literal("--font-heading-xs-size"), exports_external.literal("--font-heading-sm-size"), exports_external.literal("--font-heading-md-size"), exports_external.literal("--font-heading-lg-size"), exports_external.literal("--font-heading-xl-size"), exports_external.literal("--font-heading-2xl-size"), exports_external.literal("--font-heading-3xl-size"), exports_external.literal("--font-text-xs-line-height"), exports_external.literal("--font-text-sm-line-height"), exports_external.literal("--font-text-md-line-height"), exports_external.literal("--font-text-lg-line-height"), exports_external.literal("--font-heading-xs-line-height"), exports_external.literal("--font-heading-sm-line-height"), exports_external.literal("--font-heading-md-line-height"), exports_external.literal("--font-heading-lg-line-height"), exports_external.literal("--font-heading-xl-line-height"), exports_external.literal("--font-heading-2xl-line-height"), exports_external.literal("--font-heading-3xl-line-height"), exports_external.literal("--border-radius-xs"), exports_external.literal("--border-radius-sm"), exports_external.literal("--border-radius-md"), exports_external.literal("--border-radius-lg"), exports_external.literal("--border-radius-xl"), exports_external.literal("--border-radius-full"), exports_external.literal("--border-width-regular"), exports_external.literal("--shadow-hairline"), exports_external.literal("--shadow-sm"), exports_external.literal("--shadow-md"), exports_external.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming.");
27031
27031
  var o = exports_external.record(i.describe(`Style variables for theming MCP apps.
27032
27032
 
@@ -27061,15 +27061,16 @@ var t = exports_external.object({ method: exports_external.literal("ui/notificat
27061
27061
  var A = exports_external.object({ method: exports_external.literal("ui/notifications/tool-input"), params: exports_external.object({ arguments: exports_external.record(exports_external.string(), exports_external.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.") }) });
27062
27062
  var P = exports_external.object({ method: exports_external.literal("ui/notifications/tool-input-partial"), params: exports_external.object({ arguments: exports_external.record(exports_external.string(), exports_external.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).") }) });
27063
27063
  var H = exports_external.object({ method: exports_external.literal("ui/notifications/tool-cancelled"), params: exports_external.object({ reason: exports_external.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").') }) });
27064
- var g = exports_external.object({ fonts: exports_external.string().optional() });
27065
- var C = exports_external.object({ variables: o.optional().describe("CSS variables for theming the app."), css: g.optional().describe("CSS blocks that apps can inject.") });
27064
+ var S = exports_external.object({ fonts: exports_external.string().optional() });
27065
+ var y = exports_external.object({ variables: o.optional().describe("CSS variables for theming the app."), css: S.optional().describe("CSS blocks that apps can inject.") });
27066
27066
  var _ = exports_external.object({ method: exports_external.literal("ui/resource-teardown"), params: exports_external.object({}) });
27067
27067
  var e = exports_external.record(exports_external.string(), exports_external.unknown());
27068
27068
  var q = exports_external.object({ text: exports_external.object({}).optional().describe("Host supports text content blocks."), image: exports_external.object({}).optional().describe("Host supports image content blocks."), audio: exports_external.object({}).optional().describe("Host supports audio content blocks."), resource: exports_external.object({}).optional().describe("Host supports resource content blocks."), resourceLink: exports_external.object({}).optional().describe("Host supports resource link content blocks."), structuredContent: exports_external.object({}).optional().describe("Host supports structured content.") });
27069
- var y = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: exports_external.object({}).optional().describe("Host supports opening external URLs."), downloadFile: exports_external.object({}).optional().describe("Host supports file downloads via ui/download-file."), serverTools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: exports_external.object({}).optional().describe("Host accepts log messages."), sandbox: exports_external.object({ permissions: K.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: B.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: q.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: q.optional().describe("Host supports receiving content messages (ui/message) from the view.") });
27070
- var u = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), tools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: exports_external.array(L).optional().describe("Display modes the app supports.") });
27071
- var QQ = exports_external.object({ method: exports_external.literal("ui/notifications/initialized"), params: exports_external.object({}).optional() });
27072
- var ZQ = exports_external.object({ csp: B.optional().describe("Content Security Policy configuration for UI resources."), permissions: K.optional().describe("Sandbox permissions requested by the UI resource."), domain: exports_external.string().optional().describe(`Dedicated origin for view sandbox.
27069
+ var QQ = exports_external.object({ method: exports_external.literal("ui/notifications/request-teardown"), params: exports_external.object({}).optional() });
27070
+ var C = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), openLinks: exports_external.object({}).optional().describe("Host supports opening external URLs."), downloadFile: exports_external.object({}).optional().describe("Host supports file downloads via ui/download-file."), serverTools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports tools/list_changed notifications.") }).optional().describe("Host can proxy tool calls to the MCP server."), serverResources: exports_external.object({ listChanged: exports_external.boolean().optional().describe("Host supports resources/list_changed notifications.") }).optional().describe("Host can proxy resource reads to the MCP server."), logging: exports_external.object({}).optional().describe("Host accepts log messages."), sandbox: exports_external.object({ permissions: K.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."), csp: B.optional().describe("CSP domains approved by the host.") }).optional().describe("Sandbox configuration applied by the host."), updateModelContext: q.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."), message: q.optional().describe("Host supports receiving content messages (ui/message) from the view.") });
27071
+ var f = exports_external.object({ experimental: exports_external.object({}).optional().describe("Experimental features (structure TBD)."), tools: exports_external.object({ listChanged: exports_external.boolean().optional().describe("App supports tools/list_changed notifications.") }).optional().describe("App exposes MCP-style tools that the host can call."), availableDisplayModes: exports_external.array(G).optional().describe("Display modes the app supports.") });
27072
+ var ZQ = exports_external.object({ method: exports_external.literal("ui/notifications/initialized"), params: exports_external.object({}).optional() });
27073
+ var $Q = exports_external.object({ csp: B.optional().describe("Content Security Policy configuration for UI resources."), permissions: K.optional().describe("Sandbox permissions requested by the UI resource."), domain: exports_external.string().optional().describe(`Dedicated origin for view sandbox.
27073
27074
 
27074
27075
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
27075
27076
 
@@ -27084,27 +27085,27 @@ Boolean requesting whether a visible border and background is provided by the ho
27084
27085
  - \`true\`: request visible border + background
27085
27086
  - \`false\`: request no visible border + background
27086
27087
  - omitted: host decides border`) });
27087
- var $Q = exports_external.object({ method: exports_external.literal("ui/request-display-mode"), params: exports_external.object({ mode: L.describe("The display mode being requested.") }) });
27088
- var T = exports_external.object({ mode: L.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
27089
- var f = exports_external.union([exports_external.literal("model"), exports_external.literal("app")]).describe("Tool visibility scope - who can access the tool.");
27090
- var JQ = exports_external.object({ resourceUri: exports_external.string().optional(), visibility: exports_external.array(f).optional().describe(`Who can access this tool. Default: ["model", "app"]
27088
+ var JQ = exports_external.object({ method: exports_external.literal("ui/request-display-mode"), params: exports_external.object({ mode: G.describe("The display mode being requested.") }) });
27089
+ var T = exports_external.object({ mode: G.describe("The display mode that was actually set. May differ from requested if not supported.") }).passthrough();
27090
+ var u = exports_external.union([exports_external.literal("model"), exports_external.literal("app")]).describe("Tool visibility scope - who can access the tool.");
27091
+ var XQ = exports_external.object({ resourceUri: exports_external.string().optional(), visibility: exports_external.array(u).optional().describe(`Who can access this tool. Default: ["model", "app"]
27091
27092
  - "model": Tool visible to and callable by the agent
27092
27093
  - "app": Tool callable by the app from this server only`) });
27093
- var kQ = exports_external.object({ mimeTypes: exports_external.array(exports_external.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.') });
27094
- var XQ = exports_external.object({ method: exports_external.literal("ui/download-file"), params: exports_external.object({ contents: exports_external.array(exports_external.union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") }) });
27095
- var VQ = exports_external.object({ method: exports_external.literal("ui/message"), params: exports_external.object({ role: exports_external.literal("user").describe('Message role, currently only "user" is supported.'), content: exports_external.array(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
27096
- var DQ = exports_external.object({ method: exports_external.literal("ui/notifications/sandbox-resource-ready"), params: exports_external.object({ html: exports_external.string().describe("HTML content to load into the inner iframe."), sandbox: exports_external.string().optional().describe("Optional override for the inner iframe's sandbox attribute."), csp: B.optional().describe("CSP configuration from resource metadata."), permissions: K.optional().describe("Sandbox permissions from resource metadata.") }) });
27097
- var U = exports_external.object({ method: exports_external.literal("ui/notifications/tool-result"), params: CallToolResultSchema.describe("Standard MCP tool execution result.") });
27098
- var k = exports_external.object({ toolInfo: exports_external.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: b.optional().describe("Current color theme preference."), styles: C.optional().describe("Style configuration for theming the app."), displayMode: L.optional().describe("How the UI is currently displayed."), availableDisplayModes: exports_external.array(L).optional().describe("Display modes the host supports."), containerDimensions: exports_external.union([exports_external.object({ height: exports_external.number().describe("Fixed container height in pixels.") }), exports_external.object({ maxHeight: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(exports_external.union([exports_external.object({ width: exports_external.number().describe("Fixed container width in pixels.") }), exports_external.object({ maxWidth: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
27094
+ var RQ = exports_external.object({ mimeTypes: exports_external.array(exports_external.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.') });
27095
+ var VQ = exports_external.object({ method: exports_external.literal("ui/download-file"), params: exports_external.object({ contents: exports_external.array(exports_external.union([EmbeddedResourceSchema, ResourceLinkSchema])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.") }) });
27096
+ var DQ = exports_external.object({ method: exports_external.literal("ui/message"), params: exports_external.object({ role: exports_external.literal("user").describe('Message role, currently only "user" is supported.'), content: exports_external.array(ContentBlockSchema).describe("Message content blocks (text, image, etc.).") }) });
27097
+ var GQ = exports_external.object({ method: exports_external.literal("ui/notifications/sandbox-resource-ready"), params: exports_external.object({ html: exports_external.string().describe("HTML content to load into the inner iframe."), sandbox: exports_external.string().optional().describe("Optional override for the inner iframe's sandbox attribute."), csp: B.optional().describe("CSP configuration from resource metadata."), permissions: K.optional().describe("Sandbox permissions from resource metadata.") }) });
27098
+ var E = exports_external.object({ method: exports_external.literal("ui/notifications/tool-result"), params: CallToolResultSchema.describe("Standard MCP tool execution result.") });
27099
+ var k = exports_external.object({ toolInfo: exports_external.object({ id: RequestIdSchema.optional().describe("JSON-RPC id of the tools/call request."), tool: ToolSchema.describe("Tool definition including name, inputSchema, etc.") }).optional().describe("Metadata of the tool call that instantiated this App."), theme: g.optional().describe("Current color theme preference."), styles: y.optional().describe("Style configuration for theming the app."), displayMode: G.optional().describe("How the UI is currently displayed."), availableDisplayModes: exports_external.array(G).optional().describe("Display modes the host supports."), containerDimensions: exports_external.union([exports_external.object({ height: exports_external.number().describe("Fixed container height in pixels.") }), exports_external.object({ maxHeight: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container height in pixels.") })]).and(exports_external.union([exports_external.object({ width: exports_external.number().describe("Fixed container width in pixels.") }), exports_external.object({ maxWidth: exports_external.union([exports_external.number(), exports_external.undefined()]).optional().describe("Maximum container width in pixels.") })])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
27099
27100
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`), locale: exports_external.string().optional().describe("User's language and region preference in BCP 47 format."), timeZone: exports_external.string().optional().describe("User's timezone in IANA format."), userAgent: exports_external.string().optional().describe("Host application identifier."), platform: exports_external.union([exports_external.literal("web"), exports_external.literal("desktop"), exports_external.literal("mobile")]).optional().describe("Platform type for responsive design decisions."), deviceCapabilities: exports_external.object({ touch: exports_external.boolean().optional().describe("Whether the device supports touch input."), hover: exports_external.boolean().optional().describe("Whether the device supports hover interactions.") }).optional().describe("Device input capabilities."), safeAreaInsets: exports_external.object({ top: exports_external.number().describe("Top safe area inset in pixels."), right: exports_external.number().describe("Right safe area inset in pixels."), bottom: exports_external.number().describe("Bottom safe area inset in pixels."), left: exports_external.number().describe("Left safe area inset in pixels.") }).optional().describe("Mobile safe area boundaries in pixels.") }).passthrough();
27100
- var E = exports_external.object({ method: exports_external.literal("ui/notifications/host-context-changed"), params: k.describe("Partial context update containing only changed fields.") });
27101
+ var R = exports_external.object({ method: exports_external.literal("ui/notifications/host-context-changed"), params: k.describe("Partial context update containing only changed fields.") });
27101
27102
  var LQ = exports_external.object({ method: exports_external.literal("ui/update-model-context"), params: exports_external.object({ content: exports_external.array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: exports_external.record(exports_external.string(), exports_external.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) });
27102
- var GQ = exports_external.object({ method: exports_external.literal("ui/initialize"), params: exports_external.object({ appInfo: ImplementationSchema.describe("App identification (name and version)."), appCapabilities: u.describe("Features and capabilities this app provides."), protocolVersion: exports_external.string().describe("Protocol version this app supports.") }) });
27103
- var R = exports_external.object({ protocolVersion: exports_external.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: ImplementationSchema.describe("Host application identification and version."), hostCapabilities: y.describe("Features and capabilities provided by the host."), hostContext: k.describe("Rich context about the host environment.") }).passthrough();
27103
+ var WQ = exports_external.object({ method: exports_external.literal("ui/initialize"), params: exports_external.object({ appInfo: ImplementationSchema.describe("App identification (name and version)."), appCapabilities: f.describe("Features and capabilities this app provides."), protocolVersion: exports_external.string().describe("Protocol version this app supports.") }) });
27104
+ var U = exports_external.object({ protocolVersion: exports_external.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: ImplementationSchema.describe("Host application identification and version."), hostCapabilities: C.describe("Features and capabilities provided by the host."), hostContext: k.describe("Rich context about the host environment.") }).passthrough();
27104
27105
  var v = "ui/resourceUri";
27105
27106
  var d = "text/html;profile=mcp-app";
27106
27107
 
27107
- class qQ extends Protocol {
27108
+ class OQ extends Protocol {
27108
27109
  _appInfo;
27109
27110
  _capabilities;
27110
27111
  options;
@@ -27136,13 +27137,13 @@ class qQ extends Protocol {
27136
27137
  this.setNotificationHandler(P, ($) => Z($.params));
27137
27138
  }
27138
27139
  set ontoolresult(Z) {
27139
- this.setNotificationHandler(U, ($) => Z($.params));
27140
+ this.setNotificationHandler(E, ($) => Z($.params));
27140
27141
  }
27141
27142
  set ontoolcancelled(Z) {
27142
27143
  this.setNotificationHandler(H, ($) => Z($.params));
27143
27144
  }
27144
27145
  set onhostcontextchanged(Z) {
27145
- this.setNotificationHandler(E, ($) => {
27146
+ this.setNotificationHandler(R, ($) => {
27146
27147
  this._hostContext = { ...this._hostContext, ...$.params }, Z($.params);
27147
27148
  });
27148
27149
  }
@@ -27204,6 +27205,9 @@ class qQ extends Protocol {
27204
27205
  downloadFile(Z, $) {
27205
27206
  return this.request({ method: "ui/download-file", params: Z }, I, $);
27206
27207
  }
27208
+ requestTeardown(Z = {}) {
27209
+ return this.notification({ method: "ui/notifications/request-teardown", params: Z });
27210
+ }
27207
27211
  requestDisplayMode(Z, $) {
27208
27212
  return this.request({ method: "ui/request-display-mode", params: Z }, T, $);
27209
27213
  }
@@ -27216,11 +27220,11 @@ class qQ extends Protocol {
27216
27220
  return;
27217
27221
  Z = true, requestAnimationFrame(() => {
27218
27222
  Z = false;
27219
- let V = document.documentElement, G = V.style.width, W = V.style.height;
27223
+ let V = document.documentElement, L = V.style.width, W = V.style.height;
27220
27224
  V.style.width = "fit-content", V.style.height = "max-content";
27221
- let M = V.getBoundingClientRect();
27222
- V.style.width = G, V.style.height = W;
27223
- let h = window.innerWidth - V.clientWidth, N = Math.ceil(M.width + h), Y = Math.ceil(M.height);
27225
+ let x = V.getBoundingClientRect();
27226
+ V.style.width = L, V.style.height = W;
27227
+ let h = window.innerWidth - V.clientWidth, N = Math.ceil(x.width + h), Y = Math.ceil(x.height);
27224
27228
  if (N !== $ || Y !== J)
27225
27229
  $ = N, J = Y, this.sendSizeChanged({ width: N, height: Y });
27226
27230
  });
@@ -27234,7 +27238,7 @@ class qQ extends Protocol {
27234
27238
  throw Error("App is already connected. Call close() before connecting again.");
27235
27239
  await super.connect(Z);
27236
27240
  try {
27237
- let J = await this.request({ method: "ui/initialize", params: { appCapabilities: this._capabilities, appInfo: this._appInfo, protocolVersion: F } }, R, $);
27241
+ let J = await this.request({ method: "ui/initialize", params: { appCapabilities: this._capabilities, appInfo: this._appInfo, protocolVersion: F } }, U, $);
27238
27242
  if (J === undefined)
27239
27243
  throw Error(`Server sent invalid initialize result: ${J}`);
27240
27244
  if (this._hostCapabilities = J.hostCapabilities, this._hostInfo = J.hostInfo, this._hostContext = J.hostContext, await this.notification({ method: "ui/notifications/initialized" }), this.options?.autoResize)
@@ -27244,15 +27248,15 @@ class qQ extends Protocol {
27244
27248
  }
27245
27249
  }
27246
27250
  }
27247
- function uZ(Z, $, J, X) {
27248
- let D = J._meta, V = D.ui, G = D[v], W = D;
27249
- if (V?.resourceUri && !G)
27251
+ function hZ(Z, $, J, X) {
27252
+ let D = J._meta, V = D.ui, L = D[v], W = D;
27253
+ if (V?.resourceUri && !L)
27250
27254
  W = { ...D, [v]: V.resourceUri };
27251
- else if (G && !V?.resourceUri)
27252
- W = { ...D, ui: { ...V, resourceUri: G } };
27255
+ else if (L && !V?.resourceUri)
27256
+ W = { ...D, ui: { ...V, resourceUri: L } };
27253
27257
  return Z.registerTool($, { ...J, _meta: W }, X);
27254
27258
  }
27255
- function fZ(Z, $, J, X, D) {
27259
+ function mZ(Z, $, J, X, D) {
27256
27260
  return Z.registerResource($, J, { mimeType: d, ...X }, D);
27257
27261
  }
27258
27262
 
@@ -28503,7 +28507,7 @@ function createServer() {
28503
28507
  version: "1.0.0"
28504
28508
  });
28505
28509
  const resourceUri = "ui://get-time/mcp-app.html";
28506
- uZ(server, "get-time", {
28510
+ hZ(server, "get-time", {
28507
28511
  title: "Get Time",
28508
28512
  description: "Returns the current server time as an ISO 8601 string.",
28509
28513
  inputSchema: {},
@@ -28512,7 +28516,7 @@ function createServer() {
28512
28516
  const time3 = new Date().toISOString();
28513
28517
  return { content: [{ type: "text", text: time3 }] };
28514
28518
  });
28515
- fZ(server, resourceUri, resourceUri, { mimeType: d }, async () => {
28519
+ mZ(server, resourceUri, resourceUri, { mimeType: d }, async () => {
28516
28520
  const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8");
28517
28521
  return {
28518
28522
  contents: [{ uri: resourceUri, mimeType: d, text: html }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/server-basic-react",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "Basic MCP App Server example using React",
6
6
  "repository": {