这是一个提供SwitchBot设备控制能力给AI助手的Model Context Protocol服务器。
<a href="https://glama.ai/mcp/servers/k8m7mttrur"><img width="380" height="200" src="https://gips2.baidu.com/it/u=191024147,2834703967&fm=3081&app=3081&f=PNG?w=760&h=400" alt="SwitchBot Server MCP服务器" /></a>
要通过Smithery自动安装SwitchBot MCP服务器到Claude桌面:
npx -y @smithery/cli install @genm/switchbot-mcp --client claude
npm install @genm/switchbot-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"
}
}
}
}
SWITCHBOT_TOKEN=your_token
SWITCHBOT_SECRET=your_secret
建议为设备命名时使用描述性名称,以便AI助手更容易控制。例如:
这种命名约定有助于AI助手理解每个设备的上下文和位置。
# 构建
npm run build
# 开发模式(TypeScript)
npm run dev
# 启动
npm start
ISC