Skip to main content
Glama
CTRQuko

homelab-mcp

by CTRQuko

CI Python 3.11+ License: MIT

homelab-mcp

Coleccion de servidores MCP (Model Context Protocol) para gestionar un homelab con Proxmox, Linux, Windows, Docker, npm y Python.

Cada dominio corre como proceso independiente via stdio, se integra con Claude Code y cualquier cliente MCP compatible.

Estructura

homelab-mcp/
├── homelab_mcp/
│   ├── config.py               # Configuracion centralizada (.env + multi-nodo)
│   ├── base.py                 # Factory del servidor MCP + logging
│   ├── logging_conf.py         # Setup de logging
│   ├── utils/
│   │   ├── paths.py            # safe_path — sandbox de rutas
│   │   ├── subprocess_safe.py  # run_safe — ejecucion con whitelist
│   │   ├── responses.py        # ok() / error() / needs_confirmation()
│   │   └── claude_md_parser.py # Extrae config Proxmox de CLAUDE.md
│   ├── proxmox_mcp/server.py   # Multi-nodo (pve, pve2, pve3...)
│   ├── linux_mcp/server.py
│   ├── windows_mcp/server.py
│   ├── docker_mcp/server.py
│   ├── npm_mcp/server.py
│   └── python_mcp/server.py
├── bin/
│   └── auto-config-from-claude.sh  # Genera .env + proxmox_nodes.json
├── scripts/                    # Lanzadores individuales y paralelo
├── tests/
├── .env.example
└── pyproject.toml

Related MCP server: nandi-proxmox-mcp

Instalacion

git clone https://github.com/CTRQuko/homelab-mcp.git
cd homelab-mcp
cp .env.example .env   # edita los valores reales
pip install -e .
# Con herramientas de desarrollo:
pip install -e ".[dev]"
# Solo tests:
pip install -e ".[test]"

Auto-config desde CLAUDE.md

Si ya tienes configuracion Proxmox en ~/.claude/CLAUDE.md y tokens en un fichero de secrets:

bash bin/auto-config-from-claude.sh

Esto genera automaticamente:

  • .env con el nodo primario y todas las variables

  • proxmox_nodes.json con todos los nodos detectados

Solo necesitas verificar que los valores son correctos.

Variables de entorno (.env)

# Proxmox API token (nodo primario)
PROXMOX_HOST=192.168.1.X
PROXMOX_USER=user@pam
PROXMOX_TOKEN_NAME=my-token
PROXMOX_TOKEN_VALUE=REEMPLAZAR

# Multi-nodo (opcional): fichero JSON con todos los nodos
# Generado por: bash bin/auto-config-from-claude.sh
# PROXMOX_NODES_FILE=proxmox_nodes.json

# Sandbox Linux (read/write dentro de esta ruta)
LINUX_BASE_PATH=/srv/homelab

# Sandbox Windows
WINDOWS_BASE_PATH=C:/homelab

# npm / Python sandboxes
NPM_BASE_PATH=.
PYTHON_BASE_PATH=.

# Docker socket (opcional)
DOCKER_HOST=unix:///var/run/docker.sock

# Nivel de log: DEBUG, INFO, WARNING, ERROR
LOG_LEVEL=INFO

Multi-nodo Proxmox

Con PROXMOX_NODES_FILE=proxmox_nodes.json, los tools de Proxmox aceptan alias de nodo:

  • list_lxc("node1") → conecta al primer nodo

  • list_lxc("node2") → conecta al segundo nodo

  • list_lxc("node3") → conecta al tercer nodo

Sin el fichero JSON, todo usa el nodo unico de PROXMOX_HOST.

Ejecucion manual

homelab-proxmox-mcp
homelab-linux-mcp
homelab-windows-mcp
homelab-docker-mcp
homelab-npm-mcp
homelab-python-mcp

Integracion en mcp.json

{
  "mcpServers": {
    "homelab-proxmox": {
      "command": "homelab-proxmox-mcp",
      "args": []
    },
    "homelab-linux": {
      "command": "homelab-linux-mcp",
      "args": []
    },
    "homelab-windows": {
      "command": "homelab-windows-mcp",
      "args": []
    },
    "homelab-docker": {
      "command": "homelab-docker-mcp",
      "args": []
    },
    "homelab-npm": {
      "command": "homelab-npm-mcp",
      "args": []
    },
    "homelab-python": {
      "command": "homelab-python-mcp",
      "args": []
    }
  }
}

Tools disponibles

Proxmox MCP

Tool

Descripcion

list_nodes()

Lista nodos del cluster

get_node_status(node)

CPU, memoria, uptime del nodo

list_qemu(node)

VMs QEMU/KVM del nodo

list_lxc(node)

Contenedores LXC del nodo

get_vm_status(node, vmid, vm_type)

Estado de VM o LXC

start_vm(node, vmid, vm_type, confirm)

Arrancar VM/LXC (requiere confirm=True)

stop_vm(node, vmid, vm_type, confirm)

Parar VM/LXC (requiere confirm=True)

restart_vm(node, vmid, vm_type, confirm)

Reiniciar VM/LXC (requiere confirm=True)

Linux MCP

Tool

Descripcion

read_file(rel_path)

Leer fichero dentro del sandbox

write_file(rel_path, content)

Escribir fichero dentro del sandbox

list_dir(rel_path)

Listar directorio

file_exists(rel_path)

Comprobar existencia

run_command(cmd)

Comando whitelisted (ls, cat, df, du, grep, find, head, tail...)

Windows MCP

Tool

Descripcion

read_file(rel_path)

Leer fichero dentro del sandbox

write_file(rel_path, content)

Escribir fichero dentro del sandbox

list_dir(rel_path)

Listar directorio

file_exists(rel_path)

Comprobar existencia

run_powershell(cmd)

PS de solo lectura (Get-*, Test-Path...)

Docker MCP

Tool

Descripcion

list_containers(all)

Listar contenedores

inspect_container(name)

Inspeccionar configuracion

get_container_logs(name, tail)

Ultimas N lineas de logs

restart_container(name, confirm)

Reiniciar contenedor (requiere confirm=True)

npm MCP

Tool

Descripcion

npm_outdated(path)

Dependencias desactualizadas

npm_audit(path)

Vulnerabilidades

npm_list(path)

Arbol de dependencias

Python MCP

Tool

Descripcion

python_version()

Version Python del servidor

pytest_run(path)

Ejecutar tests

ruff_check(path)

Linting con ruff

pip_list()

Paquetes instalados

Tests

pytest

83 tests cubriendo todos los MCPs, utilidades y configuracion.

Seguridad

Sandboxes por MCP

MCP

Variable .env

Default

Aplicado en

Linux

LINUX_BASE_PATH

/srv/homelab

read_file, write_file, list_dir, file_exists, run_command

Windows

WINDOWS_BASE_PATH

C:/homelab

read_file, write_file, list_dir, file_exists, run_powershell

npm

NPM_BASE_PATH

.

npm_outdated, npm_audit, npm_list

Python

PYTHON_BASE_PATH

.

pytest_run, ruff_check

Docker

No aplica (trabaja con nombres de contenedores)

Proxmox

No aplica (trabaja con la API autenticada)

Medidas de seguridad

  • Sandbox de rutas: Linux, Windows, npm y Python MCP validan que todas las rutas se resuelvan dentro del directorio base configurado. Path traversal (../..) es rechazado usando Path.relative_to().

  • Whitelist de comandos: run_command (Linux) solo permite binarios explicitamente listados. Los comandos se parsean con shlex y se ejecutan sin shell=True.

  • PowerShell restringido: Solo verbos de lectura (Get-*, Test-Path). Se bloquean pipes (|), punto y coma (;), ampersand (&), backticks, subexpresiones ($()), verbos destructivos (Remove-*, Set-*, Invoke-*, etc.) y binarios peligrosos (rm, del, cmd, etc.). Se ejecuta con -ExecutionPolicy Restricted -NonInteractive.

  • Docker con confirmacion: restart_container requiere confirm=True explicito. Sin el devuelve un aviso de confirmacion.

  • Proxmox con confirmacion: start_vm, stop_vm y restart_vm requieren confirm=True explicito. Se valida configuracion antes de conectar.

  • Sin secretos hardcodeados: Todo por .env, nunca en el codigo.

Limitaciones conocidas

  • run_safe no soporta rutas absolutas con espacios como nombre de binario (e.g. C:\Program Files\...). Esto es intencional: usa nombres simples (python, ls).

  • run_powershell pasa el comando como string a -Command; la validacion cubre la mayoria de vectores pero un escape creativo de PowerShell podria evadirla en teoria.

  • No hay autenticacion entre el cliente MCP y el servidor; la seguridad recae en el control de acceso al proceso.

Ejemplo mcp.json alternativo (con python -m)

Si prefieres invocar los servidores con python -m en lugar del entrypoint:

