
Wakeonlan Mcp Server
io.github.cyanheads由 GitHub 账号 cyanheads 发布v0.2.0更新于 Oct 30, 2026
Wake LAN machines with Wake-on-LAN magic packets from host profiles, then confirm they came up.
概览
本地 MCP 服务器,按预设主机配置发送 Wake-on-LAN 魔术包,并通过 TCP 探测确认机器已启动。
- 可以做什么
- 按别名唤醒已配置的主机,并等待其检查端口响应,等待时长可设置
- 单次探测主机的检查端口,不发送魔术包,用于判断主机是否已在线
- 列出主机配置,包括 MAC、地址、端口、广播地址来源,以及本机是否位于该主机子网
- 读取静态的 Wake-on-LAN 参考主题,如数据包格式、前提条件、睡眠状态、故障排查与配置格式
- 适用场景
- 适合让助手在同一局域网内唤醒休眠的台式机、GPU 机器、NAS 或实验室机器,并确认其可访问;也可在决定是否唤醒前先检查状态。
- 运行要求
- 通过 npx 或 bunx 以 stdio(或 Streamable HTTP)在本地运行;需要 Bun v1.4.0 以上或 Node.js v24 以上。需通过 WOL_HOSTS_FILE(绝对路径)或内联 WOL_HOSTS 提供主机配置,且运行机器须与目标处于同一局域网段。目标机需在固件中启用 Wake-on-LAN 并由操作系统保持待命。
安装
在 SourceWeft 中
- 打开 控制台中的 Wakeonlan Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@cyanheads/wakeonlan-mcp-server
Wake LAN machines with Wake-on-LAN magic packets from host profiles, then confirm they came up via MCP. STDIO or Streamable HTTP.
Overview
Wake-on-LAN by name for the machines on your network. Wake a sleeping desktop, GPU box, NAS, or lab machine, wait until it answers on a port like SSH, check whether a host is up without waking it, and troubleshoot a wake that didn't take. Runs on any machine on the same LAN as its hosts.
Tools
Skills
Served over MCP as skill://wakeonlan-guide/SKILL.md and shipped in the npm package under skills/.
Capability reference
wol_wake_host tool
alias(fromwol_list_hosts, case-insensitive) plus optionalwait_for_s, 0–55 seconds, default 30;0sends and returns without checking. Sends 3 packets 500 ms apart, probing the check port once before sending and every 2 s after the first packetstateisalready_awake,awake(withtime_to_answer_ms, an upper bound at the 2 s poll interval),not_reachable, orunverified(unverified_reason:wait_disabledorno_address); the last two carry aguidancenext step- Fails as
unknown_host,off_segment(nothing sent: this machine has no interface on the host's subnet), retryablewake_in_progress(nothing sent: another call is already waking that host, and one wake per host runs at a time), or retryablesocket_error, whosedatacarries the failedstageandpackets_sent
wol_check_host tool
aliasonly: one TCP connect to the profile'saddressandcheck_port(22 unless the profile sets another), 1.5 s timeout, no magic packet. The port is not an input, so the tool can't scan arbitrary portsoutcomeisopen,refused(the machine answered, nothing listens on that port), orno_answer;reachableis true only foropen, andlatency_msis present foropenandrefused- Fails as
unknown_host, orno_addresswhen the profile has no address to probe
wol_list_hosts tool
- No input. Returns every profile in config order:
alias,description,mac,address,check_port,wol_port,broadcastwithbroadcast_source(configured,derived, orunresolved), andsecureon_set(never the password) on_segment, with the sendinginterfaceandlocal_addresswhen true, is resolved against this machine's interfaces on every call; nothing is sent or probed, so it says nothing about whether a host is upconfig_source(file,inline, ornone) andconfig_pathname where the profiles came from
wol_list_reference tool
topic:packet-format,prerequisites,sleep-states,troubleshooting,host-profiles, orsender-environment- Static markdown with no network access; every response lists all
topicsfor navigation
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Wake-on-LAN-specific:
- Operator-configured targets only: callers pass an alias, never a MAC, IP, broadcast address, or port, so an agent or HTTP caller can wake and probe only the hosts you listed. SecureOn passwords stay in the profile, never returned or logged
- Subnet-directed broadcasts: the broadcast address is derived from a host's IPv4 address and the matching local interface when the profile omits it, and a host on no local subnet is refused before anything is sent instead of being routed away silently
- Wakes are confirmed by a TCP connect to a per-host
check_port(SSH by default; RDP or SMB for Windows), not ICMP - The LAN layer is Node's own
node:dgram,node:net, andnode:os, with no third-party networking dependency
Agent-friendly output:
- Results, not errors, for every wait outcome:
stateplus aguidancenext step naming the tool or reference topic to call - Typed failures with recovery hints:
unknown_hostlists up to 20 configured aliases,off_segmentnames the local subnets it compared, and on macOSsocket_errorpoints at the Local Network permission refusedvsno_answer: a machine that is on but not listening on its check port reads differently from one that never answered. A wake still endsnot_reachableeither way;probe.last_outcomeandguidancesay which, so a wrongcheck_portcan be told apart from a failed wake
Getting started
Add the following to your MCP client configuration file, pointing WOL_HOSTS_FILE at your hosts file.
Or with npx (no Bun required):
The Claude Desktop .mcpb bundle (the install badge above) asks for a hosts file or inline hosts JSON when you install it.
For Streamable HTTP, set the transport and start the server:
Prerequisites
- Bun v1.4.0 or higher (or Node.js v24+).
- A machine attached to the same LAN segment as the hosts it wakes. Run the server on that machine's OS, or in Docker with host networking on Linux: a container on a default bridge network, Docker Desktop on macOS or Windows, or WSL2 in its default NAT mode can't put a broadcast on the LAN.
- Targets with Wake-on-LAN enabled in firmware and armed by the OS.
wol_list_referencewith topicprerequisiteshas the Windows, Linux, and macOS settings.
macOS: Local Network permission
On macOS 15 and later, sending a UDP broadcast or connecting to a LAN address needs Local Network access, and macOS grants it to the app that launched the server rather than to node:
Grant or check it under System Settings > Privacy & Security > Local Network. The first send can fail while the alert is pending, so wol_wake_host may return socket_error; retry after allowing. If that list shows a node entry rather than your client app, enable the node entry. A denied permission also makes wol_check_host read no_answer. Windows and Linux have no per-app gate. wol_list_reference with topic sender-environment covers the rest, including the macOS 15.5+ subnet exemption.
Installation
- Clone the repository:
- Navigate into the directory:
- Install dependencies:
- Configure environment:
Configuration
See .env.example for the full list of optional overrides.
Host profiles
Profiles are a JSON array, read once at startup from WOL_HOSTS_FILE or WOL_HOSTS. Set one of the two: both set is a startup error, and neither set starts the server with no hosts, which wol_list_hosts explains. WOL_HOSTS_FILE must be absolute (after ~/ expansion), because a stdio server runs in the MCP client's working directory, and must name a regular file of at most 1 MiB: a directory, a pipe, or a device such as /dev/stdin is a startup error. Editing the profiles takes a restart.
An empty string leaves an optional text field (address, broadcast, secureon, description) unset. The server refuses to start, naming the entry and field, on an unknown key, an invalid value, a duplicate alias, or a profile with neither broadcast nor an IPv4 address. Whether this machine sits on a host's subnet is checked per call, not at startup, since interfaces change. wol_list_reference with topic host-profiles has an example per OS.
HTTP exposure
A startup guard refuses any HTTP deployment that would let an unauthenticated caller reach the tools from beyond this machine, or from a web page through your browser. Stdio is unaffected.
DEV_MCP_AUTH_BYPASS counts as unauthenticated. With MCP_ALLOWED_ORIGINS unset, requests from non-loopback browser origins are rejected, so a web page can't drive a loopback endpoint through DNS rebinding; * turns that check off, which is why it needs auth. Host profiles are server-wide: every authenticated caller can wake the same hosts.
Running the server
Local development
-
Build and run the production version:
-
Run checks and tests:
Docker
The image is Linux-only. It can wake hosts only when run with --network host (or on a macvlan network) on a Linux machine attached to their LAN, such as a Raspberry Pi, NAS, or home server that already runs Docker. On a default bridge network the container sees only Docker's private subnet, so wol_wake_host fails with off_segment before sending anything. Docker Desktop on macOS and Windows runs containers in a VM, so its broadcasts can't reach the LAN in any network mode.
Pull the published multi-arch image (linux/amd64, linux/arm64):
Or build it from a clone of this repository with docker build -t ghcr.io/cyanheads/wakeonlan-mcp-server:latest .. Then add it to your MCP client configuration on that machine. The hosts file is mounted read-only from an absolute host path, and WOL_HOSTS_FILE names where it sits inside the container:
The container runs as the image's bun user (uid 1000), which must be able to read the hosts file. Without MCP_TRANSPORT_TYPE=stdio the image serves Streamable HTTP on port 3010, bound to loopback, which under host networking is the host's own; any other bind needs MCP_AUTH_MODE jwt or oauth (see HTTP exposure). Logs go to /var/log/wakeonlan-mcp-server. OpenTelemetry peer dependencies are installed by default; build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging; nothing persists, soctx.stategoes unused - Register new tools in the
createApp()arrays insrc/index.ts - Every OS boundary (sockets, interfaces, clock, platform, filesystem) is an injected seam: tests never open a real socket, and live checks run on loopback only
Contributing
Issues are welcome. Run checks and tests before submitting:
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
来源:README.md,提交 cf1f48c
工具
0版本历史
3- v0.2.0最新Oct 29, 2026
- v0.1.2Oct 9, 2026
- v0.1.1Sep 26, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分