Skip to content

Enyu-Liu/Example_system_mcp

Repository files navigation

System Toolbox MCP Server

A Model Context Protocol (MCP) server that provides system utilities including system information, time queries, mathematical calculations, and UUID generation.

Features

Tool Description
get_system_info Get detailed system information (OS, CPU, memory, network)
get_current_time Get current date/time with timezone and format options
calculate Perform mathematical calculations with common math functions
generate_uuid Generate UUID v4 identifiers

Installation

# Clone or download this directory
cd system-toolbox-mcp

# Install dependencies
npm install

# Build the project
npm run build

Usage

Claude Code (CLI)

Create a .mcp.json file in your project root directory:

{
  "mcpServers": {
    "system-toolbox": {
      "command": "node",
      "args": ["/path/to/system-toolbox-mcp/dist/index.js"]
    }
  }
}

Cline (VS Code Extension)

Add to your Cline MCP settings (cline_mcp_settings.json in VS Code settings):

{
  "mcpServers": {
    "system-toolbox": {
      "command": "node",
      "args": ["/path/to/system-toolbox-mcp/dist/index.js"],
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

Claude Desktop App

Add to claude_desktop_config.json (location varies by OS):

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "system-toolbox": {
      "command": "node",
      "args": ["/path/to/system-toolbox-mcp/dist/index.js"]
    }
  }
}

Using npx (Alternative)

After building, you can also register the server globally:

npm link

Then use in configs:

{
  "mcpServers": {
    "system-toolbox": {
      "command": "npx",
      "args": ["-y", "system-toolbox-mcp"]
    }
  }
}

Tool Documentation

get_system_info

Get detailed system information.

Parameters:

  • category (optional): One of "all", "os", "cpu", "memory", "network". Default: "all"

Example:

{
  "name": "get_system_info",
  "arguments": {
    "category": "cpu"
  }
}

Response:

{
  "cpu": {
    "model": "11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz",
    "cores": 8,
    "speed": "2803 MHz",
    "loadAverage": [0, 0, 0]
  }
}

get_current_time

Get current date and time with timezone support.

Parameters:

  • timezone (optional): Timezone name (e.g., "America/New_York", "Asia/Shanghai", "UTC")
  • format (optional): One of "iso", "locale", "unix", "custom". Default: "iso"
  • locale (optional): Locale for formatting (e.g., "en-US", "zh-CN")

Example:

{
  "name": "get_current_time",
  "arguments": {
    "timezone": "Asia/Shanghai",
    "format": "locale",
    "locale": "zh-CN"
  }
}

calculate

Perform mathematical calculations safely.

Parameters:

  • expression (required): Mathematical expression to evaluate

Supported operations:

  • Basic: +, -, *, /, %, ^ (power)
  • Functions: sqrt, abs, sin, cos, tan, asin, acos, atan, log, log10, log2, exp, floor, ceil, round, pow, min, max, random
  • Constants: PI, E, LN2, LN10, SQRT2

Example:

{
  "name": "calculate",
  "arguments": {
    "expression": "sqrt(16) + pow(2, 10)"
  }
}

Response:

{
  "result": 1028
}

generate_uuid

Generate UUID v4 identifiers.

Parameters:

  • count (optional): Number of UUIDs to generate (1-100). Default: 1
  • uppercase (optional): Return UUIDs in uppercase. Default: false

Example:

{
  "name": "generate_uuid",
  "arguments": {
    "count": 5,
    "uppercase": true
  }
}

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
node test-server.mjs

# Run in development mode
npm run dev

Project Structure

system-toolbox-mcp/
├── src/
│   └── index.ts        # Main MCP server implementation
├── dist/               # Compiled JavaScript output
├── package.json        # Project configuration
├── tsconfig.json       # TypeScript configuration
├── test-server.mjs     # Test script
└── README.md           # This file

Requirements

  • Node.js >= 18.0.0
  • npm >= 8.0.0

License

MIT

About

A Model Context Protocol (MCP) server providing system utilities: system info, time queries, calculator, and UUID generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors