Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

sysutils-stdio-rust (v0.3.0)

sysutils-stdio-rust is a Model Context Protocol (MCP) server written in Rust. It provides system utility tools to MCP clients (like Claude Code or Gemini CLI) using the Stdio transport (Standard Input/Output).

This project allows LLMs to safely query local system information such as CPU usage, memory statistics, and disk space.

Features

  • MCP Stdio Transport: Communicates via JSON-RPC messages over stdin/stdout.
  • Performance: Built with Rust and Tokio for efficiency.
  • Direct CLI Mode: Can be run directly from the command line for quick reports.
  • Structured Logging: Logs are sent to stderr in JSON format to avoid interfering with the JSON-RPC transport on stdout.

Tools

The server exposes the following MCP tools:

  1. local_system_info: Generates a comprehensive system report.

    • System Name, Kernel, OS Version, Hostname
    • CPU Core Count
    • Memory Usage (Total, Used, Swap)
    • Network Interface Statistics (RX/TX bytes, MAC addresses)
  2. disk_usage: Lists usage statistics for all mounted disks.

    • Mount Point, File System
    • Used/Total Space
    • Percentage Used

Prerequisites

  • Rust (Edition 2024 compatible)
  • make (optional, for convenience)

Installation & Build

Clone the repository and build the project:

cargo build --release

Usage

1. As an MCP Server (with Claude Code)

Claude Code reads project-scoped MCP servers from a .mcp.json in the directory it is launched from. The repository gitignores .mcp.json (see the root .gitignore — it can carry injected API keys), so create it in this directory:

{
  "mcpServers": {
    "sysutils-stdio-rust": {
      "type": "stdio",
      "command": "${HOME}/iap-https-rust/stdio/target/release/sysutils-stdio-rust",
      "args": ["--prebuilt", "--stdio"],
      "env": {
        "RUST_LOG": "trace"
      }
    }
  }
}

Then build the release binary, start Claude Code from this directory, and approve the project server on first launch:

make release
claude

Verify the connection with the /mcp slash command inside the session, or from the shell with claude mcp list.

2. As an MCP Server (with Gemini CLI)

The Gemini CLI configuration is located in .gemini/settings.json:

{
  "mcpServers": {
    "sysutils-stdio-rust": {
      "command": "cargo",
      "args": ["run", "--quiet", "--release"],
      "env": {
        "RUST_LOG": "info,sysutils_stdio_rust=debug"
      }
    }
  }
}

When you start a session with Gemini, this server will automatically start, and the tools will be available to the model.

3. Direct CLI Usage

You can run the tools directly without an MCP client for debugging or quick checks:

System Info:

make info
# OR
cargo run --quiet -- info

Disk Usage:

make disk
# OR
cargo run --quiet -- disk

4. Manual MCP Server Run

To start the server manually (it will wait for JSON-RPC input on stdin):

make run
# OR
cargo run --release

Development

  • Check: make check
  • Test: make test
  • Format: make fmt
  • Lint: make clippy