switchbot-mcp
by PetitOnes
README.md
# m5-petit-switchbot
SwitchBot Cloud API(v1.1)をラップするMCPサーバー。プラグ・照明・カーテン・赤外線リモコンなどを操作できる。
## セットアップ
1. SwitchBotアプリ → プロフィール → 設定 → アプリバージョンを10回タップ → 「開発者向けオプション」が出現
2. そこから Token と Secret を取得
3. `.env.example` を参考に環境変数 `SWITCHBOT_TOKEN` / `SWITCHBOT_SECRET` を設定
## ツール
| ツール | 内容 |
|---|---|
| `list_devices` | 登録デバイス一覧(物理デバイス+赤外線リモコン) |
| `get_device_status` | デバイスの現在の状態(物理デバイスのみ) |
| `send_command` | 任意のコマンドを送る(command/parameter/commandType) |
| `turn_on` / `turn_off` | 電源ON/OFF(プラグ・照明・赤外線家電) |
デバイスIDは `list_devices` で調べる。
## キャラクターへの登録例
`$PETIT_DATA_DIR/characters/<id>/config/autonomous-mcp.json` の `mcpServers` に追加:
```json
"switchbot": {
"command": "uv",
"args": ["run", "--directory", "/path/to/m5-petit-switchbot", "switchbot-mcp"],
"env": {
"SWITCHBOT_TOKEN": "...",
"SWITCHBOT_SECRET": "..."
}
}
```
`SWITCHBOT_ALLOWED_TOOLS`(カンマ区切り)で使えるツールを制限できる(m5-petit-mcp と同じ仕組み)。
## ライセンス
Apache-2.0。[PetitOnes](https://github.com/PetitOnes) の部品のひとつ。全体の入口は [petit-ones](https://github.com/PetitOnes/petit-ones)。
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues