mcpField
主
主机信息获取工具

主机信息获取工具

Local
github.com/netbufferCloud & Infra0Updated 9w ago

About 主机信息获取工具

主机信息获取工具 is a lightweight MCP server built with Spring Boot, Spring AI, and OSHI for applications that need host status. It provides CPU, memory, disk, and operating system details through one tool.

Key features

  1. 01Read CPU name and core count
  2. 02Check total and available memory
  3. 03Get mounted-volume disk usage
  4. 04Read operating system details
  5. 05Integrate with Spring AI applications

Use cases

  1. 01Query host hardware from an MCP client
  2. 02Inspect memory and disk usage
  3. 03Add system information to a Spring AI application

MCP support

The MCP server exposes the `get_system_info` tool for MCP clients to retrieve host system information.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

machine-info-mcp-server

License Java Spring Boot Spring AI oshi

English Documentation

一个轻量级的主机信息获取MCP工具,通过MCP(模型上下文协议)接口提供系统信息,基于Spring Boot 4.1.1 + Spring AI 2.0.1 + OSHI(操作系统和硬件信息)库构建,并启用JDK 21虚拟线程以提升并发性能。

https://github.com/netbuffer/machine-info-mcp-server
https://gitee.com/netbuffer/machine-info-mcp-server

功能特性

  • 获取详细的系统信息,包括:
    • 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/java21"  // 可选,如果系统未设置JAVA_HOME
      },
      "description": "获取系统信息的MCP服务"
    }
  }
}
配置项说明
  • command: 启动命令(通常是java)
  • args: 启动参数,-jar 后跟jar包路径
  • env: 环境变量配置(可选)
  • description: 服务描述(可选)
验证配置

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

在Trae中使用示例

环境要求

  • Java 21 或更高版本
  • 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
  main:
    banner-mode: off
    web-application-type: none
  threads:
    virtual:
      enabled: true

贡献

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

许可证

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

致谢


Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.