
Vllm Ops Mcp
io.github.jaimenbell由 GitHub 账号 jaimenbell 发布v0.1.0更新于 Oct 24, 2026
Read-only ops/health MCP server for a local vLLM instance: health tiers, GPU/VRAM, service status.
概览
面向本地 vLLM 实例的只读运维与健康检查服务器:存活与真实生成两级探测、GPU/显存状态、systemd 服务状态与启动参数。
- 可以做什么
- 分两级检查 vLLM 健康:/v1/models 存活探测,或触发一次真实对话补全的深度探测
- 列出已加载模型,并用自定义提示词按需执行一次测试补全
- 通过 nvidia-smi 读取各 GPU 的显存占用与利用率
- 查看 systemd 单元的加载/运行状态、重启次数、主进程 PID 与最后活跃时间
- 从运行中进程的命令行读取实际启动参数,服务未运行时回退到 exec 脚本
- 适用场景
- 当你把 vLLM 作为 systemd 单元(通常运行在 WSL2 中)部署,希望助手判断它是否真的能生成、占用多少显存、以哪些参数启动,而无需自己登录机器排查时适用。
- 运行要求
- 本地 Python 环境(PyPI 包 vllm-ops-mcp,stdio)。需要已运行的 vLLM OpenAI 兼容端点、nvidia-smi,以及可通过 wsl -d 或本机访问的 systemctl。可选环境变量用于设置基础 URL、模型名、WSL 发行版、服务单元、exec 脚本路径与限流;默认指向 127.0.0.1:8000 和单元 vllm。
安装
在 SourceWeft 中
- 打开 控制台中的 Vllm Ops Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
vllm-ops-mcp
Read-only ops/health MCP server for a local, WSL2/systemd-managed vLLM server -- liveness vs. real-completion health tiers, GPU/VRAM status, systemd service status, and live serve-flag introspection. Built to the same standard as mcp-factory and desktop-mcp, and other local tooling in this operator's portfolio: own pyproject, own fastmcp server, honest README, real test suite, no product code before a spec was confirmed.
This is not a container-lifecycle manager. It assumes vLLM already runs
as a bare-metal systemd unit inside WSL2 (this operator's actual setup --
see vllm-autostart), not inside Docker/Podman.
Quickstart
Tools (Phase 1 -- all read-only, no gating required beyond a throughput cap)
Future extension: restart_service (Phase 2, not built)
Deliberately not implemented in this release. Per the spec: vLLM is
shared infra other bots/tools depend on (options-bot, qwen_cli.py
callers, DeerFlow fallback), so a restart tool needs its own gating design
(off by default, VLLM_OPS_MCP_ENABLE_RESTART=1, refuse to touch a healthy
instance unless force=True, rate-capped) before it ships -- not
retrofitted onto a read-only MVP. Tracked as a v2 idea, not a current
capability. If built, it should wrap run-vllm.cmd's exact recipe (systemctl start vllm only, never blind stop/restart) rather than reinvent it.
The differentiator: probe HTTP, not the listener
Every health signal in this server comes from an actual HTTP request to the
OpenAI-compatible API (urllib.request, not a socket/connect check). This
is deliberate, not incidental: Get-NetTCPConnection and other
listener-based checks miss WSL2-mirrored-networking-relayed ports
entirely -- a genuinely healthy 127.0.0.1:8000 can be invisible to a
listener probe run from the Windows host. check-vllm.cmd already embodies
this lesson; this server generalizes it into two tiers (liveness vs. real
generation) that nothing else in this operator's fleet exposes as MCP tools.
Security
Read this before you register vllm-ops-mcp. Honesty about blast radius is the point.
- This server shells out to
nvidia-smi,systemctl(viawsl -d), and reads/proc/<pid>/cmdline. All six tools are read-only -- nothing here starts, stops, restarts, or kills a process, and no tool accepts an argument that gets passed to a shell unescaped (unit/distro names come from server-side config, not caller input;shlex.quotewraps the one caller-adjacent path that does reach a shell string, the unit name insystemctl show). check_health(deep=True)andtest_completionfire a real inference call against a shared GPU server. Rate-limited (default 20 calls/min,VLLM_OPS_MCP_DEEP_RATE_LIMIT_PER_MIN) specifically because this vLLM instance is shared infra other bots/tools depend on -- a caller hammering this MCP could starve or slow other consumers even though every call individually looks "read-only."get_serve_config's live-process path reads/proc/<pid>/cmdline, which can include secrets if any were ever passed as CLI flags (none are, in this operator's actual setup -- the model path and flags are all non-secret; auth, if any, is environment-injected inside the exec script, not passed as an argv flag). Defense-in-depth: any argv entry whose preceding flag name matches a known-sensitive pattern (token,key,secret,password,passwd,credential--config. SENSITIVE_ARGV_FLAG_PATTERNS) has its value redacted to[REDACTED]before being returned, in both the structuredargv/flagsfields andraw_text; the flag name itself is left visible so the shape is still diagnosable. This applies across all three sources (live_process,exec_script,local_config_mirror).- No tool has any write/mutate capability in this release. There is no
env var that turns one on --
restart_servicedoesn't exist in this codebase yet (see Future extension above), so there's nothing to accidentally enable.
Honest-capabilities table
Limitations (read before relying on this)
- Per-process VRAM attribution is unreliable under this operator's actual
WSL2 GPU-passthrough config.
get_gpu_status's live smoke test (realnvidia-smi.exeagainst the real running vLLM process) returned an emptyprocesseslist even though the same call'sgpus[0]. memory_used_mibcorrectly showed 13.7GB in use by that process. This is a documentednvidia-smi --query-compute-appslimitation under some WSL2/passthrough configurations, not a bug in this server's parsing -- the tool reports the empty result honestly (ok: true, processes: []) rather than fabricating attribution. Don't rely onprocessesfor VRAM-overshoot root-causing on this setup;gpus[].memory_used_mibis the reliable signal. - No computed service uptime.
get_service_statusreturns the rawActiveEnterTimestampstring fromsystemctl(already timezone-labeled, e.g.MDT) rather than computing an elapsed duration server-side -- deliberately, per this operator's own clock-discipline rule (never state an elapsed/ETA time from estimation; artifact timestamps are often UTC while local is UTC-6/-7). Compute the delta at the call site if you need it, with an explicit timezone conversion. get_serve_config's exec-script fallback is best-effort shell-text parsing, not an exact argv array -- it handles\line continuations and basic quoting viashlex.split, but a sufficiently unusual exec script could parse incorrectly. The live-process path (/proc/<pid>/ cmdline) does not have this limitation (it's the kernel's exact argv, null-separated) and is always preferred when the unit is up.- WSL2-specific by default, but the seam is explicit.
get_service_statusandget_serve_config's live-process path assume this server runs on the Windows host and shells into WSL2 viawsl -d <distro>. SetVLLM_OPS_MCP_RUNS_IN_WSL=1if this server process itself runs inside WSL2/Linux natively (nativesystemctl/cat, nowsl -dhop) -- both paths are unit-tested (TestGetServiceStatus::test_uses_wsl_prefix_on_windows/test_no_wsl_prefix_when_native), but only the Windows-host path has been live-verified against this operator's actual setup. - Single vLLM instance, single GPU, this operator's setup. No
multi-instance/multi-GPU aggregation;
get_gpu_statusreturns whatevernvidia-smi --query-gpuenumerates, which is every GPU visible to the process, not scoped to "the GPU vLLM is using" if more than one exists. - No lifecycle control whatsoever in this release. See "Future extension" above -- this is intentional, not an oversight.
Env vars
Usage examples
Testing
CI (.github/workflows/ci.yml) runs this suite on every push/PR (ubuntu-latest --
the unit suite mocks HTTP/subprocess, no live server/GPU/WSL required) and
fails the build if the Tests badge above drifts from what the suite
actually reports -- see scripts/check_readme_counts.py.
Install
Registered in ~/.claude.json as vllm-ops-mcp (stdio, own .venv, no env
overrides needed for this operator's default setup).
Commercial support
Maintained by Jaimen Bell. For production MCP integrations, custom servers, or agent-reliability work, see jaimenbell.dev.
Building your own MCP server? The MCP Starter Kit has templates, a build playbook, and packaging war-stories from shipping this one.
mcp-name: io.github.jaimenbell/vllm-ops-mcp
来源:README.md,提交 28be4a0
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分