Homelab Infra Mcp

io.github.seayniclabs由 GitHub 帳號 seayniclabs 發布v2.1.1更新於 Nov 6, 2026

Homelab: Nginx Proxy Manager, Docker and Cloudflare DNS, with approval for every change.

發布方自己的服務:Infrapage

概覽

AI 產生的概覽

讓助理管理自架環境的 Nginx Proxy Manager 代理主機、Docker 容器與 Cloudflare DNS,每次變更前都需確認。

可以做什麼
  • 檢視並變更 Nginx Proxy Manager 的代理主機、重新導向、SSL 憑證與 IP 存取清單
  • 列出、啟動、停止、重新啟動、移除與清理容器和映像,並讀取日誌、統計、磁碟區、網路與 Portainer 堆疊
  • 列出、建立、更新與刪除 Cloudflare DNS 記錄和區域,並以 BIND 格式匯出區域
  • 用一份經確認的計畫上線或下線服務,並查看服務狀態或整體基礎設施概況
  • 逐段診斷公開網域,指出第一個失敗的環節並提供修正建議
  • 選用模組另外提供 Home Assistant、Uptime Kuma、Cloudflare Tunnel、AdGuard Home 與 Authentik 工具
適用情境
適合自架家庭實驗室的玩家,想讓助理把容器發布到公開網域、讓 DNS 與代理記錄保持一致,並排查停止回應的服務。也適合需要唯讀巡檢、同時要求變更先顯示並確認的情境。
執行需求
以 Python 套件在本機執行(需 Python 3.11 以上,可用 uvx 或 pip 安裝),透過 stdio 或本機 HTTP 端點連線。每個啟用的模組都需要位址與憑證:Nginx Proxy Manager 登入、Docker socket 或 Portainer 位址與權杖、Cloudflare API 權杖與區域 ID,以及選用的 Home Assistant、Uptime Kuma、Cloudflare Tunnel、AdGuard Home 與 Authentik 權杖。設定透過環境變數或設定檔提供。
安裝前請注意
它持有高權限憑證:HOMELAB_PROXY_PASSWORD、HOMELAB_DNS_API_TOKEN、HOMELAB_TUNNEL_API_TOKEN、HOMELAB_SSO_TOKEN、HOMELAB_DOCKER_PORTAINER_TOKEN、HOMELAB_HOME_ASSISTANT_TOKEN、HOMELAB_UPTIME_API_KEY 與 HOMELAB_DNS_FILTER_PASSWORD。變更會寫入實際基礎設施:刪除代理主機、DNS 記錄、容器與存取清單,清理已停止的容器和映像,以及申請 Let's Encrypt 憑證。通道與 SSO 變更會暴露到公開網際網路。Docker socket 存取等同主機 root 權限。設定 HOMELAB_ _ALLOW_WRITES=true 會取消逐次確認;HOMELAB_READ_ONLY=true 會拒絕所有變更。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Homelab Infra Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Homelab

Made by Seaynic Labs. Need tools like this built around your own systems? We do that.

Homelab is an MCP server that lets an AI assistant manage Nginx Proxy Manager proxy hosts, Docker containers and Cloudflare DNS records from one place. It covers the path from a container to a public web address. One call, expose_service, checks the container, adds the DNS record and the proxy host, and shows the plan before anything changes. Four more optional modules cover Uptime Kuma, Cloudflare Tunnel, AdGuard Home and Authentik.

It is a bundle: one server made of modules, plus skills that teach the assistant the workflows. You switch on the modules you use. New modules arrive switched off, so an update never changes what your assistant can do until you choose to.

Audience: self-hosters running a homelab.

ModuleWhat it doesStatus
proxyNginx Proxy Manager: proxy hosts, redirections, SSL certificates, access listsOn by default
dockerContainers, images and volumes through the local Docker socket or PortainerOn by default
dnsCloudflare DNS zones and records, and BIND exportOn by default
home_assistantEntities, automations, scripts and system info in Home AssistantOff by default, turn on with HOMELAB_HOME_ASSISTANT_ENABLED=true
uptimeUptime Kuma monitors: list and read status (read only)Off by default, turn on with HOMELAB_UPTIME_ENABLED=true
tunnelCloudflare Tunnel routes: list, add and removeOff by default, turn on with HOMELAB_TUNNEL_ENABLED=true
dns_filterAdGuard Home: filter status, query log and filter rulesOff by default, turn on with HOMELAB_DNS_FILTER_ENABLED=true
ssoAuthentik: list applications, create a proxy provider and application for one hostOff by default, turn on with HOMELAB_SSO_ENABLED=true

