Linux MCP

io.github.Mohabdo21由 GitHub 账号 Mohabdo21 发布v0.3.0更新于 Nov 6, 2026

Linux MCP server for real-time system monitoring - CPU, memory, disk, network, processes, Docker.

概览

AI 生成的概览

本地运行的 Linux 监控 MCP 服务器,让助手实时查看 CPU、内存、磁盘、网络、进程、Docker、服务、安全与硬件信息。

可以做什么
  • 读取系统、CPU、内存、磁盘、网络与硬件指标,并可一次调用获取系统快照
  • 列出并按 CPU 或内存排序进程,查看打开的文件描述符、连接与监听端口
  • 检查 Docker 容器、镜像、网络、卷与容器统计
  • 查看 systemd 单元、定时器、crontab 与 cron 任务,以及已安装软件包和可用更新
  • 审计安全状况:会话、失败登录、SELinux/AppArmor、防火墙、SSH、SUID 与世界可写文件
  • 读取 /proc 诊断信息、man 手册、SMART 与 RAID 健康状态,并以 MCP 资源形式提供系统数据
适用场景
适合让助手诊断或汇报其所在的 Linux 主机:排查负载、磁盘压力、异常服务、容器状态、待更新项或安全问题,无需自己逐条输入命令。
运行要求
以本地进程方式在 Linux 上通过 STDIO 运行,由 MCP 客户端启动。可下载预编译二进制、用 go install 安装,或用 Go 1.27+ 从源码构建。Docker 为可选,仅 Docker 相关工具需要。可选配置文件位于 ~/.config/linux-mcp/config.json 或通过 LINUX_MCP_CONFIG 指定;ping 与 IP 地理位置查询需要网络访问。
安装前请注意
它会把主机诊断信息暴露给已连接的客户端,README 提醒日志和标签等诊断内容可能含敏感数据,因此只应授权给可信客户端。部分工具会访问外部服务(ip-api.com 用于 IP 地理位置)并执行网络探测。Docker 响应会省略环境变量值和原始命令参数,但其他输出仍可能泄露系统细节。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Linux MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

linux-mcp - Linux MCP Server

A Linux system monitoring server built on the Model Context Protocol (MCP). Provides real-time system information - CPU, memory, disk, network, processes, Docker, and more - via MCP tools over STDIO transport.

[MCP Registry] [linux-mcp MCP server] [GitHub Downloads (all assets, all releases)] [Linux MCP on mcprush]

[linux-mcp demo]

Features

  • System - hostname, OS, kernel, architecture, uptime, load averages
  • CPU - usage, model, frequency, core counts, temperature sensors
  • Memory - RAM and swap usage with percentages
  • Disk - per-partition usage, inodes, mount options, largest files, block devices
  • Network - interface stats, active connections, listening ports, DNS, ping, IP geolocation & ASN lookup
  • Processes - running processes sorted by CPU or memory, open file descriptors per process
  • Docker - containers, images, networks, volumes, disk usage, system info, and container stats
  • Services & automation - systemd units, service status, user timers, crontab, system cron jobs
  • Security - active user sessions, failed login detection, SELinux/AppArmor status, firewall/SSH/SUID/world-writable audit with security score
  • Packages - installed packages and available updates (pacman, dpkg, rpm/dnf, apk)
  • Hardware - GPU info, PCI/USB bus devices, power/battery analytics
  • Desktop session - Wayland/X11 protocol, DE identifiers, runtime config
  • Storage health - RAID status, logrotate configuration, time synchronization, SMART disk health, per-device I/O metrics
  • System health - comprehensive health assessment with memory, disk, load, and systemd checks
  • /proc diagnostics - deep /proc inspection: interrupts, softirqs, vmstat, diskstats, filesystems, kernel version, slabinfo
  • Man pages - system manual pages for any installed command
  • Snapshot - comprehensive system overview in a single call
  • MCP Resources - system data also accessible as readable resources

Prerequisites

  • Go 1.27+ (to build from source)
  • Linux (the server targets Linux; some tools use Linux-specific paths)
  • Docker (optional - only needed for Docker tools)

Installation

Via MCP Registry

Discover the server on the MCP Registry and install via your MCP client (VS Code one-click install, or manual config).

Download pre-built binary

Download the latest binary from the GitHub Releases page:

bash
curl -LO https://github.com/Mohabdo21/linux-mcp/releases/latest/download/linux-mcpchmod +x linux-mcp

A fully static build (no libc dependency) is also available as linux-mcp_static.

Via go install

bash
go install github.com/Mohabdo21/linux-mcp@latest

The binary is placed in $GOPATH/bin/ (typically ~/go/bin/).

Build from source

bash
git clone https://github.com/Mohabdo21/linux-mcp.gitcd linux-mcpmake build

The binary is placed at bin/linux-mcp.

For a fully static binary (no libc dependency):

bash
make build-static

Usage

The server communicates over STDIO transport, following the MCP standard. It is designed to be launched by an MCP client (e.g., Claude Desktop, Claude Code, Codex, OpenCode, or any MCP host).

Running directly

bash
./bin/linux-mcp

This starts the server and listens for MCP requests on STDIN/STDOUT.

Integration

OpenCode

Add the following to your OpenCode configuration:

json
{  "mcp": {    "linux-mcp": {      "type": "local",      "command": ["/path/to/linux-mcp"],      "enabled": true    }  }}
Claude Code

Add the server via the CLI:

bash
claude mcp add linux-mcp -- /path/to/linux-mcp

To scope it to all your projects instead of just the current one:

bash
claude mcp add linux-mcp --scope user -- /path/to/linux-mcp

Or create a .mcp.json file in your project root for team-shared configuration:

json
{  "mcpServers": {    "linux-mcp": {      "type": "stdio",      "command": "/path/to/linux-mcp"    }  }}

Verify the connection inside a Claude Code session with /mcp.

Codex

Add the server via the CLI:

bash
codex mcp add linux-mcp -- /path/to/linux-mcp

Or add it manually to ~/.codex/config.toml (or .codex/config.toml for project-scoped config):

toml
[mcp_servers.linux-mcp]command = "/path/to/linux-mcp"

Verify the connection with codex mcp list.

Tools and resources

65 tools and 19 resources covering system, CPU, memory, disk, network, processes, Docker, security, packages, hardware, and more.

Full tool and resource reference

Configuration

The server can be configured via a JSON file loaded from ~/.config/linux-mcp/config.json or the LINUX_MCP_CONFIG environment variable.

json
{  "log_level": "info",  "timeouts": {    "get_system_snapshot": "60s",    "ping_host": "5s"  },  "disabled": []}
FieldDescription
log_levelOne of debug, info, warn, error (default: info)
timeoutsPer-tool timeout overrides as Go duration strings
disabledTool names to disable, including their resource and aggregate collector paths

Invalid configuration prevents startup. The server also handles SIGHUP to reload the configuration file at runtime without restarting; a failed reload retains the last valid configuration. Disabled collectors are skipped by aggregate tools and reported in their errors.

Docker diagnostic responses omit environment values and raw command arguments, including image-history commands. Other diagnostic content, such as logs and labels, can still contain sensitive data; grant access only to trusted clients.

MCP Registry

Published on the MCP Registry as io.github.Mohabdo21/linux-mcp.

License

Dependencies

来源:README.md,提交 c802a4d

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

4
  1. v0.3.0最新Nov 6, 2026
  2. v0.2.18Oct 11, 2026
  3. v0.2.17Sep 29, 2026
  4. v0.2.15Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分