Sign inSign up

lordraw/watchyourlan-mcp

By lordraw

Updated 3 months ago

a mcp server for watch your lan

Image
Machine learning & AI
0

449

lordraw/watchyourlan-mcp repository overview

watchyourlan-mcp

MCP server for WatchYourLAN — exposes your network monitoring instance as tools that any MCP-compatible client (Claude Desktop, Claude Code, custom agents) can call.

Source: github.com/lordraw77/watchyourlan-mcp


What's inside

The image ships two Python scripts:

FileRole
server.pyMCP server — 10 tools, stdio and SSE transports
agent.pyInteractive CLI agent powered by OpenRouter

The active mode is selected by environment variables passed to docker run.


Architecture

MODE 1 — MCP server, stdio  (default CMD)
──────────────────────────────────────────────────────────
MCP client (Claude Desktop / SDK)
      │  stdin / stdout  (JSON-RPC 2.0)
      ▼
[ lordraw/watchyourlan-mcp ]
      │  HTTP
      ▼
WatchYourLAN  :8840


MODE 2 — MCP server, SSE  (MCP_TRANSPORT=sse)
──────────────────────────────────────────────────────────
MCP client (Claude Desktop / Code / SDK)
      │  HTTP  GET /sse
      ▼
[ lordraw/watchyourlan-mcp  :8080 ]
      │  HTTP
      ▼
WatchYourLAN  :8840


MODE 3 — interactive agent  (override CMD to agent.py)
──────────────────────────────────────────────────────────
terminal
      │  stdin / stdout
      ▼
[ lordraw/watchyourlan-mcp  →  agent.py ]
      │  stdio subprocess          │  HTTPS
      ▼                            ▼
[ server.py ]               OpenRouter LLM
      │  HTTP
      ▼
WatchYourLAN  :8840

Image details

PropertyValue
Base imagepython:3.12-slim
BuildMulti-stage — deps compiled in builder layer, only runtime ships
Default transportstdio
SSE port8080
Default commandpython3.12 server.py
ConfigEnvironment variables (--env-file .env)

Quick start

Mode 1 — stdio MCP server
docker run --rm -i \
  --env-file .env \
  lordraw/watchyourlan-mcp

The -i flag is required — the stdio transport keeps stdin open.

Mode 2 — SSE MCP server
docker run --rm \
  --env-file .env \
  -e MCP_TRANSPORT=sse \
  -p 8080:8080 \
  lordraw/watchyourlan-mcp

MCP clients connect to http://localhost:8080/sse.

Mode 3 — interactive agent
docker run --rm -it \
  --env-file .env \
  lordraw/watchyourlan-mcp \
  python3.12 agent.py

Environment variables

Create a .env file (never pass secrets as image layers):

# WatchYourLAN instance  (required)
WYL_BASE_URL=http://192.168.1.10:8840
WYL_TIMEOUT=10

# Transport (optional, default: stdio)
MCP_TRANSPORT=stdio   # or: sse
MCP_HOST=0.0.0.0      # SSE bind host
MCP_PORT=8080         # SSE bind port

# OpenRouter — only needed when running agent.py
OPENROUTER_API_KEY=sk-or-...
OPENROUTER_MODEL=google/gemini-2.0-flash-001
VariableRequiredDefaultDescription
WYL_BASE_URLyeshttp://localhost:8840WatchYourLAN base URL
WYL_TIMEOUTno10HTTP timeout (seconds)
MCP_TRANSPORTnostdioTransport: stdio or sse
MCP_HOSTno0.0.0.0SSE server bind host
MCP_PORTno8080SSE server port
OPENROUTER_API_KEYagent onlyAPI key from openrouter.ai
OPENROUTER_MODELnogoogle/gemini-2.0-flash-001OpenRouter model ID

Connect to Claude Desktop

stdio transport
{
  "mcpServers": {
    "watchyourlan": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "--env-file", "/absolute/path/to/.env",
        "lordraw/watchyourlan-mcp"
      ]
    }
  }
}
SSE transport (server must be running)
{
  "mcpServers": {
    "watchyourlan": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

Network access

If WatchYourLAN runs on the same Docker host:

# Linux — share the host network stack
docker run --rm -i --network host \
  --env-file .env \
  lordraw/watchyourlan-mcp

# macOS / Windows — use the host gateway alias
# set WYL_BASE_URL=http://host.docker.internal:8840 in .env
docker run --rm -i \
  --env-file .env \
  lordraw/watchyourlan-mcp

Available tools

ToolDescription
get_all_hostsList every tracked device
get_hostDetails of one host by ID
get_statusNetwork summary (online / offline / known / unknown)
get_history_allFull event history ⚠ can be large
get_host_history_by_dateHistory for a device filtered by date
get_host_history_last_nLast N history entries for a device
check_portTest if a TCP port is open on a host
edit_hostRename a host or toggle its Known state
delete_hostRemove a host
send_test_notificationFire a test notification

Tag summary

Content type

Image

Digest

sha256:40dc9f707

Size

59.1 MB

Last updated

3 months ago

docker pull lordraw/watchyourlan-mcp