Content
# ruru-swbot-mcp
MCP Server for SwitchBot API. This design allows you to operate devices by name, reducing the risk of AI mistakenly operating devices due to incorrect IDs.
## Installation
```bash
npm install -g ruru-swbot-mcp
```
## Environment Variables
Obtain your token and secret from [SwitchBot app settings](https://support.switch-bot.com/hc/en/articles/12822710195351) and configure them.
| Variable Name | Description |
| --- | --- |
| `SWITCHBOT_TOKEN` | SwitchBot API token |
| `SWITCHBOT_SECRET` | SwitchBot API secret |
## MCP Configuration
### Claude Code
```bash
claude mcp add switchbot -- npx ruru-swbot-mcp
```
### Claude Desktop
```json
{
"mcpServers": {
"switchbot": {
"command": "npx",
"args": ["ruru-swbot-mcp"],
"env": {
"SWITCHBOT_TOKEN": "<your-token>",
"SWITCHBOT_SECRET": "<your-secret>"
}
}
}
}
```
## Resources
| Resource Name | URI | Description |
| --- | --- | --- |
| `device_statuses` | `switchbot://devices/status` | Current status of all physical devices (temperature, humidity, power, etc.) |
## Tools
| Tool Name | Description |
| --- | --- |
| `list_devices` | Get a list of devices (name, type, available commands) |
| `get_device_status` | Get the current status of a device |
| `control_device` | Send a command to a device |
| `list_scenes` | Get a list of scenes |
| `execute_scene` | Execute a scene |
### Example Usage
```
1. Confirm device list with list_devices
2. Get device status with get_device_status({ deviceName: "Living Room Lighting" })
3. Control device with control_device({ deviceName: "Living Room Lighting", command: "turnOn" })
```