The core tools are always on: homelab_modules, homelab_health, expose_service, teardown_service, service_status, infrastructure_overview and diagnose_service.

Homelab works with any MCP client: Claude Desktop, Claude Code, Cursor, VS Code, Sonique, Hermes, OpenClaw and others. It runs on your own machine and keeps no data of its own. It talks only to the services you configure.

Install

Homelab needs Python 3.11 or newer. With uv there is nothing to install ahead of time. Pin the version so updates arrive only when you choose them:

bash
uvx homelab-infra-mcp==2.1.1 --version

Or with pip:

bash
pip install homelab-infra-mcp==2.1.1

Upgrading from 2.0? Version 2.1 has no breaking changes. The four new modules are off by default. Read the 2.1.0 section of CHANGELOG.md.

Upgrading from 1.x? Version 2.0 changed the tool names and the environment variable names. Read the migration table in CHANGELOG.md first.

Quick install

Add the server to your MCP client (see Add it to your MCP client), set the variables for the modules you use, and restart the client. Then ask the assistant to call homelab_modules. The response lists each module, whether it is on, and which settings are missing.

Doctor

Run homelab-infra --doctor in a terminal before you start, and after any settings change:

bash
homelab-infra --doctor

The doctor checks each enabled module's settings and reachability, the Docker socket access, and the TLS check. It prints a FIX line for each problem and exits with status 1 when something needs fixing.

Settings

Set these as environment variables in your MCP client's config, or put them in a config file (see below). You only need the settings for the modules you use. Homelab starts without any of them and tells you what is missing when you call a tool.

VariableModuleWhat it is
HOMELAB_PROXY_URLproxyNginx Proxy Manager address. Default http://localhost:81.
HOMELAB_PROXY_EMAIL / HOMELAB_PROXY_PASSWORDproxyThe NPM admin login used for the API
HOMELAB_DOCKER_HOSTdockerDocker engine address. Default unix:///var/run/docker.sock.
HOMELAB_DOCKER_PORTAINER_URL / HOMELAB_DOCKER_PORTAINER_TOKENdockerUse Portainer instead of the socket. Both are needed.
HOMELAB_DOCKER_PORTAINER_ENDPOINT_IDdockerPortainer endpoint id. Default 1.
HOMELAB_DNS_API_TOKENdnsCloudflare API token with DNS edit permission on the zone
HOMELAB_DNS_ZONE_IDdnsDefault zone id, so tools can leave zone_id empty
HOMELAB_HOME_ASSISTANT_URLhome_assistantHome Assistant address. Default http://homeassistant.local:8123.
HOMELAB_HOME_ASSISTANT_TOKENhome_assistantLong-lived access token
HOMELAB_UPTIME_URLuptimeUptime Kuma address
HOMELAB_UPTIME_API_KEYuptimeUptime Kuma API key. Read from /metrics, used for list and get.
HOMELAB_TUNNEL_API_TOKENtunnelCloudflare API token with tunnel edit permission
HOMELAB_TUNNEL_ACCOUNT_IDtunnelCloudflare account id that owns the tunnel
HOMELAB_TUNNEL_TUNNEL_IDtunnelCloudflare Tunnel id
HOMELAB_DNS_FILTER_URLdns_filterAdGuard Home address
HOMELAB_DNS_FILTER_USERNAME / HOMELAB_DNS_FILTER_PASSWORDdns_filterAdGuard Home login
HOMELAB_SSO_URLssoAuthentik address
HOMELAB_SSO_TOKENssoAuthentik API token
HOMELAB_SSO_FLOW_SLUGssoAuthorization flow slug that new proxy providers use
HOMELAB_<MODULE>_ENABLEDanytrue or false. Turns a module on or off, e.g. HOMELAB_UPTIME_ENABLED=true.
HOMELAB_<MODULE>_ALLOW_WRITESanyfalse by default: each change asks you first. true lets the assistant make changes in that module without asking. See Safety.
HOMELAB_READ_ONLYalltrue refuses every change, whatever else is set. Reads and dry runs still work.
HOMELAB_<MODULE>_<KEY>_FILEanyRead a secret from a file instead, e.g. HOMELAB_DNS_API_TOKEN_FILE=/run/secrets/cf_token
HOMELAB_CONFIGcorePath to the config file. Default ~/.config/homelab/config.toml.
HOMELAB_APPROVAL_LOGcorePath to the approval log. Default ~/.local/state/homelab/approvals.jsonl, or $XDG_STATE_HOME/homelab/approvals.jsonl when XDG_STATE_HOME is set.

