MCP Homelab 38a938d4

MCP运维云端

提供方 asvarnon

运维云端 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaudeVS Code
查看接入方式

mcp-homelab是一个为AI助手提供实时访问家庭实验室基础设施的服务器,支持通过自然语言查询节点状态、管理Docker容器、控制Proxmox虚拟机及检查OPNsense防火墙状态。

一句话选型结论

按资料字段整理

MCP Homelab 38a938d4 属于运维云端类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude、VS Code,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 1 仓库热度,无公开仓库时显示未标注
工具数 23 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量23暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

基础设施管理Python本地部署Docker管理Proxmox控制OPNsense检查AI助手集成

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
python -m venv .venv && .venv/Scripts/activate # or source .venv/bin/activate on Linux/macOS

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 23 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 23 个工具,覆盖面较广,能满足多种调用。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Homelab 38a938d4当前 23 stdio · 本地进程 本地部署 有 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方asvarnon上游标注的维护方 asvarnon
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

14.8 KB
来自项目仓库与上游目录的原文,未做删改

mcp-homelab

An MCP server that gives AI assistants real-time access to your homelab infrastructure. Connect it to Claude Desktop, VS Code Copilot, or any MCP-compatible client and your assistant can query node status, manage Docker containers, control Proxmox VMs, and inspect OPNsense firewall state — all through natural conversation.

Why

AI assistants are useful for infrastructure work, but they can't see your environment. You end up copy-pasting docker ps output, describing your network layout, and manually feeding context. mcp-homelab fixes that by giving the assistant direct access to live infrastructure data over SSH and REST APIs.

What it supports:
- Any Linux host accessible via SSH (bare-metal, VMs, LXC containers)
- Docker container listing, logs, and restart
- Proxmox VE VM and LXC container management (optional)
- OPNsense firewall inspection (optional)

Proxmox and OPNsense are optional — the server works with just SSH-accessible hosts.

Requirements

  • Python 3.10+
  • SSH key access to at least one Linux host
  • MCP client: Claude Desktop, VS Code with Copilot, or any MCP-compatible client
  • (Optional) Proxmox VE with an API token
  • (Optional) OPNsense with API key/secret

Quick Start```bash

git clone git@github.com:asvarnon/mcp-homelab.git
cd mcp-homelab
python -m venv .venv && .venv/Scripts/activate # or source .venv/bin/activate on Linux/macOS
pip install -e .
mcp-homelab init # creates config.yaml + .env from templates

Edit config.yaml with your hosts, .env with API credentials

mcp-homelab setup check # validates config and tests connectivity
mcp-homelab setup client # auto-configures Claude Desktop / VS Code


That's it. Your MCP client will now spawn the server automatically when it needs homelab data.

## Tools

| Category  | Tool                   | Description                                                     |
| --------- | ---------------------- | --------------------------------------------------------------- |
| Discovery | `scan_infrastructure`  | Full topology snapshot (all nodes, VMs, containers, interfaces) |
| Discovery | `generate_context`     | Auto-generate Markdown docs from live scan data                 |
| Discovery | `list_context_files`   | Manifest of all files in the context directory                  |
| Nodes     | `list_nodes`           | All configured nodes from config                                |
| Nodes     | `get_node_status`      | Uptime, CPU, RAM, disk via SSH                                  |
| Nodes     | `list_containers`      | Docker containers on a node                                     |
| Nodes     | `get_container_logs`   | Last N lines of container logs                                  |
| Nodes     | `restart_container`    | Restart a container                                             |
| Proxmox   | `list_vms`             | All VMs with status and resources                               |
| Proxmox   | `get_vm_status`        | Detailed status for one VM                                      |
| Proxmox   | `start_vm`             | Start a stopped VM                                              |
| Proxmox   | `stop_vm`              | Gracefully stop a VM                                            |
| Proxmox   | `list_lxc`             | All LXC containers with status and resources                    |
| Proxmox   | `get_lxc_status`       | Detailed status for one LXC container                           |
| Proxmox   | `start_lxc`            | Start a stopped LXC container                                   |
| Proxmox   | `stop_lxc`             | Gracefully stop an LXC container                                |
| Proxmox   | `create_lxc`           | Create a new LXC container from a template                      |
| Proxmox   | `get_next_vmid`        | Next available VM/CT ID from the cluster                        |
| Proxmox   | `list_storage`         | Storage pools with capacity info                                |
| Proxmox   | `list_templates`       | Available OS templates for LXC creation                         |
| OPNsense  | `get_dhcp_leases`      | Active DHCP leases                                              |
| OPNsense  | `get_interface_status` | Interface state                                                 |
| OPNsense  | `get_firewall_aliases` | Alias definitions                                               |

## Detailed Setup

The Quick Start above covers the basics. This section has details for specific integrations.

### Configure```bash
cp config.yaml.example config.yaml
cp .env.example .env
# Edit config.yaml with your hosts, then .env with API credentials

