Skip to main content
Glama
SwitchBot MCP Server
by genm

@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 配置

  1. 安装 SwitchBot 应用程序

  2. 创建帐户并登录

  3. 前往“个人资料”>“设置”>“开发者选项”

  4. 获取令牌和密钥

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

故障排除

设备无响应

  1. 验证设备是否在蓝牙范围内

  2. 检查设备电池状态

  3. 验证 SwitchBot 集线器连接状态

身份验证错误

  1. 检查令牌和密钥过期

  2. 重新生成令牌和密钥

  3. 更新环境变量

执照

国际学习中心

Available Tools

3 tools
control_deviceD

デバイスを制御します

Inputs: deviceId (required), command (required).

get_device_statusC

デバイスのステータスを取得します

Inputs: deviceId (required).

list_devicesB

デバイス一覧を取得します

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count3/5

    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.

    Completeness3/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      9
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to control Xiaomi Mi Home smart devices through natural language, supporting device listing, property control, actions, and scenes.
      8
      MIT