Sponsored by Deepsite.site

主机信息获取工具

Created By
netbuffer8 days ago
一个轻量级的主机信息获取MCP工具,通过MCP(模型上下文协议)接口提供系统信息,基于Spring Boot3+Spring AI+OSHI(操作系统和硬件信息)库构建。
Content

machine-info-mcp-server

License Java Spring Boot Spring AI oshi

English Documentation

一个轻量级的主机信息获取MCP工具,通过MCP(模型上下文协议)接口提供系统信息,基于Spring Boot3+Spring AI+OSHI(操作系统和硬件信息)库构建。

https://github.com/netbuffer/machine-info-mcp-server
https://gitee.com/netbuffer/machine-info-mcp-server
https://github.com/netbuffer/machine-info-mcp-server/releases/download/v1.0.0/machine-info-mcp-server.jar

功能特性

  • 获取详细的系统信息,包括:
    • CPU详情(名称、核心数)
    • 内存使用情况(总量、可用量)
    • 所有挂载卷的磁盘信息(名称、总空间、已用空间、可用空间、使用率)
    • 操作系统信息
  • 轻量级且快速
  • 易于与Spring AI应用集成
  • 提供MCP接口获取系统信息

MCP客户端集成方法

配置说明

将如下JSON配置添加到MCP客户端的配置文件中(通常是~/.mcp/config.json或项目根目录下的mcp.config.json):

{
  "mcpServers": {
    "machine-info-mcp-server": {
      "command": "java",
      "args": [
        "-jar",
        "machine-info-mcp-server.jar"
      ],
      "env": {
        "JAVA_HOME": "/path/to/your/java17"  // 可选,如果系统未设置JAVA_HOME
      },
      "description": "获取系统信息的MCP服务"
    }
  }
}

配置项说明

  • command: 启动命令(通常是java
  • args: 启动参数,-jar 后跟jar包路径
  • env: 环境变量配置(可选)
  • description: 服务描述(可选)

验证配置

保存配置文件后,应该能看到get_system_info工具在可用工具列表中。

环境要求

  • Java 17 或更高版本
  • Maven 3.6.3 或更高版本

快速开始

从源码构建

# 克隆仓库
git clone https://github.com/netbuffer/machine-info-mcp-server.git
cd machine-info-mcp-server

# 构建项目
mvn clean package

# 运行应用
java -jar target/machine-info-mcp-server.jar

API接口

  • get_system_info - 获取主机信息

响应示例:

{
  "cpu_cores": "8",
  "cpu_name": "Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz",
  "memory_total": "16384 MB",
  "memory_available": "8192 MB",
  "os_name": "Windows 10",
  "os_version": "10.0",
  "disk_count": "2",
  "disk1_name": "C:",
  "disk1_total_gb": "465.76 GB",
  "disk1_free_gb": "200.45 GB",
  "disk1_used_gb": "265.31 GB",
  "disk1_used_percent": "57.0%",
  "disk1_type": "NTFS",
  "disk1_mount": "C:\\"
}

配置

编辑 src/main/resources/application.yaml 自定义应用设置:

spring:
  application:
    name: machine-info-mcp-server
  ai:
    mcp:
      server:
        enabled: true
        name: ${spring.application.name}
        version: 1.0.0
        type: async
        stdio: true

贡献

欢迎贡献代码!请随时提交Pull Request。

许可证

本项目采用MIT许可证 - 详情请参阅LICENSE文件。

致谢


Server Config

{
  "mcpServers": {
    "machine-info-mcp-server": {
      "args": [
        "-jar",
        "machine-info-mcp-server.jar"
      ],
      "command": "java",
      "description": "获取系统信息的MCP服务",
      "env": {
        "JAVA_HOME": "/path/to/your/java17"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.