Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
COPY pyproject.toml .
COPY uv.lock .
COPY README.md .
COPY LICENSE .

# Copy the source code
COPY unraid_mcp/ ./unraid_mcp/
Expand Down
13 changes: 4 additions & 9 deletions unraid_mcp/tools/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
} }
}
""",
"logs": """
query GetContainerLogs($id: PrefixedID!, $tail: Int) {
docker { logs(id: $id, tail: $tail) }
}
""",
"networks": """
query GetDockerNetworks {
dockerNetworks { id name driver scope }
Expand Down Expand Up @@ -286,11 +281,11 @@ async def unraid_docker(
raise ToolError(msg)

if action == "logs":
actual_id = await _resolve_container_id(container_id or "")
data = await make_graphql_request(
QUERIES["logs"], {"id": actual_id, "tail": tail_lines}
raise ToolError(
Comment thread
jmagar marked this conversation as resolved.
"Container logs are not available via the Unraid GraphQL API. "
"Use the Unraid web UI (Docker tab → container → Logs) or SSH: "
f"`docker logs {container_id} --tail {tail_lines}`"
)
return {"logs": _safe_get(data, "docker", "logs")}

if action == "networks":
data = await make_graphql_request(QUERIES["networks"])
Expand Down
4 changes: 2 additions & 2 deletions unraid_mcp/tools/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _escalate(level: str) -> None:
query ComprehensiveHealthCheck {
info {
machineId time
versions { unraid }
versions { core { unraid } }
os { uptime }
}
array { state }
Expand Down Expand Up @@ -137,7 +137,7 @@ def _escalate(level: str) -> None:
"status": "connected",
"url": UNRAID_API_URL,
"machine_id": info.get("machineId"),
"version": info.get("versions", {}).get("unraid"),
"version": info.get("versions", {}).get("core", {}).get("unraid"),
"uptime": info.get("os", {}).get("uptime"),
}
else:
Expand Down
26 changes: 12 additions & 14 deletions unraid_mcp/tools/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
"overview": """
query GetSystemInfo {
info {
os { platform distro release codename kernel arch hostname codepage logofile serial build uptime }
os { platform distro release codename kernel arch hostname logofile serial build uptime }
cpu { manufacturer brand vendor family model stepping revision voltage speed speedmin speedmax threads cores processors socket cache flags }
memory {
layout { bank type clockSpeed formFactor manufacturer partNum serialNum }
}
baseboard { manufacturer model version serial assetTag }
system { manufacturer model version serial uuid sku }
versions { kernel openssl systemOpenssl systemOpensslLib node v8 npm yarn pm2 gulp grunt git tsc mysql redis mongodb apache nginx php docker postfix postgresql perl python gcc unraid }
apps { installed started }
versions { id core { unraid api kernel } packages { openssl node npm pm2 git nginx php docker } }
machineId
time
}
Expand All @@ -50,9 +49,8 @@
""",
"network": """
query GetNetworkConfig {
network {
id
accessUrls { type name ipv4 ipv6 }
vars {
id useSsl port portssl localTld
}
}
Comment thread
jmagar marked this conversation as resolved.
""",
Expand All @@ -67,7 +65,7 @@
""",
"connect": """
query GetConnectSettings {
connect { status sandbox flashGuid }
vars { id flashGuid flashProduct flashVendor }
}
""",
"variables": """
Expand All @@ -87,12 +85,12 @@
""",
"metrics": """
query GetMetrics {
metrics { cpu { used } memory { used total } }
metrics { cpu { percentTotal } memory { used total } }
}
""",
"services": """
query GetServices {
services { name state }
services { name }
}
""",
"display": """
Expand Down Expand Up @@ -122,7 +120,7 @@
query GetServer {
info {
os { hostname uptime }
versions { unraid }
versions { core { unraid } }
machineId time
}
array { state }
Expand All @@ -131,12 +129,12 @@
""",
"servers": """
query GetServers {
servers { id name status description ip port }
servers { id name status }
}
""",
"flash": """
query GetFlash {
flash { id guid product vendor size }
flash { id product vendor }
}
""",
"ups_devices": """
Expand Down Expand Up @@ -359,9 +357,9 @@ async def unraid_info(
# Lookup tables for common response patterns
# Simple dict actions: action -> GraphQL response key
dict_actions: dict[str, str] = {
"network": "network",
"network": "vars",
"registration": "registration",
"connect": "connect",
"connect": "vars",
"variables": "vars",
"metrics": "metrics",
"config": "config",
Expand Down