@modelcontextprotocol/server-system-monitor 1.4.0 → 1.6.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/mcp-app.html CHANGED
@@ -81,7 +81,7 @@ Boolean requesting whether a visible border and background is provided by the ho
81
81
  - omitted: host decides border`)});v({method:_("ui/request-display-mode"),params:v({mode:hn.describe("The display mode being requested.")})});var cm=v({mode:hn.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),lm=F([_("model"),_("app")]).describe("Tool visibility scope - who can access the tool.");v({resourceUri:y().optional(),visibility:I(lm).optional().describe(`Who can access this tool. Default: ["model", "app"]
82
82
  - "model": Tool visible to and callable by the agent
83
83
  - "app": Tool callable by the app from this server only`)});v({mimeTypes:I(y()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});v({method:_("ui/download-file"),params:v({contents:I(F([tc,ec])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});v({method:_("ui/message"),params:v({role:_("user").describe('Message role, currently only "user" is supported.'),content:I(Cn).describe("Message content blocks (text, image, etc.).")})});v({method:_("ui/notifications/sandbox-resource-ready"),params:v({html:y().describe("HTML content to load into the inner iframe."),sandbox:y().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Ui.optional().describe("CSP configuration from resource metadata."),permissions:Yi.optional().describe("Sandbox permissions from resource metadata.")})});var um=v({method:_("ui/notifications/tool-result"),params:Cs.describe("Standard MCP tool execution result.")}),rc=v({toolInfo:v({id:wn.optional().describe("JSON-RPC id of the tools/call request."),tool:Wi.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:Yg.optional().describe("Current color theme preference."),styles:im.optional().describe("Style configuration for theming the app."),displayMode:hn.optional().describe("How the UI is currently displayed."),availableDisplayModes:I(hn).optional().describe("Display modes the host supports."),containerDimensions:F([v({height:L().describe("Fixed container height in pixels.")}),v({maxHeight:F([L(),ei()]).optional().describe("Maximum container height in pixels.")})]).and(F([v({width:L().describe("Fixed container width in pixels.")}),v({maxWidth:F([L(),ei()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
84
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:y().optional().describe("User's language and region preference in BCP 47 format."),timeZone:y().optional().describe("User's timezone in IANA format."),userAgent:y().optional().describe("Host application identifier."),platform:F([_("web"),_("desktop"),_("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:v({touch:X().optional().describe("Whether the device supports touch input."),hover:X().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:v({top:L().describe("Top safe area inset in pixels."),right:L().describe("Right safe area inset in pixels."),bottom:L().describe("Bottom safe area inset in pixels."),left:L().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),hm=v({method:_("ui/notifications/host-context-changed"),params:rc.describe("Partial context update containing only changed fields.")});v({method:_("ui/update-model-context"),params:v({content:I(Cn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:W(y(),J().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});v({method:_("ui/initialize"),params:v({appInfo:Ps.describe("App identification (name and version)."),appCapabilities:am.describe("Features and capabilities this app provides."),protocolVersion:y().describe("Protocol version this app supports.")})});var dm=v({protocolVersion:y().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ps.describe("Host application identification and version."),hostCapabilities:rm.describe("Features and capabilities provided by the host."),hostContext:rc.describe("Rich context about the host environment.")}).passthrough();class fm extends Vg{constructor(n,s={},i={autoResize:!0}){super(i);P(this,"_appInfo");P(this,"_capabilities");P(this,"options");P(this,"_hostCapabilities");P(this,"_hostInfo");P(this,"_hostContext");P(this,"eventSchemas",{toolinput:tm,toolinputpartial:em,toolresult:um,toolcancelled:nm,hostcontextchanged:hm});P(this,"_onteardown");P(this,"_oncalltool");P(this,"_onlisttools");P(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=s,this.options=i,this.setRequestHandler(Ts,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}onEventDispatch(n,s){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(om,(s,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(s.params,i)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(sc,(s,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(s.params,i)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(nc,(s,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(s.params,i)})}assertCapabilityForMethod(n){}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,s){if(typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Cs,s)}async readServerResource(n,s){return await this.request({method:"resources/read",params:n},Qa,s)}async listServerResources(n,s){return await this.request({method:"resources/list",params:n},Ga,s)}sendMessage(n,s){return this.request({method:"ui/message",params:n},Qg,s)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,s){return this.request({method:"ui/update-model-context",params:n},zi,s)}openLink(n,s){return this.request({method:"ui/open-link",params:n},Xg,s)}downloadFile(n,s){return this.request({method:"ui/download-file",params:n},Gg,s)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,s){return this.request({method:"ui/request-display-mode",params:n},cm,s)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,s=0,i=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,c=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=c;let u=Math.ceil(window.innerWidth);(u!==s||l!==i)&&(s=u,i=l,this.sendSizeChanged({width:u,height:l}))}))};o();let r=new ResizeObserver(o);return r.observe(document.documentElement),r.observe(document.body),()=>r.disconnect()}async connect(n=new Ug(window.parent,window.parent),s){var i;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(n);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Wg}},dm,s);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),(i=this.options)!=null&&i.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}/*!
84
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:y().optional().describe("User's language and region preference in BCP 47 format."),timeZone:y().optional().describe("User's timezone in IANA format."),userAgent:y().optional().describe("Host application identifier."),platform:F([_("web"),_("desktop"),_("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:v({touch:X().optional().describe("Whether the device supports touch input."),hover:X().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:v({top:L().describe("Top safe area inset in pixels."),right:L().describe("Right safe area inset in pixels."),bottom:L().describe("Bottom safe area inset in pixels."),left:L().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),hm=v({method:_("ui/notifications/host-context-changed"),params:rc.describe("Partial context update containing only changed fields.")});v({method:_("ui/update-model-context"),params:v({content:I(Cn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:W(y(),J().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});v({method:_("ui/initialize"),params:v({appInfo:Ps.describe("App identification (name and version)."),appCapabilities:am.describe("Features and capabilities this app provides."),protocolVersion:y().describe("Protocol version this app supports.")})});var dm=v({protocolVersion:y().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ps.describe("Host application identification and version."),hostCapabilities:rm.describe("Features and capabilities provided by the host."),hostContext:rc.describe("Rich context about the host environment.")}).passthrough();class fm extends Vg{constructor(n,s={},i={autoResize:!0}){super(i);P(this,"_appInfo");P(this,"_capabilities");P(this,"options");P(this,"_hostCapabilities");P(this,"_hostInfo");P(this,"_hostContext");P(this,"eventSchemas",{toolinput:tm,toolinputpartial:em,toolresult:um,toolcancelled:nm,hostcontextchanged:hm});P(this,"_onteardown");P(this,"_oncalltool");P(this,"_onlisttools");P(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=s,this.options=i,this.setRequestHandler(Ts,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}onEventDispatch(n,s){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(om,(s,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(s.params,i)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(sc,(s,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(s.params,i)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(nc,(s,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(s.params,i)})}assertCapabilityForMethod(n){}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,s){if(typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Cs,{onprogress:()=>{},resetTimeoutOnProgress:!0,...s})}async readServerResource(n,s){return await this.request({method:"resources/read",params:n},Qa,s)}async listServerResources(n,s){return await this.request({method:"resources/list",params:n},Ga,s)}sendMessage(n,s){return this.request({method:"ui/message",params:n},Qg,s)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,s){return this.request({method:"ui/update-model-context",params:n},zi,s)}openLink(n,s){return this.request({method:"ui/open-link",params:n},Xg,s)}downloadFile(n,s){return this.request({method:"ui/download-file",params:n},Gg,s)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,s){return this.request({method:"ui/request-display-mode",params:n},cm,s)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,s=0,i=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,c=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=c;let u=Math.ceil(window.innerWidth);(u!==s||l!==i)&&(s=u,i=l,this.sendSizeChanged({width:u,height:l}))}))};o();let r=new ResizeObserver(o);return r.observe(document.documentElement),r.observe(document.body),()=>r.disconnect()}async connect(n=new Ug(window.parent,window.parent),s){var i;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(n);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Wg}},dm,s);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),(i=this.options)!=null&&i.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}/*!
85
85
  * @kurkle/color v0.3.4
86
86
  * https://github.com/kurkle/color#readme
87
87
  * (c) 2024 Jukka Kurkela
package/dist/server.js CHANGED
@@ -45650,7 +45650,7 @@ class zQ extends j {
45650
45650
  async callServerTool(Z, $) {
45651
45651
  if (typeof Z === "string")
45652
45652
  throw Error(`callServerTool() expects an object as its first argument, but received a string ("${Z}"). Did you mean: callServerTool({ name: "${Z}", arguments: { ... } })?`);
45653
- return await this.request({ method: "tools/call", params: Z }, CallToolResultSchema, $);
45653
+ return await this.request({ method: "tools/call", params: Z }, CallToolResultSchema, { onprogress: () => {}, resetTimeoutOnProgress: true, ...$ });
45654
45654
  }
45655
45655
  async readServerResource(Z, $) {
45656
45656
  return await this.request({ method: "resources/read", params: Z }, ReadResourceResultSchema, $);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/server-system-monitor",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "description": "System monitor MCP App Server with real-time stats",
6
6
  "repository": {