
gbassaragh/unifi-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
ユニファイネットワークのMCPサーバーと保護API統合 - AI搭載ネットワーク管理
概要
ClaudeのようなAIアシスタントを提供するMCP(Model Context Protocol)サーバーは、UniFi Networkにアクセスし、インフラ管理と分析機能を保護します。 - :リスト、再起動、検索、およびUniFiデバイス(AP、スイッチ、ルーター)のアップグレード - : モニター接続クライアント、ブロック/ブロック解除、トラフィック統計の表示 - : サイトの健康、ネットワーク構成、VLAN、およびワイヤレス設定 - : イベント、アラーム、速度テスト、およびDPI統計 - :ネットワーク分析、最適化の推奨事項、トラブルシューティング - : リストカメラ、ビューステータス、ライブスナップショットの取得 - : NVRの状態、カメラのヘルスの要約 - : 照明、センサー、煙、およびビューアの管理 - : 設定されたカメラビューレイアウト - 複数のUniFiデバイス(ゲートウェイ、NVRなど)の設定.
概要(AI 翻訳)
ClaudeのようなAIアシスタントを提供するMCP(Model Context Protocol)サーバーは、UniFi Networkにアクセスし、インフラ管理と分析機能を保護します。
##特徴
##ユニファイネットワーク
- デバイス管理:リスト、再起動、検索、およびアップグレードUniFiデバイス(AP、スイッチ、ルータ)
- クライアント管理: 接続されたクライアントを監視し、ブロック/ブロック解除、トラフィック統計を表示
- サイト管理: サイトのヘルス、ネットワーク構成、VLAN、およびワイヤレス設定を表示 -統計と監視:イベント、アラーム、速度テスト、およびDPI統計
- AI-Powered Insights:ネットワーク分析、最適化の推奨事項、トラブルシューティング
###UniFi保護
- カメラ管理: リストカメラ、ビューステータス、ライブスナップショットを取得
- システム監視:NVRの状態、カメラの健康の要約
- 付属品:ライト、センサー、煙、視聴者の管理 -ライブビュー: 設定されたカメラビューレイアウトへのアクセス
##マルチデバイスサポート
- 複数のUniFiデバイス(ゲートウェイ、NVRなど)の設定
- 名前による特定のデバイスをターゲット
- デバイスのネットワークと保護サービスのミックス
対応ハードウェア
- ユニファイドリームマシン(UDM、UDM-Pro、UDM-SE)
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
UniFi MCP Server
An MCP (Model Context Protocol) server that provides AI assistants like Claude with access to UniFi Network and Protect infrastructure management and analysis capabilities.
Features
UniFi Network
- Device Management: List, restart, locate, and upgrade UniFi devices (APs, switches, routers)
- Client Management: Monitor connected clients, block/unblock, view traffic statistics
- Site Management: View site health, network configurations, VLANs, and wireless settings
- Statistics & Monitoring: Events, alarms, speed tests, and DPI statistics
- AI-Powered Insights: Network analysis, optimization recommendations, and troubleshooting
UniFi Protect
- Camera Management: List cameras, view status, get live snapshots
- System Monitoring: NVR status, camera health summaries
- Accessories: Manage lights, sensors, chimes, and viewers
- Liveviews: Access configured camera view layouts
Multi-Device Support
- Configure multiple UniFi devices (gateways, NVRs, etc.)
- Target specific devices by name
- Mix of Network and Protect services across devices
Supported Hardware
- UniFi Dream Machine (UDM, UDM-Pro, UDM-SE)
- UniFi Cloud Gateway (UCG-Ultra, UCG-Fiber)
- UniFi Network Video Recorder (UNVR, UNVR-Pro)
- UniFi Network Application (self-hosted)
- Traditional Cloud Key (Gen1, Gen2, Gen2+)
Installation
Using uv (Recommended)
# Clone the repository
git clone https://github.com/gbassaragh/Unifi-mcp.git
cd Unifi-mcp
# Install dependencies
uv sync
Using pip
pip install -e .
Configuration
Create a .env file in the project root (or set environment variables).
Multi-Device Configuration (Recommended)
Configure multiple UniFi devices with different services:
UNIFI_DEVICES='[
{
"name": "main-gateway",
"url": "https://192.168.1.1",
"api_key": "your-gateway-api-key",
"services": ["network"],
"site": "default"
},
{
"name": "nvr",
"url": "https://192.168.1.2",
"api_key": "your-nvr-api-key",
"services": ["network", "protect"],
"site": "default"
}
]'
UNIFI_VERIFY_SSL=false
Device configuration fields:
| Field | Description | Default |
|---|---|---|
name |
Friendly name for targeting the device | (required) |
url |
Base URL of the UniFi device | (required) |
api_key |
API key from UniFi OS Control Plane | (required) |
services |
Array: ["network"], ["protect"], or both |
["network"] |
site |
Site name for network operations | "default" |
verify_ssl |
Verify SSL certificates | false |
username |
Username for Protect events (optional) | null |
password |
Password for Protect events (optional) | null |
Note: The username and password fields are only required for Protect event tools (motion events, smart detections). Basic camera operations work with just the API key.
To create an API key:
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"unifi": {
"command": "uv",
"args": ["run", "--directory", "/path/to/Unifi-mcp", "python", "-m", "unifi_mcp.server"],
"env": {
"UNIFI_DEVICES": "[{\"name\":\"gateway\",\"url\":\"https://192.168.1.1\",\"api_key\":\"your-key\",\"services\":[\"network\"]},{\"name\":\"nvr\",\"url\":\"https://192.168.1.2\",\"api_key\":\"your-key\",\"services\":[\"network\",\"protect\"]}]",
"UNIFI_VERIFY_SSL": "false"
}
}
}
}