{"_id":"@darkphilosophy/system-monitor","_rev":"2-bd53701b3f319ca3c5f9a0d490599486","name":"@darkphilosophy/system-monitor","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@darkphilosophy/system-monitor","version":"0.2.0","keywords":["monitoring","system","linux","mcp","api","metrics"],"author":{"name":"DarkPhilosophy"},"license":"GPL-3.0-or-later","_id":"@darkphilosophy/system-monitor@0.2.0","maintainers":[{"name":"ualexen92","email":"ualexen92@gmail.com"}],"dist":{"shasum":"9ae943e1486148598d7c399945f8b8d199eb7395","tarball":"https://registry.npmjs.org/@darkphilosophy/system-monitor/-/system-monitor-0.2.0.tgz","fileCount":31,"integrity":"sha512-RmICLyePIYHE6vbv1G36TX7phPP+fRhtOQNC7/c/xmEg8a+hGvt7D8QQWXOU5qCpZM/jacmxPSnJib0KlX7WQQ==","signatures":[{"sig":"MEUCIG/qTTX/1VfNhSp2Jc9OJtZo7PAjuLCCPU7DoG6cDhO4AiEA/tHBj6vSoHwjcdckPJ7FZslHVtegDbyFReunImbgSxc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79299},"main":"src/index.js","gitHead":"d00e2af712a55f007dbd3c647a0bfc6615f9e2cd","scripts":{"dev":"node --watch src/index.js","lint":"eslint src .scripts --format stylish","test":"echo \"Error: no test specified\" && exit 1","start":"node src/index.js","format":"prettier --write \"src/**/*.js\" \".scripts/**/*.js\"","prepare":"husky install","lint:fix":"eslint --fix src .scripts --format stylish","validate":"node .scripts/validate-build.js && node .scripts/scan-leaks.js","lint:status":"node .scripts/update-lint-status.js","format:check":"prettier --check \"src/**/*.js\" \".scripts/**/*.js\"","sync-version":"node .scripts/sync-version.js"},"_npmUser":{"name":"ualexen92","email":"ualexen92@gmail.com"},"_npmVersion":"10.8.2","description":"A comprehensive system monitoring library for Linux servers with MCP protocol and HTTP REST API support (JavaScript version)","directories":{},"_nodeVersion":"20.20.0","dependencies":{"cors":"^2.8.5","uuid":"^9.0.1","morgan":"^1.10.0","express":"^4.19.2","systeminformation":"^5.22.9","@modelcontextprotocol/sdk":"^1.25.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.39.2","globals":"^17.1.0","prettier":"^3.8.1","@eslint/js":"^9.39.2","eslint-plugin-jsdoc":"^62.4.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5"},"_npmOperationalInternal":{"tmp":"tmp/system-monitor_0.2.0_1769354162797_0.8121992949777423","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@darkphilosophy/system-monitor","version":"0.2.1","description":"A comprehensive system monitoring library for Linux servers with MCP protocol and HTTP REST API support (JavaScript version)","main":"src/index.js","bin":{"mcp-system-monitor":"bin/mcp-system-monitor.js"},"scripts":{"start":"node src/index.js","dev":"node --watch src/index.js","test":"echo \"Error: no test specified\" && exit 1","lint":"eslint src .scripts --format stylish","lint:fix":"eslint --fix src .scripts --format stylish","lint:status":"node .scripts/update-lint-status.js","validate":"node .scripts/validate-build.js && node .scripts/scan-leaks.js","sync-version":"node .scripts/sync-version.js","format":"prettier --write \"src/**/*.js\" \".scripts/**/*.js\"","format:check":"prettier --check \"src/**/*.js\" \".scripts/**/*.js\"","prepare":"husky install"},"keywords":["monitoring","system","linux","mcp","api","metrics"],"author":{"name":"DarkPhilosophy"},"license":"GPL-3.0-or-later","publishConfig":{"access":"public"},"dependencies":{"@modelcontextprotocol/sdk":"^1.25.1","cors":"^2.8.5","express":"^4.19.2","morgan":"^1.10.0","systeminformation":"^5.22.9","uuid":"^9.0.1"},"devDependencies":{"@eslint/js":"^9.39.2","eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-jsdoc":"^62.4.1","eslint-plugin-prettier":"^5.5.5","globals":"^17.1.0","husky":"^9.1.7","prettier":"^3.8.1"},"_id":"@darkphilosophy/system-monitor@0.2.1","gitHead":"cacf0088ad0efe0b8b332636c77d2e645efe5779","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-SQIa1t9NV5Nx0m44Iq7TtsK0KMu4wy5qEnr1T6yMu7qNsfxIBd/BuAHYE9mcqC2dr8xe539iiNHSEktDnAMJJA==","shasum":"d9bb6ba12404841dbba0f605d9be56d18b579ad4","tarball":"https://registry.npmjs.org/@darkphilosophy/system-monitor/-/system-monitor-0.2.1.tgz","fileCount":32,"unpackedSize":78113,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDwoBO6Z132T6GlEHBViFUscCoGoRXNWhfj4rBHqmAfOAiBDpkt40eLHKeTH1nOuB/LugAN5fVoa+BPi5fiQKoFXzw=="}]},"_npmUser":{"name":"ualexen92","email":"ualexen92@gmail.com"},"directories":{},"maintainers":[{"name":"ualexen92","email":"ualexen92@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/system-monitor_0.2.1_1769356365597_0.6699176956399544"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-25T15:16:02.705Z","modified":"2026-01-25T15:52:45.865Z","0.2.0":"2026-01-25T15:16:02.950Z","0.2.1":"2026-01-25T15:52:45.747Z"},"author":{"name":"DarkPhilosophy"},"license":"GPL-3.0-or-later","keywords":["monitoring","system","linux","mcp","api","metrics"],"description":"A comprehensive system monitoring library for Linux servers with MCP protocol and HTTP REST API support (JavaScript version)","maintainers":[{"name":"ualexen92","email":"ualexen92@gmail.com"}],"readme":"# System Monitor MCP Server for Linux\n\nA Model Context Protocol (MCP) server implementation in JavaScript, designed for AI agents to monitor and interact with Linux systems. This server provides comprehensive metrics including CPU, memory, disk, network, and process data through both Stdio and secured HTTP/SSE transports.\n\n## Features\n\n- **Dual Mode**: Runs as a standard MCP server (Stdio) or a secured HTTP server (`--http`).\n- **Performance Optimized**: Uses TTL caching for static hardware info and parallel sensor polling.\n- **System Information**: Hostname, OS details, kernel version, uptime.\n- **CPU Monitoring**: Usage %, frequency, cores, brand, and temperature.\n- **Memory Monitoring**: RAM and swap usage, real-time availability.\n- **Disk Monitoring**: Storage usage, file system types, and mount point filtering.\n- **Network Monitoring**: Interface statistics, traffic data, and error tracking.\n- **Persistent Metrics**: Background persistence to `history.json` with a rolling 24-hour window.\n- **Proactive Alerting**: Real-time threshold monitoring (CPU, Memory, Disk, Temp) with immediate console warnings.\n- **Advanced Process Tracking**: Filter, sort, and limit process lists by resource consumption.\n\n## Security\n\n### HTTP Authentication\nWhen running in HTTP mode (`--http`), you can secure the endpoint using an API key.\n\n1.  Set the `MCP_API_KEY` environment variable:\n    ```bash\n    export MCP_API_KEY=\"your-secure-token-here\"\n    node src/index.js --http\n    ```\n\n2.  Clients must then provide the key in the `x-api-key` header or as a query parameter:\n    - **Header**: `x-api-key: your-secure-token-here`\n    - **Query**: `http://localhost:57996/sse?apiKey=your-secure-token-here`\n\n*Note: If `MCP_API_KEY` is not set, the HTTP server will default to public access (local network only recommended).*\n\n## Usage\n\n### MCP Mode (Default / Stdio)\nUsed by MCP-compatible clients like Claude Desktop or OpenCode.\n\n```bash\nnode src/index.js\n```\n\n**OpenCode Configuration (`~/.config/opencode/opencode.json`):**\n```json\n\"system-monitor\": {\n  \"type\": \"local\",\n  \"command\": [\n    \"node\",\n    \"/var/home/alexa/.gemini/extensions/system-monitor-js/src/index.js\"\n  ],\n  \"enabled\": true\n}\n```\n\n### HTTP Server Mode\n```bash\nnode src/index.js --http\n```\nThe server listens on port **57996** by default.\n\n## Tools\n\n- `get_system_info`: General OS/Kernel details.\n- `get_cpu_info`: Load, specs, and temperature.\n- `get_memory_info`: RAM/Swap metrics.\n- `get_disk_info`: Partition usage. Parameters: `mountPoint` (optional).\n- `get_network_info`: Traffic and interface stats.\n- `get_processes`: Active processes. Parameters: `limit` (number), `name` (filter), `sortBy` (`cpu_usage`, `memory_usage`, `priority`).\n- `get_system_metrics`: Consolidated system health snapshot.\n- `get_metrics_history`: Retrieve historical performance trends. Parameters: `limit` (number of minutes).\n- `get_battery_info`: Power status and battery health.\n- `get_usb_devices`: Connected hardware list.\n\n## Validation Status\n\n<!-- LINT-RESULT-START -->\n### Linting Status\n> **Status**: ✅ **Passing**  \n> **Last Updated**: 2026-01-25 12:03:39 UTC  \n> **Summary**: 0 errors, 0 warnings\n<!-- LINT-RESULT-END -->\n\n<!-- LATEST-VERSION-START -->\n<details open>\n<summary><strong>Latest Update (v0.2.0)</strong></summary>\n\n- 2026-01-25\n- **HTTP Authentication**: Added support for `MCP_API_KEY` environment variable to secure the SSE/HTTP endpoint.\n- **Input Validation**: Implemented Zod schemas for all tool parameters to ensure strict input handling.\n- **Code Consolidation**: Merged `mcp_server.js` into `index.js` for a cleaner, unified codebase using the official MCP SDK for both transport modes.\n- **Static Caching**: Added a TTL-based cache (1 hour) for static system data (OS info, CPU hardware) to reduce redundant system calls.\n- **Parallel Data Fetching**: Optimized all data-gathering functions to use `Promise.all` for parallel hardware sensor queries.\n- **Renamed Identity**: Rebranded the server from `mcp-system-monitor-js` to a simpler `system-monitor`.\n- **Persistent Metrics**: Implemented background persistence to `history.json` with a rolling 24-hour window.\n- **Proactive Alerting**: Added real-time threshold monitoring (CPU, Memory, Disk, Temp) with console warnings.\n- **Trend Analysis**: Introduced `get_metrics_history` tool to retrieve performance history.\n- **Enhanced `get_processes`**: Added support for `limit`, `name` filtering, and `sortBy` (`cpu_usage`, `memory_usage`, `priority`).\n- **Enhanced `get_disk_info`**: Added `mountPoint` filtering support.\n- **Aggregated Metrics**: Improved `get_system_metrics` tool to return a consolidated, prioritized snapshot of system health.\n- **Auto-Update**: Added non-blocking auto-update script that checks for newer versions on startup.\n\n</details>\n<!-- LATEST-VERSION-END -->","readmeFilename":"README.md"}