mcp-server-awtrix
MCP Server Awtrix: Ulanzi & Pixel Clock向けAIエージェント表示オーケストレーター
MCP Server Awtrix(mcp-server-awtrix)は、オープンソースのModel Context Protocol (MCP)サーバーであり、宣言型メトリクスオーケストレーターです。AIエージェント(Antigravity、Claude Desktop、Cursor、Cline、AutoGPTなど)に、Awtrix Lightを搭載したUlanzi TC001および互換ピクセルマトリクススマートクロックの完全な制御を提供することを目的としています。
会話型・自律型AIエージェントと物理デスクトップディスプレイを橋渡しし、以下を実現します:
即時エージェントアラート: アドホックなステータスアラート、ビルド失敗通知、タスク完了をピクセル画面にプッシュします。
動的カルーセルアプリ: カスタムライブテレメトリアプリ(サーバーヘルス、SaaSメトリクス、収益カウンター、ビルドステータス)を登録・更新・循環表示します。
宣言的メトリクスポーラー: 専用のPythonスクリプトを書かずに、YAML仕様によるバックグラウンドAPI取得としきい値フォーマットを自動化します。
ハードウェアテレメトリと制御: バッテリーレベルの確認、マトリクス輝度の調整、電源状態の管理、カスタムサウンドキューのトリガー。
目次
Related MCP server: ulanzi-mcp
1. 製品要件定義書(PRD)
問題点
スマートピクセルクロック(Awtrix Lightを搭載したUlanzi TC001など)を実行している開発者やパワーユーザーは、現在、外部APIをクエリしてマトリクスアプリを更新するために、断片的でハードコードされたPythonまたはBashのcronスクリプトを書いています。
AIコーディングエージェントを扱う場合:
エージェントは、すべてのメトリックに対して生の命令コードを生成し、維持する必要があります。
AIエージェントがリアルタイム通知を送信したり、ディスプレイのライフサイクルを管理したりするための標準化されたツールセットがありません。
シークレット管理はエラーが発生しやすく、AIプロンプトやログでのAPIキー漏洩のリスクがあります。
マルチセグメントテキストフォーマットとピクセルアイコンのためのネイティブなフォールバックや検証はありません。
目標と非目標
目標
ネイティブMCPインターフェース: 通知、カスタムアプリ、デバイス管理、プレビューのための堅牢なツールを公開する標準Model Context Protocolサーバーを提供します。
宣言的テレメトリ: エージェントと人間が、組み込みのテンプレート(Jinja2)としきい値スタイリングを使用して、シンプルなYAMLファイルでメトリックポーリングルールを定義できるようにします。
安全なシークレット分離:
.env環境変数置換を使用して、機密の認証情報をプロンプトコンテキストから分離します。ゼロダウンタイムのホットリロード: サービスを再起動せずに、YAML設定ファイルの変更を自動的に反映します。
信頼性の高いフォールバック: ネットワーク障害、APIレート制限、オフライン表示状態を適切に処理します。
非目標
Awtrix Lightファームウェアの置き換え(このツールは公式のAwtrix Light REST/MQTT APIとのみ連携します)。
複雑なマルチモニタータイル同期(焦点は単一またはマルチインスタンスのスタンドアロンピクセルクロックにあります)。
対象ペルソナと使用ケース
ペルソナ | シナリオ | MCP Server Awtrixがどのように役立つか |
AIコーディングエージェント(例:Antigravity / Cursor) | エージェントが10分間のテストスイートまたは自律タスクをバックグラウンドで完了します。 |
|
DevOps / SREエンジニア | 本番稼働時間、エラーバジェット、またはChecklyの合成テストを監視したい。 |
|
SaaSファウンダー / ビルダー | リアルタイムのMRR、新規ユーザーサインアップ、サポートチケットカウンターをデスクで循環させたい。 | バックエンド管理エンドポイントをクエリする宣言型マルチメトリックアプリを定義します。 |
機能要件
FR-1: 即時通知(
/api/notify):カスタムテキスト、マルチセグメントカラーテキスト、アイコンID、サウンド/RTTTL着信音、優先度ホールド、持続時間をサポートします。
FR-2: カスタムカルーセルアプリ(
/api/custom):ディスプレイループへの名前付きアプリの登録、更新、削除機能。
リッチテキストセグメントフォーマット(
[{"t": "FAIL", "c": "FF0000"}, {"t": " (2/10)", "c": "FFFFFF"}])をサポートします。
FR-3: 宣言型バックグラウンドエンジン:
apps/*.yamlで定義されたポーリングジョブを実行する組み込みスケジューラー(asyncio/apscheduler)。計算変数、算術演算、条件式をサポートするテンプレートエンジン。
FR-4: デバイス状態とテレメトリ:
バッテリー残量、Wi-Fi RSSI、照度センサー、マトリクス状態、アクティブなアプリをクエリします。
輝度、スリープ/ウェイク状態、トランジションを調整します。
FR-5: ドライランとシミュレーション:
ハードウェア送信前に、正確なレンダリング済みJSONペイロードとカラー検証を返すプレビューツール。
非機能要件
レイテンシ: 直接MCPツール実行は、ローカルネットワーク上で$< 150\text{ms}$以内にAwtrixにディスパッチする必要があります。
耐障害性: オーケストレーターは、アプリを劣化としてマークする前に、指数バックオフで失敗したAPIフェッチを再試行します。
ポータビリティ: 標準Pythonパッケージとしてパッケージ化され、
uv/pipxサポート、Dockerコンテナ、スタンドアロンCLIを備えています。
2. システムアーキテクチャと設計
高レベルアーキテクチャ
┌──────────────────────────┐
│ AI Client/Host │
│ (Claude / Antigravity / │
│ Cursor / Cline) │
└────────────┬─────────────┘
│
│ stdio / SSE (MCP Protocol)
▼
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ mcp-server-awtrix │
│ │
│ ┌───────────────────────┐ ┌──────────────────────────────┐ ┌───────────────────┐ │
│ │ MCP Interface │ │ App Orchestrator │ │ Config Watcher │ │
│ │ (Tools / Resources) │ │ (Async Scheduler) │ │ (Hot-Reload) │ │
│ └───────────┬───────────┘ └──────────────┬───────────────┘ └─────────┬─────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌──────────────────────────────────────────────────────────────────────────────────┐ │
│ │ Core Engine & Driver │ │
│ │ - Schema Validator (Pydantic) │ │
│ │ - Template & Expression Engine (Jinja2 / JSONPath) │ │
│ │ - Secret Resolver (.env) │ │
│ │ - Awtrix REST / WebSocket Client │ │
│ └──────────────────────────────────────────┬───────────────────────────────────────┘ │
└─────────────────────────────────────────────┼──────────────────────────────────────────┘
│
│ HTTP REST (JSON)
▼
┌──────────────────────────┐
│ Ulanzi TC001 Clock │
│ (Awtrix Light Firmware)│
└──────────────────────────┘コンポーネント構成
MCPインターフェースレイヤー:
stdioおよびSSEを介してModel Context Protocolサーバーエンドポイントを実装します。厳密なJSONスキーマとAIモデル向けの人間が読めるドキュメントを備えたツールを公開します。
宣言型ポーリングエンジン:
ファイルベースのアプリマニフェストのタスクライフサイクルを管理する非同期ワーカー。
HTTPリクエストを評価し、JSONPath/式を使用してフィールドを抽出し、表示ルールを解決します。
Awtrixドライバー:
デバイス通信、リクエスト重複排除、接続プーリング、エラーリカバリをカプセル化します。
設定とセキュリティレイヤー:
機密トークンを
.envに分離します。設定ファイルは${VAR_NAME}構文で変数を参照します。
3. MCPツール仕様
AIエージェントは以下のMCPツールを実行できます:
awtrix_notify
現在のカルーセルを中断して、即時の高優先度通知を画面にプッシュします。
{
"text": "Build Failed: Backend API",
"icon": "10558",
"color": "FF0000",
"duration": 8,
"sound": "alarm",
"rtttl": "beep:d=4,o=5,b=100:16e6,16e6",
"wakeup": true
}awtrix_upsert_app
カルーセルループ内の永続的なカスタムアプリを登録または更新します。
{
"name": "app_users",
"text": [
{"t": "1,420", "c": "FFFFFF"},
{"t": " (+42)", "c": "00FF00"}
],
"icon": "2058",
"duration": 5,
"lifetime": 300
}awtrix_delete_app
デバイスサイクルからカスタムアプリを削除します。
{
"name": "app_users"
}awtrix_get_device_state
ハードウェア統計と現在の運用メトリクスを返します。
応答:
{
"online": true,
"battery": 88,
"charging": true,
"lux": 140,
"temp": 24,
"ram_free": 128440,
"active_app": "app_users",
"brightness": 120
}awtrix_set_settings
輝度、マトリクスオン/オフ、トランジション速度などのデバイスパラメータを設定します。
{
"brightness": 80,
"power": true
}awtrix_test_render
式を解析し、ハードウェアにプッシュせずにレンダリングされたペイロードを返すドライラン用ヘルパー。
4. 宣言型アプリエンジン(YAMLスキーマ)
カスタムPythonスクリプトを維持する代わりに、apps/ディレクトリに.yamlマニフェストを配置します。
例1: サービスヘルス(Checkly)
apps/checkly.yaml
app_id: "checkly"
name: "checkly_status"
enabled: true
interval_seconds: 60
source:
type: "http"
url: "https://api.checklyhq.com/v1/checks"
headers:
Authorization: "Bearer ${CHECKLY_API_KEY}"
X-Checkly-Account: "${CHECKLY_ACCOUNT_ID}"
transform:
total: "len(data)"
failures: "sum(1 for c in data if c.get('hasFailures'))"
degraded: "sum(1 for c in data if c.get('isDegraded') and not c.get('hasFailures'))"
display:
- condition: "failures > 0"
icon: "10558"
notify: true
text:
- { text: "FAIL ", color: "FF0000" }
- { text: "({{failures}}/{{total}})", color: "FFFFFF" }
- condition: "degraded > 0"
icon: "10558"
text:
- { text: "WARN ", color: "FFA500" }
- { text: "({{degraded}}/{{total}})", color: "FFFFFF" }
- condition: "default"
icon: "483"
text:
- { text: "UP ", color: "00FF00" }
- { text: "({{total}})", color: "FFFFFF" }例2: マルチメトリックSaaSダッシュボード
apps/saas_metrics.yaml
app_id: "saas_metrics"
interval_seconds: 120
source:
type: "http"
url: "https://api.example.com/v1/admin/metrics"
headers:
X-API-Secret: "${SAAS_METRICS_API_SECRET}"
sub_apps:
- name: "app_users"
icon: "2058"
text:
- { text: "{{data.users_total}}", color: "FFFFFF" }
- { text: " (+{{data.new_users_last_week}})", color: "00FF00" }
- name: "app_premium"
icon: "5336"
text:
- { text: "{{data.users_premium}}", color: "FFFFFF" }
- { text: " (+{{data.new_users_premium_last_week}})", color: "FFD700" }
- name: "app_orders"
icon: "21072"
text:
- { text: "{{data.orders_total}}", color: "FFFFFF" }
- { text: " (+{{data.new_orders_last_week}})", color: "00FF00" }
- name: "app_support"
icon: "10558"
show_if: "data.tickets_open > 0"
text:
- { text: "{{data.tickets_open}}", color: "FF0000" }5. クイックスタートとインストール
前提条件
Python 3.10以上
Awtrix Light FirmwareがフラッシュされたUlanzi TC001(または互換デバイス)がWi-Fiネットワークに接続されていること。
uv / pipによるローカルセットアップ
# Clone the repository
git clone https://github.com/klodnickik/mcp-server-awtrix.git
cd mcp-server-awtrix
# Copy example environment configuration
cp .env.example .env
# Edit device address and API keys in .env
# AWTRIX_BASE_URL=http://awtrix3.localstdio上でMCPサーバーをローカルで実行します:
# Using uv (recommended)
uv run mcp-server-awtrix
# Or standard pip
pip install -e .
python -m awtrix_mcpDocker & Docker Composeセットアップ
Docker Composeを使用して実行します:
# 1. Clone & prepare environment
git clone https://github.com/klodnickik/mcp-server-awtrix.git
cd mcp-server-awtrix
cp .env.example .env
# 2. Start the MCP Server (SSE on port 8000) and Metric Daemon
docker compose up -d
# Or start only the metric poller daemon:
docker compose up -d metric-daemon
# View live logs:
docker compose logs -fMCPクライアント設定
1. Google Antigravity
mcp_servers.jsonに追加します:
{
"mcpServers": {
"awtrix": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-server-awtrix", "run", "mcp-server-awtrix"],
"env": {
"AWTRIX_BASE_URL": "http://awtrix3.local"
}
}
}
}2. Claude Desktop
claude_desktop_config.jsonに追加します:
{
"mcpServers": {
"awtrix": {
"command": "python",
"args": ["-m", "awtrix_mcp"],
"env": {
"AWTRIX_BASE_URL": "http://awtrix3.local"
}
}
}
}3. Cursor
Cursor設定 $\rightarrow$ 機能 $\rightarrow$ MCPサーバー $\rightarrow$ サーバーを追加:
名前:
awtrixタイプ:
commandコマンド:
uv --directory /path/to/mcp-server-awtrix run mcp-server-awtrix
6. ロードマップとコントリビューション
コアMCPツール仕様と設計
宣言型YAMLオーケストレーションスキーマ
非同期HTTPクライアントを備えたFastMCP実装
マトリクスピクセルアート用のライブビジュアルWebプレビュー
MQTTトランスポートレイヤーサポート(RESTの代替オプション)
Home Assistantサービスディスカバリーエクスポート
コントリビューションを歓迎します!機能ディスカッションのためのPRを提出するか、イシューを開いてください。
7. ライセンス
MITライセンスの下で配布されています。詳細についてはLICENSEを参照してください。
Available Tools
6 toolsawtrix_delete_appADestructiveIdempotent
Remove a custom app from the display cycle by name.
Inputs: name (required). Returns: object
awtrix_get_device_stateARead-onlyIdempotent
Return current AWTRIX hardware metrics: battery, lux, temperature, active app (if available).
Inputs: no named parameters. Returns: object
awtrix_notifyB
Push an instant, high-priority notification to the AWTRIX display.
Inputs: text (required), hold, icon, color, +5 more. Returns: object
awtrix_set_settingsAIdempotent
Configure display brightness, transition animations, and screen power state.
Inputs: power, brightness, transitions. Returns: object
awtrix_test_renderARead-onlyIdempotent
Validate and preview a rendered notification/app payload with no hardware side-effects.
Inputs: text (required), hold, icon, kind, +6 more. Returns: object
awtrix_upsert_appAIdempotent
Create or update a persistent custom app in the display carousel.
Inputs: name (required), text (required), icon, save, +6 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct operation: app mutation, instant notification, device state query, settings, and safe preview. notify and test_render are clearly separated by side effects, while upsert_app vs notify is distinguished by persistence and priority.
All tools share the awtrix_ prefix and use snake_case with a mostly verb_noun pattern. awtrix_notify is a minor outlier because it lacks an explicit object, but the overall naming is still predictable and readable.
Six tools cover a focused display-management scope without redundancy. The count is well within the ideal range, and each tool serves a meaningful purpose.
The set covers app create/update/delete, notifications, settings, device state, and safe payload testing. Missing explicit list/get app endpoints are minor gaps that agents can partially work around using the existing app and state tools.
Maintenance
Related MCP Connectors
Run your TRMNL ePaper (e-ink) displays from any AI agent: devices, playlists and new screens.
Connect your AI to your own devices, 3D printers, factory tools and a shared agent task pool.
A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.
Create, test, and manage uptime monitors for websites and APIs from your AI agent.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables programmatic control of Divoom Pixoo LED matrices to display layered pixel art, animations, and hardware-rendered scrolling text. Users can compose complex visual scenes, push images, and manage device settings like brightness and channels through an LLM.8228 npm14Apache 2.0
- AlicenseAqualityCmaintenanceMCP server and CLI for controlling Ulanzi TC001 Smart Pixel Clock via AWTRIX3 HTTP API. Enables power, brightness, notifications, and more from AI assistants.202MIT

mcp-divoom-lanofficial
AlicenseBqualityBmaintenanceEnables AI clients to control Divoom LAN devices, including watchface management, brightness adjustment, and screen control through natural language.4255 npm8MIT- AlicenseAqualityDmaintenanceLets your AI assistant control and display text/images on a Tidbyt or Tronbyt LED sign via the MCP protocol.932 npm1MIT