Skip to main content

Homelab MCP Server

CI Python 3.12+ License: MIT

AI-Powered Homelab Infrastructure Management via the Model Context Protocol

A Python MCP server that enables AI assistants to manage, deploy, and monitor homelab infrastructure. Tools span SSH discovery, VM management, service installation, network topology mapping, Proxmox operations, and credential management.

Key Features

  • SSH Discovery -- Gather comprehensive hardware and software information from any system
  • Service Installation -- Deploy Jellyfin, Pi-hole, Ollama, Home Assistant, and more from templates
  • Proxmox Integration -- Full API access plus community script discovery
  • VM/Container Lifecycle -- Deploy, control, and remove Docker and LXD workloads
  • Network Mapping -- Discover devices, analyze topology, and track changes
  • Terraform and Ansible -- State-managed deployments with drift detection and playbooks
  • Credential Management -- Register servers once, connect without re-entering credentials

Quick Start

# Install from PyPI (recommended — no clone needed)
uvx homelab-mcp

# Or clone and run from source
git clone https://github.com/washyu/homelab_mcp.git
cd homelab_mcp
uv sync && uv run python run_server.py

For the full walkthrough (environment variables, MCP client configuration, first tool call), see the Setup Guide.

Documentation

Guide Description
Setup Guide From zero to first tool call
Tool Reference All tools with arguments and examples
Configuration Environment variables and CLI options
Claude Desktop Setup Claude Desktop integration guide
HTTP Service REST/OpenAPI mode, endpoints, and error contract

How It Works

  1. Setup -- The server generates an SSH key pair on first run (~/.ssh/mcp_admin_rsa)
  2. Onboard a host -- Use setup_mcp_admin to create a managed user on the target system
  3. Verify -- Use verify_mcp_admin to confirm passwordless SSH access
  4. Manage -- Discover hardware, install services, control VMs, and map your network

The server communicates over stdio using the MCP protocol. Connect it to any MCP-compatible client (Claude Desktop, etc.) and interact through natural language.

Credential Management

Store SSH and Proxmox credentials once so the server auto-injects them on every connection:

# Store an SSH credential
homelab-mcp credentials add 192.168.1.10 admin

# Store an SSH key-based credential (stores the key file path in the keyring, not the key)
homelab-mcp credentials add 192.168.1.10 admin --key-path ~/.ssh/id_ed25519

# Store a Proxmox API credential
homelab-mcp credentials add 192.168.1.200 root@pam --type proxmox

# Update an existing credential — `add` is upsert; re-running replaces the stored entry
homelab-mcp credentials add 192.168.1.10 admin

# List stored credentials
homelab-mcp credentials list
homelab-mcp credentials list --type proxmox

# Remove a credential
homelab-mcp credentials remove 192.168.1.10

The CLI provides full CRUD over credentials: add (create/update — upsert), list (read), remove (delete). There is no separate update subcommand — re-running add replaces both the keyring secret and the registry entry's auth type.

Credentials are stored in the OS keyring (libsecret on Linux, Keychain on macOS). When the OS keyring is unavailable (headless servers), credentials fall back to environment variables.

See Credentials CLI reference for full documentation.

MCP Client Configuration

From PyPI (uvx) — recommended:

{
  "mcpServers": {
    "homelab": {
      "command": "uvx",
      "args": ["homelab-mcp"]
    }
  }
}

From source clone:

{
  "mcpServers": {
    "homelab": {
      "command": "uv",
      "args": ["run", "python", "run_server.py"],
      "cwd": "/path/to/homelab_mcp"
    }
  }
}

Development

# Install with dev dependencies
uv sync --group dev

# Run tests (unit only, no Docker required)
uv run pytest tests/ -m "not integration"

# Code quality
uv run ruff check src/ tests/
uv run mypy src/

See DEPLOYMENT.md for production deployment details.

Project Structure

src/homelab_mcp/
  server.py              # MCP server with JSON-RPC protocol
  tool_schemas/          # Tool definitions (8 schema files)
  tool_annotations.py    # MCP annotation hints per tool
  ssh_tools.py           # SSH discovery and hardware detection
  service_installer.py   # Service installation framework
  infrastructure_crud.py # Infrastructure lifecycle management
  vm_operations.py       # VM/container operations
  sitemap.py             # Network topology mapping
  database.py            # SQLite device tracking
  error_handling.py      # Centralized error handling
  credential_store.py    # OS keyring credential storage
  log_filter.py          # Credential redaction for log output
  prompt_registry.py     # MCP prompts registry
  resource_readers.py    # MCP resource read handlers
  service_templates/     # YAML service definitions
tests/                   # Unit and integration tests
docs/                    # Full documentation

Acknowledgments

Proxmox community script integration powered by community-scripts/ProxmoxVE (MIT License).

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

MIT License -- see LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homelab_mcp-1.7.1.tar.gz (604.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homelab_mcp-1.7.1-py3-none-any.whl (228.1 kB view details)

Uploaded Python 3

File details

Details for the file homelab_mcp-1.7.1.tar.gz.

File metadata

  • Download URL: homelab_mcp-1.7.1.tar.gz
  • Upload date:
  • Size: 604.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for homelab_mcp-1.7.1.tar.gz
Algorithm Hash digest
SHA256 3bca99c786c3ae36dfd0d3a9b63afa75b222ab193b9dfa6064e3499e03b7afb6
MD5 e853a6d90c79c77604ce8577d8d6f39d
BLAKE2b-256 37a5c260ffb5e095bb0898b6ecd460db2ce864e9bfba8412207eeda0bb6015f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for homelab_mcp-1.7.1.tar.gz:

Publisher: main.yml on washyu/homelab_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file homelab_mcp-1.7.1-py3-none-any.whl.

File metadata

  • Download URL: homelab_mcp-1.7.1-py3-none-any.whl
  • Upload date:
  • Size: 228.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for homelab_mcp-1.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c074555f58162c0fdfcac886277fcb3c270c948f9009e04aad829d319331b18
MD5 130f8c65b4c5f150ce0640bff2442b95
BLAKE2b-256 e66b31b485dc31d2d3a444e5a2fff09fb36f03f40c240401b8b09effed812239

See more details on using hashes here.

Provenance

The following attestation bundles were made for homelab_mcp-1.7.1-py3-none-any.whl:

Publisher: main.yml on washyu/homelab_mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.8.0

2 files

This release

1.7.1 This release

2 files

1.7.0

2 files

1.6.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page