SwitchBot MCP Server
@genm/switchbot-mcp
为 AI 助手提供 SwitchBot 设备控制功能的模型上下文协议服务器。
特征
列出设备
获取设备状态
控制装置(开/关)
更改设备设置
场景控制
设备状态监控
Related MCP server: MCP Govee
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 SwitchBot MCP 服务器:
npx -y @smithery/cli install @genm/switchbot-mcp --client claude手动安装
npm install @genm/switchbot-mcp设置
1. SwitchBot API 配置
安装 SwitchBot 应用程序
创建帐户并登录
前往“个人资料”>“设置”>“开发者选项”
获取令牌和密钥
2. MCP 服务器配置
将以下内容添加到claude_desktop_config.json :
{
"mcpServers": {
"switchbot": {
"command": "node",
"args": ["path/to/switchbot-mcp/build/index.js"],
"env": {
"SWITCHBOT_TOKEN": "your_token",
"SWITCHBOT_SECRET": "your_secret"
}
}
}
}3.环境变量
SWITCHBOT_TOKEN=your_token
SWITCHBOT_SECRET=your_secret支持的设备
插头
客厅落地灯
办公室电脑电源
机器人
厨房咖啡机
客厅空气净化器
窗帘
卧室窗帘
书房遮光窗帘
空调
客厅空调
卧室空调
加湿器
卧室加湿器
书房加湿器
光
厨房天花板灯
卧室夜灯
遥控
客厅电视
书房风扇
设备名称示例
建议为设备指定描述性名称,以便 AI 助手更轻松地控制。示例:
“卧室窗帘”而不仅仅是“窗帘”
“客厅空调”而非“空调”
“厨房咖啡机”而不仅仅是“机器人”
这种命名约定有助于人工智能助手了解每个设备的上下文和位置。
支持的操作
设备管理
列出设备
获取设备状态
打开/关闭设备
更改设备设置
场景管理
列出场景
执行场景
传感器信息
温度
湿度
亮度
运动
发展
# Build
npm run build
# Development mode (TypeScript)
npm run dev
# Start
npm start故障排除
设备无响应
验证设备是否在蓝牙范围内
检查设备电池状态
验证 SwitchBot 集线器连接状态
身份验证错误
检查令牌和密钥过期
重新生成令牌和密钥
更新环境变量
执照
国际学习中心
Available Tools
3 toolscontrol_deviceD
デバイスを制御します
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | Yes | デバイスID | |
| command | Yes | コマンド(turnOn, turnOff) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. 'デバイスを制御します' only states the action without revealing any behavioral traits: it doesn't indicate whether this is a read or write operation (though 'control' implies mutation), what permissions are required, whether changes are reversible, what side effects occur, or what the response looks like. For a device control tool with zero annotation coverage, this is completely inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
While the description is technically concise (a single phrase), this represents under-specification rather than effective brevity. The single sentence 'デバイスを制御します' doesn't earn its place by providing meaningful information beyond what's already implied by the tool name. True conciseness balances brevity with information density, which this description fails to achieve.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given this is a device control tool (implying mutation) with no annotations, no output schema, and a minimal description, the description is completely inadequate. The agent needs to understand what 'control' means operationally, what happens when commands are executed, what the response contains, and how this differs from sibling tools. The current description provides none of this essential context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with both parameters ('deviceId' and 'command') fully documented in the schema. The description adds no additional meaning about parameters beyond what the schema already provides. According to the scoring rules, when schema coverage is high (>80%), the baseline score is 3 even with no parameter information in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'デバイスを制御します' (controls devices) is a tautology that essentially restates the tool name 'control_device' in Japanese. It doesn't specify what kind of control is performed or differentiate this tool from its siblings 'get_device_status' and 'list_devices'. While it indicates the general domain (device control), it lacks specificity about the verb and resource scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There's no mention of when to use 'control_device' instead of 'get_device_status' or 'list_devices', nor any context about prerequisites, appropriate scenarios, or exclusions. The agent receives no usage direction beyond the tool name itself.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_device_statusC
デバイスのステータスを取得します
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | Yes | デバイスID |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('get device status') without mentioning any behavioral traits such as whether it's read-only, requires authentication, has rate limits, returns specific data formats, or handles errors. This is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with zero waste, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the status includes (e.g., online/offline, metrics), how results are returned, or any error conditions. For a tool with no structured behavioral or output information, the description should provide more context to be fully helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'deviceId' documented as 'デバイスID' (device ID). The description adds no additional meaning beyond what the schema provides, such as explaining what constitutes a valid device ID or how to obtain it. With high schema coverage, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the tool's purpose ('デバイスのステータスを取得します' translates to 'Get device status'), which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'list_devices' (which might list multiple devices) or 'control_device' (which performs actions rather than retrieving status). The purpose is understandable but lacks sibling distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There are no explicit instructions about when to use 'get_device_status' instead of 'list_devices' or 'control_device', nor any context about prerequisites or exclusions. This leaves the agent with minimal usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_devicesB
デバイス一覧を取得します
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. The description only states what the tool does ('get device list') but doesn't disclose behavioral traits like whether this requires authentication, returns paginated results, has rate limits, or what format the output takes. For a tool with zero annotation coverage, this is inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise single sentence that directly states the tool's purpose. No wasted words or unnecessary elaboration. Perfectly front-loaded with the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero annotations, no output schema, and a simple list operation, the description is incomplete. It doesn't explain what the output looks like (list format, fields included), whether there are any constraints or prerequisites, or how this differs meaningfully from sibling tools. The description provides minimal context beyond the basic action.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain parameters since there are none. Baseline for 0 parameters is 4, as the description correctly doesn't attempt to document nonexistent parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'デバイス一覧を取得します' (Get device list) clearly states the action (取得/retrieve) and resource (デバイス一覧/device list). It distinguishes from siblings like 'control_device' (which modifies) and 'get_device_status' (which gets status of individual devices). However, it doesn't specify scope (all devices? filtered?) which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. The description doesn't mention when to use list_devices versus get_device_status (for individual device status) or control_device (for device control). Usage context is implied but not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
control_device - First observed
get_device_status - First observed
list_devices
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose with no overlap: control_device performs actions on devices, get_device_status retrieves status information, and list_devices enumerates available devices. The descriptions clearly differentiate between controlling, checking status, and listing devices.
All three tools follow a consistent verb_noun pattern with snake_case naming: control_device, get_device_status, and list_devices. The naming is perfectly uniform and predictable across the entire tool set.
With only 3 tools, the count feels somewhat thin for a device control server that might benefit from more granular operations like specific device types or advanced controls. However, it covers the absolute basics adequately.
The tools provide basic CRUD-like coverage for device management (list, get status, control), but there are notable gaps such as no ability to create/configure new devices, delete devices, or handle device groups/scenes. The surface is functional but minimal.
Maintenance
Related MCP Connectors
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect any AI agent to 1,000+ apps and 27,000+ actions through one remote MCP server (OAuth).
Connect AI assistants to Subotiz - Using Subotiz's external capabilities through natural language
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to control Govee smart devices, including lights, via natural language. Supports turning on/off, changing colors, adjusting brightness, and activating scenes through the Govee API or local network.91MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control Xiaomi Mi Home smart devices through natural language, supporting device listing, property control, actions, and scenes.7MIT
- AlicenseAqualityDmaintenanceEnables monitoring and control of SwitchBot devices (temperature sensors, plugs, bots) via Claude Desktop or Home Assistant.1012 npmMIT