SwitchBot

SwitchBot is an MCP server that connects large language model interfaces to the official SwitchBot Open API. It is used by developers, home automation enthusiasts, and smart home operators who want to query and control IoT hardware directly from AI assistants. The server provides a standard Model Context Protocol interface supporting both stdio and Streamable HTTP transports. Through this connection, assistants can enumerate discovered devices, read current sensor and device states, toggle power, send low-level hardware commands, and execute preset scenes configured in the SwitchBot mobile app. To protect user privacy and network integrity, the integration implements native fetch validation, in-memory caching for device listings, redacted operational logs on standard error, and strict Host and Origin validation for HTTP deployments. It does not persist credentials or device telemetry, communicating directly with official SwitchBot API endpoints to automate smart home workflows.

Category: Cloud & Infrastructure

Tags: automation, iot, smart-home, switchbot

Visit SwitchBot

How to install and configure SwitchBot

Follow these steps to set up and configure the server for your MCP client. 1. Clone the repository and build the project from source: bash git clone https://github.com/genm/switchbot-mcp.git cd switchbot-mcp npm ci --ignore-scripts npm run build 2. Open your client configuration file, such as Claude Desktop's claude_desktop_config.json. 3. Add the server entry pointing to the local build path, replacing the placeholders with your credentials: json { "mcpServers": { "switchbot": { "command": "node", "args": ["/absolute/path/to/build/index.js"], "env": { "SWITCHBOT_TOKEN": "YOUR_SWITCHBOT_TOKEN", "SWITCHBOT_SECRET": "YOUR_SWITCHBOT_SECRET", "MCP_TRANSPORT": "stdio" } } } } 4. Alternatively, use VS Code by running: bash code --add-mcp '{"name":"switchbot","command":"npx","args":["-y","@genm-dev/switchbot-mcp"],"env":{"SWITCHBOT_TOKEN":"YOUR_SWITCHBOT_TOKEN","SWITCHBOT_SECRET":"YOUR_SWITCHBOT_SECRET","MCP_TRANSPORT":"stdio"}}' 5. Restart your MCP client to load the tools.

What you can do with SwitchBot

  • Query current power states, temperatures, or battery levels across connected SwitchBot sensors and smart appliances. * Trigger predefined SwitchBot scenes to adjust lighting, curtains, and air conditioning simultaneously using natural language. * Turn smart plugs, bots, and powered home appliances on or off through automated assistant conversations. * Inspect raw hardware status and send low-level operational commands to specific devices via custom API parameters.

Key facts

  • https://github.com/genm/switchbot-mcp
  • Cloud & Infrastructure, Other & General Purpose
  • automation, iot, smart-home, switchbot

Part of MCP Servers

Related MCP servers

  • MCP KQL Server — MCP KQL Server is an MCP server that connects AI assistants to Azure Data Explorer clusters using Azure CLI authentication.…
  • MCP Media Player — MCP Media Player is an MCP server that exposes playback controls for Home Assistant media players to AI agents. It…
  • MCP Marvel Rivals — MCP Marvel Rivals is an MCP server that provides access to Marvel Rivals game data through a standardized interface. It…
  • MCP Kubernetes Server — MCP Kubernetes Server is an MCP server that provides tools for managing and inspecting Kubernetes clusters directly through Large Language…
  • MCP Notify Server — MCP Notify Server is an MCP server that sends desktop notifications accompanied by audio alerts when AI agents complete tasks.…
  • MCP Notification Server — MCP Notification Server is an MCP server that sends periodic notifications at fixed intervals of every 10 seconds. Built around…

How do I install SwitchBot?

You can install it by cloning the repository from GitHub and running npm ci --ignore-scripts followed by npm run build. After building from source, configure your MCP client such as Claude Desktop or VS Code to run node pointing to the compiled build/index.js file with your SwitchBot token and secret environment variables.

What can SwitchBot do?

The server exposes seven tools to list discovered devices, check individual device statuses, toggle power states, dispatch raw control commands, view configured scenes, and execute scenes through the official SwitchBot Open API.

Which MCP clients work with SwitchBot?

SwitchBot works with any client supporting the Model Context Protocol, including Claude Desktop, VS Code with the MCP extension, Cursor, and the MCP Inspector for manual local debugging.

Is SwitchBot open source?

Yes, SwitchBot is open source software published under the ISC license. The source code, issue tracker, and documentation are publicly available on GitHub.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories