Mcp Server Health Monitor

io.github.dbsectrainer由 GitHub 账号 dbsectrainer 发布v1.0.1更新于 Nov 4, 2026

Health monitoring for all your MCP servers

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

通过 MCP 协议探测其他 MCP 服务器,记录延迟与工具架构变化,并导出本地 HTML 健康看板。

可以做什么
  • 并行探测所有已配置的 MCP 服务器(调用 list_tools),测量延迟并保存结果
  • 查看单个服务器状态、离线或延迟超阈值的服务器,以及带 p50/p95 的原始检查历史
  • 对比工具架构哈希,检测服务器版本漂移
  • 注册或移除客户端配置中未包含的手动添加服务器
  • 导出包含状态、延迟趋势与在线率迷你图的单文件 HTML 看板
适用场景
适合同时运行多个 MCP 服务器、想确认它们是否真的能响应 MCP 请求而不只是进程存活的情况。可用于排查不稳定或响应慢的服务器、发现更新后工具架构的变化,并保留本地在线率历史。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js v20.19 或更高版本以及 npm。它会读取已有的 MCP 客户端配置文件(Claude Desktop、Cursor、VS Code)进行自动发现,并把历史存入本地 SQLite 文件,默认位于用户主目录下。可选参数可设置轮询间隔、延迟阈值、数据库路径、守护进程模式和启动宽限期。
安装前请注意
清单声明需要一个名为 YOUR_API_KEY 的必填密钥环境变量,但 README 并未描述任何外部服务或认证;对此应保持警惕,未确认用途前不要提供真实密钥。该服务器会写入文件:SQLite 数据库、补充服务器注册文件,以及在指定输出路径时生成的 HTML 看板。它还会启动并探测所监控的其他 MCP 服务器,守护进程模式会在后台持续轮询。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Server Health Monitor

npm mcp-server-health-monitor package

MCP-native health monitoring that speaks the protocol, not just HTTP. Instead of pinging a port, it calls list_tools on each server — the same handshake your agent uses — so a green status means the server is actually ready to serve MCP requests. All health history stays local in SQLite; no external monitoring service required.

Tool reference | Configuration | Contributing | Troubleshooting

Key features

  • Auto-discovery: Reads your existing MCP config files (Claude Desktop, Cursor, VS Code) with no extra setup.
  • Non-intrusive probing: Only calls list_tools on target servers — read-only, no side effects.
  • Version drift detection: Compares tool schemas across checks to detect when a server has been updated.
  • Historical trends: Stores latency history in SQLite; p50/p95 are computed on-demand from stored history to surface regressions before they become outages.
  • HTML dashboard: Generates a self-contained health dashboard with uptime sparklines per server.
  • Background polling: Runs as a daemon so health data is always fresh when you ask for it.

Why this over generic uptime monitors?

Generic uptime monitors (UptimeRobot, Pingdom, BetterStack) check whether a port is open or an HTTP endpoint returns 200. That's not enough for MCP servers — a server can be running but failing to negotiate the MCP protocol or returning a broken tool schema.

mcp-server-health-monitorGeneric uptime monitors
Probe methodMCP list_tools call — tests actual protocolHTTP ping or TCP port check
Schema drift detectionDetects when tool signatures change between versionsNot possible without protocol awareness
Config auto-discoveryReads Claude Desktop, Cursor, VS Code configs automaticallyManual URL entry per server
Data residencyLocal SQLite; no external serviceHealth data stored in vendor cloud
CostFree, self-hostedFree tier limited; paid for history/alerts

If you want to know that your MCP servers are genuinely healthy — not just "the process is running" — this is the right tool.

Requirements

  • Node.js v20.19 or newer.
  • npm.

Getting started

Add the following config to your MCP client:

json
{  "mcpServers": {    "health-monitor": {      "command": "npx",      "args": ["-y", "mcp-server-health-monitor@latest"]    }  }}

The monitor auto-discovers other MCP servers from the same config file it is registered in. No additional setup required.

MCP Client configuration

Amp · Claude Code · Cline · Cursor · VS Code · Windsurf · Zed

Your first prompt

Enter the following in your MCP client to verify everything is working:

Check the health of all my MCP servers.

Your client should return a status table showing each server with its current latency and health state.

Tools

Health checks (3 tools)

  • health_check_all — probes all configured servers in parallel via list_tools, measures latency, and stores results. Accepts an optional timeout_ms parameter (default: 5000).
  • get_server_status — returns per-server detail including latency, last seen time, 24-hour error count, last error message, and p50/p95 latency percentiles. Requires server_name.
  • list_degraded — filters to servers that are offline or have latency above the threshold. Accepts an optional latency_threshold override.

History (1 tool)

  • get_history — returns raw health check history for a specific server, ordered most-recent first. Requires server_name; accepts optional limit (default: 50, max: 500).

Server registry (2 tools)

  • configure_server — registers a new MCP server to monitor. Servers added this way are stored in ~/.mcp/extra-servers.json and merged with auto-discovered servers. Required: name, command. Optional: args, env.
  • remove_server — removes a manually registered server from monitoring. Only affects servers added via configure_server; auto-discovered servers are not affected. Requires name.

Updates (1 tool)

  • check_updates — detects version drift by hashing tool schemas on each probe and comparing against the last stored hash. Returns has_changed, previous_hash, current_hash, and changed_at per server.

Export (1 tool)

  • export_dashboard — generates a self-contained single-file HTML dashboard with summary cards, per-server status table with p50/p95 latency, and inline SVG uptime sparklines. Accepts an optional output_path to write to disk.

Manual server registry

In addition to auto-discovery from MCP config files, you can register servers that are not in your Claude Desktop config using the configure_server tool. Manually registered servers are written to ~/.mcp/extra-servers.json (stored alongside the health database) and merged with auto-discovered servers on every probe.

Add a server named "my-internal-tool" running with command "node" and args ["/opt/tools/server.js"]

To stop monitoring a manually registered server:

Remove the server named "my-internal-tool" from monitoring

Servers discovered from Claude Desktop's config cannot be removed via remove_server — edit your MCP config file directly to remove those.

Configuration

--interval / --interval-seconds

How often to poll each MCP server, in seconds.

Type: number Default: 60

--latency-threshold

Latency in milliseconds above which a server is marked as degraded.

Type: number Default: 1000

--db / --db-path

Path to the SQLite database file used to store health history.

Type: string Default: ~/.mcp/health.db

--daemon

Run as a background polling daemon. Health data is collected continuously rather than on-demand.

Type: boolean Default: false

--startup-grace-seconds

Grace period in seconds before a newly started server is considered unhealthy.

Type: number Default: 10

Pass flags via the args property in your JSON config:

json
{  "mcpServers": {    "health-monitor": {      "command": "npx",      "args": ["-y", "mcp-server-health-monitor@latest", "--interval=30", "--latency-threshold=500"]    }  }}

Listings

  • Listed on the MCP Registry — search for mcp-server-health-monitor.
  • Listed on MCP Market — search for mcp-server-health-monitor.

Verification

Before publishing a new version, verify the server with MCP Inspector to confirm all tools are exposed correctly and the protocol handshake succeeds.

Interactive UI (opens browser):

bash
npm run build && npm run inspect

CLI mode (scripted / CI-friendly):

bash
# List all toolsnpx @modelcontextprotocol/inspector --cli node dist/index.js --method tools/list
# List resources and promptsnpx @modelcontextprotocol/inspector --cli node dist/index.js --method resources/listnpx @modelcontextprotocol/inspector --cli node dist/index.js --method prompts/list
# Call a tool (example — replace with a relevant read-only tool for this plugin)npx @modelcontextprotocol/inspector --cli node dist/index.js \  --method tools/call --tool-name health_check_all
# Call a tool with argumentsnpx @modelcontextprotocol/inspector --cli node dist/index.js \  --method tools/call --tool-name health_check_all --tool-arg key=value

Run before publishing to catch regressions in tool registration and runtime startup.

Contributing

Probe modules live in src/probes/. Each probe must return a ProbeResult with status, latencyMs, and an optional message. Keep all probes read-only — never trigger side effects on monitored servers.

bash
npm install && npm test

来源:README.md,提交 e9184e3

工具

8

health_check_all

Ping every configured MCP server via list_tools, measure latency, and store results. Returns a summary of all servers.

输入参数timeout_ms

get_server_status

Get detailed health status for a specific MCP server by name.

输入参数server_name必填

list_degraded

List all MCP servers that are offline or have latency above the threshold.

输入参数latency_threshold

check_updates

Compare current tool schemas against last stored schemas to detect version drift across MCP servers.

输入参数timeout_ms

export_dashboard

Generate a self-contained HTML health dashboard with server status, latency trends, and uptime sparklines.

输入参数output_path

get_history

Return the raw health check history for a specific MCP server, ordered most-recent first.

输入参数limitserver_name必填

configure_server

Register a new MCP server to monitor. Servers added this way are stored in a supplementary config file alongside the database and are merged with servers discovered from Claude's config. Use this to monitor servers not present in Claude Desktop's config.

输入参数envargsname必填command必填

remove_server

Remove a manually configured MCP server from monitoring. Only affects servers added via configure_server — servers discovered from Claude's config are not affected.

输入参数name必填

版本历史

2
  1. v1.0.1最新Nov 4, 2026
  2. v1.0.0Sep 16, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分