Proxmox API token (optional)

In the Proxmox web UI (https://your-pve-host:8006):

  1. Datacenter → Permissions → API Tokens → Add
  2. User: your PVE user (e.g. admin@pam)
  3. Token ID: mcp-homelab (or any label)
  4. Privilege Separation: Uncheck (token inherits user permissions)
  5. Copy the token secret — it's shown only once

Add to .env:```
PROXMOX_TOKEN_ID=admin@pam!mcp-homelab
PROXMOX_TOKEN_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


The Proxmox host/port/SSL settings are in `config.yaml` under the `proxmox:` section. You can also configure LXC creation defaults:```yaml
proxmox:
  host: "10.10.10.50"
  port: 8006
  verify_ssl: false
  default_node: pve           # preferred node for storage/template queries
  default_storage: local      # rootfs storage for create_lxc ("local" = dir, "local-lvm" = LVM thin)
  default_bridge: vmbr0       # network bridge for create_lxc

Node access

Each node's SSH credentials are defined in config.yaml (per-node ssh_user and ssh_key_path fields). Edit these to match your environment.

Docker sudo (if required)

If the SSH user is not in the docker group, set sudo_docker: true for that node in config.yaml. This requires passwordless sudo for the docker binary on the target host:```bash

On the remote node:

echo '<username> ALL=(ALL) NOPASSWD: /usr/bin/docker' | sudo tee /etc/sudoers.d/docker-nopasswd
sudo chmod 440 /etc/sudoers.d/docker-nopasswd
sudo visudo -cf /etc/sudoers.d/docker-nopasswd # must print "parsed OK"


If the SSH user is already in the `docker` group, set `sudo_docker: false` (the default) and no sudoers changes are needed.

&gt; **Common pitfall:** Do NOT restrict the sudoers rule to specific docker subcommands (e.g. `/usr/bin/docker ps, /usr/bin/docker exec *`). Sudoers treats arguments as an exact match — `docker ps` won&#x27;t match `docker ps --format &#x27;{{json .}}&#x27;`, which is what the MCP tools actually run. Use `/usr/bin/docker` (the binary path alone, no subcommands) to allow all docker operations with any arguments.

#### Hardware memory details (optional)

`generate_context` and `scan_infrastructure` gather hardware specs via SSH. Most data comes from unprivileged commands (`lscpu`, `/proc/meminfo`, `lsblk`), but **per-DIMM memory details** (type, speed, manufacturer) require `dmidecode`, which needs root access.

If you want memory module details in your generated docs, grant passwordless sudo for dmidecode:```bash
# On each remote node:
echo &#x27;&lt;username&gt; ALL=(ALL) NOPASSWD: /usr/sbin/dmidecode&#x27; | sudo tee /etc/sudoers.d/dmidecode-nopasswd
sudo chmod 440 /etc/sudoers.d/dmidecode-nopasswd
sudo visudo -cf /etc/sudoers.d/dmidecode-nopasswd   # must print &quot;parsed OK&quot;

Without this, everything else still works — the memory modules section is simply omitted from generated docs.

Combined sudoers file (recommended)

For nodes that need both sudo_docker: true and hardware memory details, you can combine both rules into a single file:```bash

On the remote node:

cat <<EOF | sudo tee /etc/sudoers.d/mcp-homelab
<username> ALL=(root) NOPASSWD: /usr/bin/docker, /usr/sbin/dmidecode
EOF
sudo chmod 440 /etc/sudoers.d/mcp-homelab
sudo visudo -cf /etc/sudoers.d/mcp-homelab # must print "parsed OK"


### MCP client connection

The `setup client` command auto-configures Claude Desktop and VS Code to use your server. It detects your venv Python, resolves paths, and merges the entry into existing config files without overwriting other servers.```bash
# Interactive — picks Claude Desktop, VS Code, or both
mcp-homelab setup client

# Preview what would be written (no changes)
mcp-homelab setup client --dry-run

This writes the correct stdio transport entry including the MCP_HOMELAB_CONFIG_DIR env var, so the server can find config.yaml and .env regardless of the client's working directory.

Manual configuration (if you prefer editing JSON directly)

Claude Desktop — edit %APPDATA%/Claude/claude_desktop_config.json:```json
{
"mcpServers": {
"homelab": {
"command": "C:/path/to/mcp-homelab/.venv/Scripts/python.exe",
"args": ["C:/path/to/mcp-homelab/server.py"],
"env": {
"MCP_HOMELAB_CONFIG_DIR": "C:/path/to/mcp-homelab"
}
}
}
}


**VS Code (Copilot)** — add `.vscode/mcp.json` in your workspace:```json
{
  &quot;servers&quot;: {
    &quot;homelab&quot;: {
      &quot;command&quot;: &quot;C:/path/to/mcp-homelab/.venv/Scripts/python.exe&quot;,
      &quot;args&quot;: [&quot;C:/path/to/mcp-homelab/server.py&quot;],
      &quot;env&quot;: {
        &quot;MCP_HOMELAB_CONFIG_DIR&quot;: &quot;C:/path/to/mcp-homelab&quot;
      }
    }
  }
}

The MCP_HOMELAB_CONFIG_DIR env var is required — without it, MCP clients that spawn from a different working directory won't find your config files.

OAuth client lockdown (hosted mode)

When running in HTTP mode, mcp-homelab uses OAuth 2.1 for authentication. By default, it accepts Dynamic Client Registration (DCR) from any client. To restrict access to a single pre-registered client, set these env vars in .env:```bash

Generate credentials (both must be ≥32 characters)

python -c "import secrets; print(secrets.token_urlsafe(48))"

Add to .env

MCP_CLIENT_ID=<generated-value>
MCP_CLIENT_SECRET=<generated-value>


When both are set, this static client is pre-registered alongside Dynamic Client Registration (DCR). To restrict which clients can register dynamically, set `MCP_ALLOWED_REDIRECT_ORIGINS` (comma-separated origins). When connecting from Claude Desktop, enter these values in the OAuth Client ID / Client Secret prompt.

If neither is set, the server uses open DCR (backward compatible, suitable for trusted LANs).

### Hosted mode (multi-client)

Want to run mcp-homelab as a shared service accessible from multiple machines, Claude.ai, or mobile? See the Hosted Mode Guide for the full workflow, including the platform-specific Proxmox LXC + Cloudflare Tunnel reference architecture.

### Running directly```bash
python server.py

The server starts on stdio transport (standard for MCP). Normally you don't run this directly — the MCP client spawns it automatically.

Custom context notes

mcp-homelab generates infrastructure docs into context/generated/ from live scan data. If you also have your own curated notes (architecture docs, runbooks, etc.) that you want your AI assistant to reference, don't put them in this project.

Instead, connect your documentation workspace to the MCP client directly:

  • Claude Desktop / ChatGPT: Add a separate filesystem MCP server pointing at your docs folder
  • VS Code / Copilot: Add your docs folder to the workspace — the agent sees all workspace files automatically

This keeps concerns separated: mcp-homelab handles live infrastructure state, your docs workspace handles curated knowledge, and the MCP client aggregates both.

Testing

Unit tests use pytest with full mocking — no real infrastructure required.

Install test dependencies```bash

pip install pytest pytest-asyncio


### Run tests```bash
# All tests
python -m pytest tests/ -v

# Single module
python -m pytest tests/unit/test_node_parsers.py -v

# Single test class
python -m pytest tests/unit/test_ssh.py::TestConnect -v

# Single test
python -m pytest tests/unit/test_config.py::TestBootstrapConfigDir::test_sets_env_when_unset -v

Test structure```

tests/
├── conftest.py # Shared fixtures (sample configs, mock SSH, env helpers)
└── unit/
├── test_config.py # Config loading, bootstrap, env validation, Pydantic models
├── test_ssh.py # Connection caching, stale eviction, credential resolution
├── test_node_parsers.py # All SSH output parsers (uptime, CPU, memory, disk, Docker,
│ # lscpu, meminfo, lsblk, dmidecode, labels, rounding)
├── test_proxmox_tools.py # VM/LXC tools, storage, templates, node discovery, input validation
├── test_opnsense_tools.py # DHCP leases, interfaces, firewall aliases
├── test_prompts.py # Input validation (IP, int, path, yes/no, node names)
├── test_config_writer.py # YAML round-trip, .env upserts, section preservation
└── test_client_setup.py # JSONC stripping, OS detection, atomic writes, config merging


## Project Structure```
mcp-homelab/
├── server.py              # MCP entry point — registers all tools
├── tools/
│   ├── discovery.py       # Composite scan tool for agent bootstrapping
│   ├── context_gen.py     # Documentation generation from scan data
│   ├── nodes.py           # SSH-based node tools + output parsers
│   ├── proxmox.py         # Proxmox REST API tools
│   └── opnsense.py        # OPNsense REST API tools
├── core/
│   ├── config.py          # Config loader, bootstrap, env var accessors
│   ├── ssh.py             # SSH connection manager (paramiko)
│   ├── proxmox_api.py     # Proxmox REST API client (httpx)
│   └── opnsense_api.py    # OPNsense REST API client (httpx)
├── mcp_homelab/
│   ├── cli.py             # CLI entry point (init, serve, setup)
│   └── setup/
│       ├── prompts.py     # Validated input prompts
│       ├── config_writer.py # YAML/env round-trip writer
│       ├── node_setup.py  # Interactive node configuration
│       ├── client_setup.py # MCP client config writer (Claude Desktop, VS Code)
│       ├── check.py       # Read-only health check
│       └── ssh_helpers.py # SSH test + capability detection
├── tests/                 # pytest unit tests (see Testing section)
├── config.yaml.example    # Example host definitions (copy to config.yaml)
├── .env.example           # Required env vars template
├── requirements.txt       # Runtime dependencies
├── pyproject.toml         # Package metadata + pytest config
└── Dockerfile             # Container packaging

Future Updates

  • Dockerfile packaging — current Dockerfile is a stub; needs design work for stdio transport
  • FreeBSD memory accuracy — BSD memory reporting could include inactive/cached pages for more precise used-memory values
  • Config validation warnings — detect likely misconfigurations (e.g., sudo_docker without docker) at startup

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
MCP Homelab 38a938d4 怎么安装?

在客户端按下面的安装命令接入:python -m venv .venv && .venv/Scripts/activate # or source .venv/bin/activate on Linux/macOS。装完在客户端配置里引用同一个包或端点。

MCP Homelab 38a938d4 怎么在 Claude Desktop、Claude、VS Code 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Homelab 38a938d4 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Homelab 38a938d4 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

MCP Homelab 38a938d4 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Homelab 38a938d4 能提供哪些能力?

资料显示约 23 个工具;能力标签包括 基础设施管理、Python、Claude。具体工具清单以官方文档为准。

MCP Homelab 38a938d4 需要什么运行环境?

运行时为 Python;属于本地进程,需要在本机装好运行环境。

MCP Homelab 38a938d4 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。