{
  "mcpServers": {
    "proxmox": {
      "command": "python",
      "args": ["-m", "homelab_mcp.proxmox_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    },
    "linux": {
      "command": "python",
      "args": ["-m", "homelab_mcp.linux_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    },
    "docker": {
      "command": "python",
      "args": ["-m", "homelab_mcp.docker_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    },
    "windows": {
      "command": "python",
      "args": ["-m", "homelab_mcp.windows_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    },
    "npm": {
      "command": "python",
      "args": ["-m", "homelab_mcp.npm_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    },
    "python": {
      "command": "python",
      "args": ["-m", "homelab_mcp.python_mcp.server"],
      "env": { "PYTHONPATH": "/path/to/homelab-mcp" },
      "type": "stdio"
    }
  }
}

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

Available Tools

4 tools
get_container_logsB

Devuelve las últimas líneas de logs de un contenedor.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesNombre o ID del contenedor.
tailNoNúmero de líneas a devolver (máx 1000).

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description has the full burden of behavioral disclosure. It only states it returns logs but fails to indicate whether it is a read-only operation, any rate limits, or what happens if the container does not exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that is front-loaded and contains no unnecessary words, making it highly concise and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers the basic purpose, it lacks details on the output format or specific limitations beyond those implied by the tail parameter. Given the presence of an output schema, the description is minimally adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the description adds no additional meaning beyond the schema. The parameters 'name' and 'tail' are adequately described in the input schema, leading to a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool returns the last lines of logs of a container, effectively distinguishing it from sibling tools like list_containers, inspect_container, and restart_container.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, such as the container needing to exist or be running, nor any conditions under which it should be avoided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

inspect_containerB

Inspecciona un contenedor (configuración completa).

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesNombre o ID del contenedor.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool inspects a container and returns full configuration, but does not mention any side effects, authorization requirements, or response format. The output schema exists but is not referenced in the description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no unnecessary words. It is concise, but could be slightly improved by adding usage context without sacrificing brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description only covers the basic purpose. It lacks context on when to use, behavioral details, and how it relates to siblings, making it incomplete for an agent to effectively decide.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'name'. The description repeats the schema info ('Nombre o ID del contenedor') without adding new meaning, so it meets the baseline but adds no extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Inspects a container (full configuration)' clearly states the action (inspect), the resource (container), and the scope (full configuration). It distinguishes itself from sibling tools like list_containers (lists containers) and get_container_logs (retrieves logs).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, nor does it indicate when not to use it. The agent must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_containersB

Lista contenedores Docker.

ParametersJSON Schema
NameRequiredDescriptionDefault
allNoSi True incluye contenedores parados. Por defecto solo running.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description implies a read-only operation ('list'), but does not explicitly state safety or any potential side effects. Since no annotations are provided, the description carries the full burden, but the behavior is clear enough for a list operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence that is front-loaded and contains no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with one parameter and an existing output schema, the description is adequate. It covers the core purpose, though it could mention the default behavior (only running containers) already present in schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the single parameter 'all' has a clear description in the schema. The tool description does not add additional meaning beyond the schema, so baseline score is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists Docker containers, which is a specific verb+resource. However, it does not differentiate from sibling tools like inspect_container or get_container_logs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description does not provide context about selecting this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

restart_containerA

Reinicia un contenedor por nombre o ID.

REQUIERE confirm=True para ejecutar. Sin confirmación devuelve un aviso.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesNombre o ID del contenedor.
confirmNoDebe ser True para ejecutar el restart. Por defecto False (dry run).

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full burden. It discloses the confirm safety mechanism and dry-run behavior. However, it omits details like container runtime prerequisites or side effects, so transparency is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loading the action and then the key requirement. No wasted words, though the language (Spanish) could affect understandability in a mixed environment.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists but is not detailed in the description. The provided context (confirm requirement) is sufficient for a simple restart tool, but it lacks specifics on return values or error conditions, making it adequate but incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents both parameters. The description adds 'by name or ID' to the name param and reiterates the confirm behavior. This adds marginal value beyond the schema, warranting a baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'restart a container by name or ID,' using a specific verb and resource. It distinguishes itself from sibling tools (list, inspect, logs) which are read-only.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly requires confirm=True to execute, indicating a dry-run behavior without it. This provides clear usage context but does not exclude alternatives or note when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.4.0
    • First observedget_container_logs
    • First observedinspect_container
    • First observedlist_containers
    • First observedrestart_container

TDQS

A3.6/5.0

Scored across 4 tools

Disambiguation5/5

Each tool targets a distinct operation on Docker containers: listing, inspecting, retrieving logs, and restarting. No functional overlap exists.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern (e.g., list_containers, inspect_container), making the set predictable.

Tool Count4/5

With 4 tools, the set is slightly small but well-scoped for basic container management and monitoring. It could benefit from a few more operations, but it remains focused.

Completeness3/5

The tools cover observation (list, inspect, logs) and one action (restart), but lack fundamental operations like start, stop, or remove containers, leaving notable workflow gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP servers for managing homelab infrastructure. Monitor Docker/Podman containers, Ollama AI models, Pi-hole DNS, Unifi networks, and Ansible inventory.
    40
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    An open-source MCP server for managing Proxmox environments, including nodes, virtual machines, and containers. It enables users to perform inventory checks, status monitoring, and control operations directly through MCP-compatible tools.
    123
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Python-based MCP server for interacting with Proxmox hypervisors, enabling management of nodes, VMs, containers, and executing commands via QEMU Guest Agent.
    7
    MIT