1 unstable release
Uses new Rust 2024
| 0.2.0 | Feb 4, 2026 |
|---|
#1225 in HTTP server
25KB
193 lines
sysutils-https-rust (v0.2.0)
A Rust-based Model Context Protocol (MCP) server that provides system utility tools. This application runs over streaming HTTP and allows MCP clients to access detailed system information.
Overview
sysutils-https-rust implements an MCP server using the rmcp library. It exposes tools to retrieve system metrics such as kernel version, CPU usage, memory statistics, and disk information. Unlike traditional stdio-based servers, this version is designed to run as a web service, making it ideal for deployments like Google Cloud Run.
Features
- MCP Protocol Support: Implements the Model Context Protocol over streaming HTTP.
- System Information: Provides a detailed report of the host system.
- Tool:
get_system_info - Collected Data:
- System: Name, Kernel version, OS version, Host name.
- CPU: Number of cores.
- Memory: Total/Used RAM and Total/Used Swap (in MB).
- Disk: Name, File system, Total/Available space (in GB) for all mounted disks.
- Tool:
- Logging: Structured JSON logging to
stderrusingtracing-subscriber. - CLI Mode: Direct execution to print system information without starting the MCP server.
- Health Check: Includes a
/healthendpoint for monitoring.
Getting Started
Prerequisites
- Rust Toolchain (Edition 2024)
- Make (optional, for convenience)
Build
You can build the project using Cargo or the provided Makefile.
Using Cargo:
cargo build --release
Using Makefile:
make release
The executable will be located at target/release/sysutils-https-rust.
Usage
As an MCP Server (HTTP)
To run the server locally (listening on port 8080 by default):
make run
# or
./target/release/sysutils-https-rust
The server will listen on http://0.0.0.0:8080. You can configure the port using the PORT environment variable.
CLI Usage (Direct Info)
You can also run the system information tool directly from the command line:
cargo run -- info
# or
./target/release/sysutils-https-rust info
This will print the system information report to stdout and exit.
Development
The project includes a Makefile to streamline development tasks.
- Format Code:
make fmt - Lint Code:
make clippy - Run Tests:
make test - Clean Build:
make clean - Check Code:
make check
Deployment
Docker & Google Cloud Run
The project is containerized and ready for deployment to Google Cloud Run.
- Build Docker Image:
make docker-build - Deploy to Cloud Build:
make deploy(Requires Google Cloud SDK)
The Dockerfile uses a multi-stage build and targets a distroless runtime for security and minimal image size.
Dependencies
~20–38MB
~473K SLoC