Config file (optional). Homelab also reads ~/.config/homelab/config.toml, or the file named by HOMELAB_CONFIG. Each module has its own table. Environment variables win over the file.

toml
[proxy]email = "[email protected]"password = "change-me"
[dns]api_token = "your-cloudflare-token"zone_id = "your-zone-id"

Turn a module on in the same file with its enabled key, or with HOMELAB_<MODULE>_ENABLED=true in the environment.

Add it to your MCP client

Most clients use the same JSON shape. Pin the version so the server runs the release you tested. Put the block where your client keeps MCP servers:

json
{  "mcpServers": {    "homelab": {      "command": "uvx",      "args": ["homelab-infra-mcp==2.1.1"],      "env": {        "HOMELAB_PROXY_EMAIL": "[email protected]",        "HOMELAB_PROXY_PASSWORD": "change-me",        "HOMELAB_DNS_API_TOKEN": "your-cloudflare-token",        "HOMELAB_DNS_ZONE_ID": "your-zone-id"      }    }  }}
ClientWhere the config goes
Claude Desktopclaude_desktop_config.json (Settings → Developer → Edit Config)
Claude Codeclaude mcp add homelab -- uvx homelab-infra-mcp==2.1.1, then add the env values, or a project .mcp.json
Cursor~/.cursor/mcp.json, or .cursor/mcp.json in a project
VS Code.vscode/mcp.json, using "servers" instead of "mcpServers"
Sonique, Hermes, OpenClaw, othersAny client that launches a stdio MCP server: command uvx, args ["homelab-infra-mcp==2.1.1"], plus the env values

As a Claude Code plugin. The plugin installs the server and the skills together. Its .mcp.json pins homelab-infra-mcp==2.1.1. Set the variables in your environment or in the config file.

Over HTTP. For clients that connect to a URL instead of launching a process:

bash
homelab-infra --transport http --port 8200

It serves streamable HTTP at http://127.0.0.1:8200/mcp. It listens only on your own machine by default. Put authentication in front of it before exposing it anywhere else.

Tools

The default install has 16 tools. Each module adds its own tools when you turn it on.

