@modelcontextprotocol/server-system-monitor 1.0.1 → 1.1.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/README.md CHANGED
@@ -79,18 +79,24 @@ To test local modifications, use this configuration (replace `~/code/ext-apps` w
79
79
 
80
80
  ### Server (`server.ts`)
81
81
 
82
- Exposes a single `get-system-stats` tool that returns:
82
+ Exposes two tools demonstrating a polling pattern:
83
83
 
84
- - Raw per-core CPU timing data (idle/total counters)
85
- - Memory usage (used/total/percentage)
86
- - System info (hostname, platform, uptime)
84
+ 1. **`get-system-info`** (Model-visible) Returns static system configuration:
85
+ - Hostname, platform, architecture
86
+ - CPU model and core count
87
+ - Total memory
87
88
 
88
- The tool is linked to a UI resource via `_meta.ui.resourceUri`.
89
+ 2. **`poll-system-stats`** (App-only, `visibility: ["app"]`) Returns dynamic metrics:
90
+ - Per-core CPU timing data (idle/total counters)
91
+ - Memory usage (used/free/percentage)
92
+ - Uptime
93
+
94
+ The Model-visible tool is linked to a UI resource via `_meta.ui.resourceUri`.
89
95
 
90
96
  ### App (`src/mcp-app.ts`)
91
97
 
98
+ - Receives static system info via `ontoolresult` when the host sends the `get-system-info` result
99
+ - Polls `poll-system-stats` every 2 seconds for dynamic metrics
92
100
  - Uses Chart.js for the stacked area chart visualization
93
- - Polls the server tool every 2 seconds
94
101
  - Computes CPU usage percentages client-side from timing deltas
95
102
  - Maintains a 30-point history (1 minute at 2s intervals)
96
- - Updates all UI elements on each poll