SwitchBot Plug Mini MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SwitchBot Plug Mini MCPturn off the plug in the living room"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SwitchBot Plug Mini MCP
Remote Model Context Protocol (MCP) server on Cloudflare Workers that controls SwitchBot Plug Mini (JP) via the SwitchBot Open API v1.1, with GitHub OAuth for client authentication.
Tools (v1)
Tool | Description |
| List Plug Mini (JP) devices ( |
| Get status (voltage, power usage, current, …) |
| Turn a plug on |
| Turn a plug off |
| Toggle on/off |
Only GitHub users listed in ALLOWED_GITHUB_USERS can use these tools.
Related MCP server: Vindata MCP Server
Prerequisites
Node.js 18+
Cloudflare account + Wrangler
SwitchBot app Open Token and Secret Key (app v6.14+)
Two GitHub OAuth Apps (local + production), or one if you only deploy
Setup
npm install
npm run cf-typegen1. Create KV namespace
npx wrangler kv namespace create "OAUTH_KV"Copy the returned ID into wrangler.jsonc (kv_namespaces[0].id).
2. GitHub OAuth App
Create an OAuth App at GitHub Developer Settings:
Production
Homepage URL:
https://switchbot-mcp.<your-subdomain>.workers.devAuthorization callback URL:
https://switchbot-mcp.<your-subdomain>.workers.dev/callback
Local development
Homepage URL:
http://localhost:8788Authorization callback URL:
http://localhost:8788/callback
3. Secrets
Local — copy .dev.vars.example to .dev.vars and fill in:
GITHUB_CLIENT_ID=...
GITHUB_CLIENT_SECRET=...
COOKIE_ENCRYPTION_KEY=... # e.g. openssl rand -hex 32
SWITCHBOT_TOKEN=...
SWITCHBOT_SECRET=...
ALLOWED_GITHUB_USERS=your-github-loginProduction
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET
npx wrangler secret put COOKIE_ENCRYPTION_KEY
npx wrangler secret put SWITCHBOT_TOKEN
npx wrangler secret put SWITCHBOT_SECRET
npx wrangler secret put ALLOWED_GITHUB_USERSDevelop
npm start
# http://localhost:8788Test with MCP Inspector:
npx @modelcontextprotocol/inspector@latestConnect to http://localhost:8788/mcp (Streamable HTTP) or http://localhost:8788/sse (legacy SSE). Complete the GitHub OAuth flow, then list tools.
Deploy
npm run deployEndpoint: https://switchbot-mcp.<your-subdomain>.workers.dev/mcp
Connect from Cursor / Claude Desktop
Remote MCP clients that need OAuth typically use mcp-remote:
{
"mcpServers": {
"switchbot": {
"command": "npx",
"args": [
"mcp-remote",
"https://switchbot-mcp.<your-subdomain>.workers.dev/mcp"
]
}
}
}On first connect, a browser window opens for GitHub login and consent.
Architecture
OAuth:
@cloudflare/workers-oauth-provider— MCP client ↔ this Worker ↔ GitHubMCP:
McpAgentDurable Object (/mcpStreamable HTTP,/sselegacy)SwitchBot: HMAC-SHA256 signed requests to
https://api.switch-bot.com/v1.1
SwitchBot credentials are Worker secrets (one shared account), not per GitHub user.
License
See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
Manage repositories, users, releases, and automate GitHub workflows
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables remote MCP connections with GitHub OAuth authentication, providing tools like add, userInfoOctokit, and image generation (restricted) deployed on Cloudflare Workers.10 npmMIT

Vindata MCP Serverofficial
FlicenseNot gradedqualityDmaintenanceRemote MCP server with built-in GitHub OAuth, deployed on Cloudflare Workers, enabling tools like addition, GitHub user info, and image generation with access control.-- FlicenseNot gradedqualityDmaintenanceProvides a remote MCP server with GitHub OAuth authentication, deployable to Cloudflare, enabling tools like math operations and GitHub user info access.-
- FlicenseNot gradedqualityCmaintenanceEnables GitHub repository operations (list/read files, create branches, commit files, open/list PRs) via an authless remote MCP server that keeps your GitHub token encrypted on Cloudflare, with access limited to allowed repositories.-