ToolWhat it does
homelab_modulesWhich modules are on, which settings are missing, and what each tool does. Call this first.
homelab_healthConnectivity and version for every enabled module
expose_serviceCheck a container, add a DNS record (optional), add a proxy host. One approved plan.
teardown_serviceRemove a service's proxy host and optional DNS record. One approved plan.
service_statusOne view of a service: container, proxy hosts, DNS records
infrastructure_overviewCounts across Docker, the proxy and DNS
diagnose_serviceRead only. Checks each hop from a domain to its service, one row per hop. Returns the first failing hop and its fix.
proxy_hostslist, get, create, update, delete proxy hosts
proxy_redirectionslist, create, delete HTTP redirections
proxy_certificateslist, request a Let's Encrypt certificate
proxy_access_listslist, create, delete IP access lists
docker_containerslist, get, start, stop, restart, remove, logs, stats, prune
docker_imageslist, pull, remove, prune
docker_inventoryvolumes, networks, or Portainer stacks (with a stack's compose file)
dns_zoneslist zones, or export one in BIND format
dns_recordslist, get, create, update, delete records
ha_entitieslist, get, search; call_service, turn_on, turn_off, toggle (Home Assistant)
ha_automationslist, trigger, reload automations or scripts; create previews automation YAML (Home Assistant)
ha_systemConfig, available services, check_config (Home Assistant)
uptime_monitorslist, get: read only (Uptime Kuma). Pause and resume are not in 2.1.
tunnel_routeslist; add, remove need approval (Cloudflare Tunnel)
dns_filter_statusFilter status and query and block totals (AdGuard Home, read only)
dns_filter_queriesPaged query log (AdGuard Home, read only)
dns_filter_ruleslist blocked services and custom rules; add, remove need approval (AdGuard Home)
sso_applicationslist; create makes a proxy provider and an application for one host, and needs approval (Authentik)

Every tool returns structured data with a published schema, so an assistant can write code against the results. Lists take limit and offset. Every change tool takes dry_run=true, which shows exactly what would change and changes nothing. Errors always look like homelab.<module>.<code>: <message> Fix: <hint>.

Skills

Skills are short guides the assistant reads before a job. Homelab ships them in a skills/ folder for apps that read Agent Skills, and serves each one as an MCP prompt for every other client.

Written for Homelab

SkillWhat it covers
getting-startedWhich modules are on, the settings each needs, the first checks, how approvals work
expose-a-service-safelyPut one container on a public name: dry run, approval, per-hop diagnosis, outside check
homelab-health-checkA read-only sweep of modules, containers, certificates, monitors and DNS filtering
homelab-troubleshootingRoot-cause investigation for a failing service, one hypothesis at a time
fix-and-deployVerify a fix against the original symptom, deploy it, check the live target
containersStatus, logs, restarts, stats and images for Docker containers
runbookAn operational runbook for one service, with facts pulled from the live tools
diagramAn editable draw.io file from a description
network-diagramA draw.io map of services, Docker networks, the proxy and the DNS path

Third-party, under their own licenses

SkillAuthorLicense
systematic-debuggingJesse Vincent, obra/superpowersMIT
cloudflare, cloudflare-oneCloudflare, cloudflare/skillsApache-2.0
dashmotioncsthink, csthink/dashmotionMIT
architecture-diagramCocoon-AI, architecture-diagram-generatorMIT

Each third-party skill keeps its license file. See CREDITS.md for the pinned upstream commits.

Try these

  1. Call homelab_modules and tell me which modules are on and which settings are missing.
  2. Show every container that is restarting or unhealthy, with its last ten log lines.
  3. Dry-run expose_service for wiki-app on wiki.example.com, port 8080, and show me the plan.
  4. Diagnose wiki.example.com and fix the first failing hop.
  5. Run the homelab health check and give me one table.

Safety

  • Read-only tools never change anything. The assistant can list, inspect, search and read logs freely. diagnose_service makes read-only calls only.
  • Every change needs your approval. When the assistant asks to change something, Homelab asks you directly through your MCP client (MCP elicitation) and shows the exact change: the domain, the target, the container, the DNS record. The assistant cannot answer for you. No argument it sets counts as approval.
  • Every decision is logged. Each approve, decline and refusal goes into a local approval log. The default path is ~/.local/state/homelab/approvals.jsonl. Set HOMELAB_APPROVAL_LOG to choose another path.
  • Dry runs show the plan. Every change tool accepts dry_run=true. It shows what would change and changes nothing.
  • Pre-approve only what you trust. HOMELAB_<MODULE>_ALLOW_WRITES=true lets the assistant make changes in that module without asking. Use it for modules you are happy to automate, and leave it off for the rest.
  • Some clients can't ask you questions. In those, a change returns approval_unavailable, and the message names the setting to pre-approve or the setting to leave alone.
  • Read-only mode. HOMELAB_READ_ONLY=true refuses all changes, even pre-approved ones.
  • Secrets stay out of responses. Tokens, passwords and keys come from the environment, a file, or the config file. homelab_modules reports whether a setting is set, never its value.
  • Docker socket access is root on the host. Mount the socket read-only when you only need to look, and use Portainer if you would rather not mount it at all.
  • Tunnel and SSO changes reach the public internet. Review each tunnel_routes and sso_applications plan before you approve it.
  • Homelab only calls the services you configure. It sends nothing anywhere else and keeps no data.

See SECURITY.md for the secrets list, the approval log and the reporting process.

Security card
NetworkOnly the services you configure: your Nginx Proxy Manager, your Docker engine or Portainer, api.cloudflare.com (DNS and Tunnel), and the Uptime Kuma, AdGuard Home, Authentik and Home Assistant addresses you set. diagnose_service also opens TCP and TLS connections to your upstreams and public domains. No telemetry.
FilesReads its config file (/.config/homelab/config.toml). Writes one local approval log (/.local/state/homelab/approvals.jsonl), which never leaves the machine.
SecretsAPI keys, tokens and passwords come from your environment or config file. They are never tool arguments and never returned to the model.
Read-only tools7: docker_inventory, dns_zones, service_status, infrastructure_overview, diagnose_service, homelab_modules, homelab_health
Needs your approvalproxy_hosts, proxy_redirections, proxy_certificates, proxy_access_lists, docker_containers, docker_images, dns_records, expose_service, teardown_service: you approve each change in your app, or pre-approve a module in settings. The AI cannot approve for you.
Startup costabout 10,200 tokens (16 tools, 14 skill prompts)
ChangesTool descriptions are locked by hash (tool-manifest.lock.json); CI fails if they change silently.

Develop

bash
uv venv -p 3.11 .venv && uv pip install -e '.[dev]'.venv/bin/pytest -qpython3 scripts/scan_identifiers.py --patterns <file> .

The tests never touch a real network or Docker engine. HTTP goes through httpx.MockTransport, and the Docker client is a fake.

License

MIT. See LICENSE. Third-party skills keep their own licenses; see CREDITS.md.


Built by Seaynic Labs. We build tools like this around a business's own systems: local-first, with a person approving every change. See custom integrations.

來源:README.md,提交 4c3a0f5

工具

16

proxy_hosts

Proxy hosts. list/get are read-only. create, update and delete change NPM and need the person's approval (or HOMELAB_PROXY_ALLOW_WRITES=true). dry_run=true previews without asking.

輸入參數ssllimitactionoffsetdry_runhost_idforce_ssldomain_namesforward_hostforward_portblock_exploits

proxy_redirections

HTTP redirections. list is read-only; create and delete need approval (or ALLOW_WRITES).

輸入參數limitactionoffsetdry_rundomain_namespreserve_pathforward_domainforward_schemeredirection_id

proxy_certificates

SSL certificates. list is read-only. request asks Let's Encrypt for a new certificate (needs approval, or ALLOW_WRITES). Let's Encrypt must be able to reach the domains.

輸入參數limitactionoffsetdry_rundomain_names

proxy_access_lists

IP access lists. list is read-only. create and delete need approval (or ALLOW_WRITES). allow and deny are comma-separated IPs or CIDRs. Deleting a list affects every proxy host that uses it.

輸入參數denynameallowlimitactionoffsetdry_runlist_id

docker_containers

Containers. list, get, logs and stats are read-only. start, stop, restart, remove and prune change state and need the person's approval (or HOMELAB_DOCKER_ALLOW_WRITES=true). remove deletes a container permanently. prune removes ALL stopped containers. container is a name or id (not needed for list or prune).

輸入參數alltaillimitsinceactionoffsetdry_runtimeoutcontainer

docker_images

Images. list is read-only. pull, remove and prune change the host and need approval (or HOMELAB_DOCKER_ALLOW_WRITES=true). remove deletes an image; prune removes dangling and unused images.

輸入參數tagforceimagelimitactionoffsetdry_run

docker_inventory

Read-only lists: volumes, networks, or Portainer stacks (stacks need the Portainer backend). Pass stack_id with kind=stacks to get that stack's compose file.

輸入參數kindlimitoffsetstack_id

dns_zones

Zones for the Cloudflare account (action=list), or one zone exported in BIND format (action=export).

輸入參數pagelimitactionzone_id

dns_records

DNS records. list and get are read-only. create, update and delete change the zone and need the person's approval (or HOMELAB_DNS_ALLOW_WRITES=true). create needs name, record_type and content; update needs record_id and any field to change; delete removes the record permanently.

輸入參數ttlnamepagelimitactioncontentdry_runproxiedzone_idrecord_idrecord_type

expose_service

Expose a container: check it runs, add a Cloudflare CNAME to tunnel_hostname (only if given), and add an Nginx Proxy Manager host that forwards domain to forward_host:forward_port. The plan is shown to the person before anything changes.

輸入參數domain必填dry_rundns_zone_idforward_hostforward_port必填container_name必填tunnel_hostname

teardown_service

Reverse expose_service: delete the proxy host for domain (found by name unless proxy_host_id is given) and, if dns_record_id is given, that DNS record. The exact plan is shown to the person first.

輸入參數domain必填dry_rundns_zone_iddns_record_idproxy_host_id

service_status

One view of a service: the container, the proxy hosts that name the domain, and its DNS records.

輸入參數domaindns_zone_idcontainer_name必填

infrastructure_overview

Counts across Docker, Nginx Proxy Manager and Cloudflare DNS, in one call.

無需輸入參數。

diagnose_service

Check each hop between a public domain and its upstream container, and name the first one that fails with the fix for it. Hops: DNS record, tunnel route (if the tunnel module is on), Nginx Proxy Manager host, TLS certificate (expiry and trust), upstream container running (Docker), upstream port answering, uptime monitor (if on), Authentik login in front (if on). Read-only: it changes nothing.

輸入參數domain必填

homelab_modules

Which modules are on, which settings are missing, whether writes are pre-approved, and what each tool does. Pass a module name for its full settings list (values are never shown, only whether they are set).

輸入參數module

homelab_health

Connectivity and version for every enabled module. A module with missing settings reports the variable it needs.

無需輸入參數。

版本歷史

1
  1. v2.1.1最新Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Infra 整合