A Model Context Protocol (MCP) server written in Rust, optimized for local development and system monitoring. It provides system utility tools via streaming HTTP and includes built-in CLI commands for quick reports.
This project implements an MCP server using the rmcp SDK with a transport-streamable-http-server. It is designed to be easily run locally while maintaining compatibility with Google Cloud Identity-Aware Proxy (IAP) patterns.
- MCP Tools:
local_system_info: Comprehensive system report (CPU, Memory, OS, Network, IAP context).disk_usage: Detailed usage statistics for all mounted disks.
- CLI Mode: Run reports directly from the terminal without starting the HTTP server.
- Security:
- Optional API key validation via
x-goog-api-keyheader orkeyquery parameter in the URL. - Dual-stage API key fetching: Attempts to use
gcloudCLI (optimized for local dev) with a library-based fallback using Application Default Credentials (ADC) to find an "MCP API Key" in Google Cloud. - IAP JWT decoding for identity context.
- Optional API key validation via
- Monitoring:
- Integrated health check endpoint at
/health. - Automatic inclusion of local IAP configuration files (
iap_settings.yaml, etc.) in system reports.
- Integrated health check endpoint at
- Rust (Edition 2024)
- gcloud CLI (Optional, for automatic API key fetching)
PORT: Port for the HTTP server (default:8080).RUST_LOG: Logging level (default:info,sysutils_local_rust=debug).MCP_API_KEY: (Optional) Required API key for thex-goog-api-keyheader. If not set, the server attempts to fetch it from Google Cloud API keys named "MCP API Key".
-
Build:
cargo build
-
Run Server:
make run # OR cargo run --release -
CLI Commands:
cargo run -- info # Display system report + verify API key status cargo run -- disk # Display disk usage report
- Format code:
make fmt - Lint code:
make clippy - Run tests:
make test - Check code:
make check
The project includes unit tests for:
- Schema generation verification.
- System info and disk usage tool logic.
- IAP JWT decoding.
- Context propagation via task-local storage.
This project is licensed under the MIT License.