sysops-mcp

sysops-mcp

An MCP server that gives AI assistants safe, read-only visibility into a host: CPU, memory, disk, processes, network, ports, and logs.

Category
访问服务器

README

sysops-mcp

CI

An MCP server that gives AI assistants safe, read-only visibility into a host: CPU, memory, disk, processes, network, ports, and logs.

Built for the kind of first-pass triage an on-call engineer does before deciding whether a box needs attention. Ask your assistant "how is this server doing?" and it can actually go look.

You: hey, the app feels slow, can you check the box?

Assistant: [get_host_summary] -> CPU 4%, RAM 91%, swap 88%, fullest disk 62%
                                 "memory is nearly exhausted"
           [list_top_processes sort_by=memory] -> postgres using 71% RAM
           [tail_log /var/log/postgresql/postgresql.log grep="checkpoint"]

           Memory is the pressure point, not CPU. Postgres is holding 71% of
           RAM and the logs show frequent checkpoints...

Tools

Tool What it does
get_host_summary One-call health snapshot: uptime, CPU, RAM, swap, fullest disk, plain-language assessment. The right first call.
get_cpu_status Utilization (configurable sample window), core counts, load averages, load-per-core saturation check.
get_memory_status RAM and swap usage.
get_disk_usage Per-partition usage with a configurable warning threshold. Read-only mounts are listed but never flagged.
list_top_processes Top N processes by CPU or memory, with name filtering.
get_network_status Interfaces, addresses, I/O totals, optional TCP connection states.
check_port TCP connect test with latency, distinguishing refused vs. timed out vs. DNS failure.
tail_log Last N lines of a system log, with substring filtering. Path-restricted (see below).

Every tool supports markdown (human-readable) and json (machine-readable) output.

Quickstart

Requires Python 3.10+.

git clone https://github.com/Enrique-S-J/sysops-mcp.git
cd sysops-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

The server speaks stdio and is launched by its client, so running python server.py yourself just blocks waiting for JSON-RPC on stdin. Point a client at it instead.

Claude Code

claude mcp add sysops -- /absolute/path/to/sysops-mcp/.venv/bin/python \
                         /absolute/path/to/sysops-mcp/server.py

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "sysops": {
      "command": "/absolute/path/to/sysops-mcp/.venv/bin/python",
      "args": ["/absolute/path/to/sysops-mcp/server.py"]
    }
  }
}

Both paths must be absolute, and command must be the interpreter inside the virtualenv. A bare python3 will start but fail on import, because the system interpreter has no mcp or psutil.

Works with any MCP client that supports stdio transport.

Design notes

A few deliberate decisions, since diagnostics tooling handed to an LLM deserves some care:

  • Read-only by design. No kill, no restart, no writes. An assistant can diagnose, a human decides what to do about it. Every tool is annotated readOnlyHint: true so clients can reason about safety.
  • tail_log is sandboxed. Reads are restricted to allowed roots (/var/log by default) with symlinks resolved before the check, so a confused or prompt-injected client can't use it as an arbitrary file reader (/var/log/../../etc/passwd is rejected). Both sides of the containment check are resolved, because on macOS the root itself is a symlink.
  • Named arguments, not a wrapper object. Each tool's parameters are individual schema properties carrying their own descriptions, rather than one nested object the model has to unpack. The descriptions are what the model reads to decide how to call a tool, so they belong on the arguments.
  • Only actionable signals raise alarms. Read-only mounts can't have space reclaimed, and some are full by construction — every Ubuntu host with snaps carries squashfs mounts pinned at 100%. Counting those would report "a disk is nearly full" forever and train the reader to ignore it.
  • Errors teach the next step. A failed port check tells you whether the connection was refused (host up, nothing listening) or timed out (host down or firewalled), because those imply different follow-ups. A bad disk path suggests calling the tool without arguments to list valid mounts.
  • Context-efficient responses. Markdown output is trimmed for an LLM's context window: rounded numbers, human-readable timestamps, no metadata dumps. Full fidelity is available via response_format: "json".
  • Interpretation included. get_host_summary doesn't just return numbers; it computes load-per-core and returns an assessment ("memory is nearly exhausted"), so the model spends its reasoning on the problem rather than the arithmetic.

Testing

pip install -e ".[dev]"
pytest

37 tests across two suites:

  • test_server.py — tool output shape, sorting/filtering, port-check outcomes (open, closed, DNS failure, via a real ephemeral listener), the log path sandbox including traversal attempts, and the summary's assessment thresholds against synthetic hosts (swapping, exhausted RAM, full read-only mounts).
  • test_protocol.py — the MCP layer itself: that every parameter is advertised as a named property with its own description, that required arguments and read-only annotations survive serialization, and that the log sandbox and argument bounds hold on the real call path. Direct function calls can't catch a schema that no client can call correctly.

CI runs the suite on Linux and macOS across Python 3.10–3.13. Both operating systems are deliberate: this server has shipped two bugs that were invisible on one platform and broken on the other.

Roadmap

  • get_service_status (systemd unit states)
  • Docker container visibility (when a socket is present)
  • Streamable HTTP transport for remote hosts

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选