network-mcp
network-mcp
用于通过 UniFi Dream Machine 进行家庭网络管理的独立 HTTP MCP 服务器。
当前的控制器实现使用本地 UniFi Network UI/控制器 API,因为它支持纯文本设备管理所需的直接客户端阻止列表行为。应用程序的其余部分依赖于一个小的 NetworkController 接口,因此该实现以后可以被官方的 UniFi Network API 替换或补充。
设置
bun install
cp .env.example .env
bun run start该服务默认监听 127.0.0.1:4123。
Docker
对于托管/家庭设置,请使用 Docker Compose 运行:
cp .env.example .env
docker compose up -d --buildCompose 文件将服务绑定到容器内的 0.0.0.0,仅在主机回环地址 127.0.0.1:4123 上发布,并将 LowDB 数据持久化在 ./data 中。
代码更改后重新构建/重启:
docker compose up -d --build查看日志:
docker compose logs -f network-mcp日志通过 Winston 以 JSON 格式输出到 stdout。设置 LOG_LEVEL=debug 以包含 UniFi 请求计时和 MCP 请求诊断信息。
端点
GET /healthPOST /mcpGET /mcpDELETE /mcp
如果设置了 MCP_AUTH_TOKEN,/mcp 需要:
Authorization: Bearer <token>OpenCode 配置
将远程 MCP 服务器添加到 /home/zac/.config/opencode/opencode.json:
{
"mcp": {
"home-network": {
"type": "remote",
"url": "http://127.0.0.1:4123/mcp",
"enabled": true,
"headers": {
"Authorization": "Bearer {env:HOME_NETWORK_MCP_TOKEN}"
}
}
}
}更改 MCP 配置后,重启托管的 OpenCode 服务。
工具
list_clientsfind_deviceadd_tagremove_taglist_tagsadd_displaynameblock_deviceunblock_deviceblock_by_tagunblock_by_tagshow_blockedunblock_allrecent_actions
MAC 地址是设备的规范标识。标签和显示名称存储在 DB_PATH 下的 LowDB 中。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
GibsonAI MCP server: manage your databases with natural language
MCP server for generating rough-draft project plans from natural-language prompts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zapplebee/network-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server