Skip to main content
Glama

SwitchBot MCP Server

by genm

@genm/switchbot-mcp

为 AI 助手提供 SwitchBot 设备控制功能的模型上下文协议服务器。

日语

特征

  • 列出设备
  • 获取设备状态
  • 控制装置(开/关)
  • 更改设备设置
  • 场景控制
  • 设备状态监控

安装

通过 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. 更新环境变量

执照

国际学习中心

Install Server

You must to connect to the server.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

使AI助手能够控制SwitchBot设备,通过SwitchBot API提供设备管理、场景执行和传感器信息监控等功能。

  1. 特征
    1. 安装
      1. 通过 Smithery 安装
      2. 手动安装
    2. 设置
      1. SwitchBot API 配置
      2. MCP 服务器配置
      3. 3.环境变量
    3. 支持的设备
      1. 设备名称示例
        1. 支持的操作
          1. 设备管理
          2. 场景管理
          3. 传感器信息
        2. 发展
          1. 故障排除
            1. 设备无响应
            2. 身份验证错误
          2. 执照

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              Provides code manipulation, execution, and version control capabilities. It allows AI assistants to read, write, and execute code while maintaining a history of changes.
              Last updated -
              8
              Python
              MIT License
            • -
              security
              F
              license
              -
              quality
              Enables AI agents to control web browsers via a standardized interface for operations like launching, interacting with, and closing browsers.
              Last updated -
              0
              JavaScript
            • A
              security
              A
              license
              A
              quality
              Enables AI integrations with ClickUp tasks, supporting resource management, task operations, workspace organization, and AI-powered task recommendations through a standardized protocol.
              Last updated -
              18
              605
              201
              TypeScript
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              Provides tools for AI assistants to interact with smart home devices through Home Assistant, allowing operations like checking entity states and calling services.
              Last updated -
              TypeScript
              MIT License

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/genm/switchbot-mcp'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server