
Wemo
io.github.apiarya由 GitHub 账号 apiarya 发布v1.4.1更新于 Oct 28, 2026
Control WeMo smart home devices - discover, toggle, adjust brightness, and manage HomeKit codes
概览
让 AI 助手控制 Belkin WeMo 智能家居设备:在本地网络中发现设备、读取状态,并开关或调节亮度。
- 可以做什么
- 发现与列出设备:扫描本地子网查找 WeMo 设备,并列出已缓存的设备
- 查看设备:读取开关状态、亮度、IP 与型号,查看或清除设备缓存
- 控制设备:对开关和调光器执行开、关、切换或设置亮度
- 管理设备:重命名设备并获取其 HomeKit 配对码
- 查看设置:显示服务器当前的网络、缓存与日志配置
- 适用场景
- 适合拥有 WeMo 开关、插座或调光器并希望用自然语言控制它们的用户,例如睡前关闭全屋设备或确认某盏灯是否开着。
- 运行要求
- 以 Python 包形式通过 uvx 在本地运行,需先安装 uv 包管理器。运行机器需与设备处于同一本地网络。子网默认 192.168.1.0/24,通常用 WEMO_MCP_DEFAULT_SUBNET 设置;其他设置通过 WEMO_MCP_ 前缀的环境变量或 YAML 配置文件调整。无需账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Wemo,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
WeMo MCP Server
Control WeMo smart home devices through AI assistants using natural language.
mcp-name: io.github.apiarya/wemo
[CI] [codecov] [Quality Gate] [Security Rating] [PyPI version] [Python 3.10+]
[MCP Registry] [MCP] [Transport]
Table of Contents
- Overview
- Prerequisites
- Quick Start
- Connect
- Configuration
- MCP Tools
- MCP Capabilities
- How It Works
- Feature Comparison
- Development
- Contributing
- License
- Acknowledgments
Overview
Seamlessly integrate WeMo smart home devices with AI assistants through the Model Context Protocol. Built on pywemo, this server enables natural language control of your WeMo devices with intelligent multi-phase discovery.
Example Usage
[Turning on lights with natural language]
Control WeMo devices through AI assistants with natural language - just ask in plain English!
[Goodnight scene turns off all devices]
"Goodnight" — one command turns off every device in the house
Key Features
- 🔍 Smart Discovery - Multi-phase scanning (UPnP/SSDP + network ports) with 100% reliability
- ⚡ Fast Scanning - Parallel probes with 60 concurrent workers (~23-30s for full subnet)
- 🎛️ Full Control - On/off/toggle/brightness control for all device types
- ✏️ Device Management - Rename devices and extract HomeKit setup codes
- 📊 Real-time Status - Query device state and brightness
- 💾 Smart Caching - Persistent device cache with 1-hour TTL survives restarts
- 🔧 Configurable - YAML config files + environment variables for all settings
- 🔄 Auto-Retry - Automatic retry with exponential backoff for network errors
- 🛡️ Error Handling - Detailed error messages with actionable suggestions
- 🔌 Universal - Works with any MCP client (Claude, VS Code, Cursor, etc.)
- 📡 MCP Resources - Live device state via
devices://anddevice://{id}URIs - 💬 MCP Prompts - Built-in guided prompts: discover, status report, scene control, troubleshoot
- 🗣️ MCP Elicitations - Interactive clarification when subnet or device name is ambiguous
Prerequisites
All configurations use uvx (from the uv Python package manager) to run the server. Install uv first:
After installation, restart your terminal and verify:
Quick Start
Get started in seconds with Claude Code CLI:
Connect
One-Click Installation
Click your client to install instantly:
Manual Configuration
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Restart Claude Desktop after saving.
VS Code
Edit ~/.vscode/mcp.json:
Reload VS Code after saving.
Cursor
Edit ~/.cursor/mcp.json:
Restart Cursor after saving.
Cline
Cline is a VS Code extension. Add to VS Code's settings.json:
Reload VS Code after saving.
Windsurf
Edit ~/.windsurf/mcp.json:
Restart Windsurf after saving.
Zed
Edit ~/.config/zed/settings.json:
Restart Zed after saving.
Continue
Continue is a VS Code extension. Edit ~/.continue/config.json:
Reload VS Code after saving.
Configuration
The WeMo MCP Server supports flexible configuration through YAML files and environment variables.
Quick Configuration
The most important setting is your network subnet — the server defaults to 192.168.1.0/24 but your devices may be on a different subnet (e.g. 192.168.86.0/24).
Set it directly in your MCP client config using env:
Or export it before starting the server:
Using Environment Variables (simplest):
Using YAML Config File:
Configuration Options
Example Configurations
Large Network (multiple subnets):
Debug Mode:
Disable Caching:
See config.example.yaml and .env.example for complete configuration templates.
For detailed configuration guide, see CONFIGURATION.md.
MCP Tools
1. scan_network
Discover WeMo devices on your network using intelligent multi-phase scanning.
Example Prompts:
- "Scan for WeMo devices on my network"
- "Find all WeMo devices"
- "Discover devices on 192.168.1.0/24"
Example Response:
2. list_devices
List all devices cached from previous scans.
Example Prompts:
- "List all my WeMo devices"
- "Show me all devices"
- "What devices do you know about?"
Example Response:
3. get_device_status
Get current state and information for a specific device.
Example Prompts:
- "Is the office light on?"
- "What's the status of the bedroom lamp?"
- "Check the living room switch"
- "What's the brightness of office light?"
Example Response:
4. control_device
Control a WeMo device (on/off/toggle/brightness).
Example Prompts:
- "Turn on the office light"
- "Turn off the living room"
- "Toggle the bedroom lamp"
- "Set office light to 75%"
- "Dim the bedroom lamp to 50%"
Example Response:
5. rename_device
Rename a WeMo device (change its friendly name).
Example Prompts:
- "Rename Office Dimmer to Office Light"
- "Change the name of the bedroom device to Bedroom Lamp"
- "Call the living room switch 'Main Light'"
Example Response:
6. get_homekit_code
Get the HomeKit setup code for a WeMo device.
Example Prompts:
- "Get the HomeKit code for Office Light"
- "What's the HomeKit setup code for the bedroom lamp?"
- "Show me the HomeKit code for all devices"
Example Response:
Note: Not all WeMo devices support HomeKit. If a device doesn't support HomeKit, you'll get an error message.
[HomeKit code retrieval step 1]
[HomeKit code retrieval step 2]
7. get_cache_info
Get information about the persistent device cache.
Example Prompts:
- "Show me cache information"
- "Is the device cache expired?"
- "How many devices are cached?"
Example Response:
8. clear_cache
Clear the persistent device cache to force a fresh scan.
Example Prompts:
- "Clear the device cache"
- "Reset the cache and rescan"
- "Delete cached devices"
Example Response:
Note: This clears both the persistent cache file and in-memory cache. After clearing, run scan_network to rediscover devices.
9. get_configuration
View current server configuration settings.
Example Prompts:
- "Show me the server configuration"
- "What are the current settings?"
- "Display configuration"
Example Response:
Note: Shows all configuration including defaults and environment variable overrides. Use environment variables with WEMO_MCP_ prefix to customize.
MCP Capabilities
Beyond tools, this server exposes the full suite of MCP primitives.
Resources
Subscribe to live device data without calling a tool:
Clients that support MCP Resources (VS Code, MCP Inspector) can read these directly.
Prompts
Four built-in guided prompts available via / slash commands in supporting clients:
All four prompts surfaced as /mcp.wemo.* slash commands in VS Code
Elicitations
The server proactively asks for missing information rather than failing silently:
scan_network— if no custom subnet is configured (default192.168.1.0/24), asks which subnet to scan before proceedingcontrol_device— if a device name isn't found in cache, presents closest matches and asks which device was intended
[MCP elicitation prompting for subnet]
Elicitation in action — server asks for the subnet rather than scanning the wrong network silently
Client Support Matrix
How It Works
Multi-Phase Discovery
The server uses a three-phase discovery process optimized for reliability:
-
Phase 1 - UPnP/SSDP Discovery (Primary)
- Multicast discovery finds all responsive devices (~12s)
- Most reliable method, finds devices that don't respond to port probes
- Uses pywemo's built-in discovery mechanism
-
Phase 2 - Network Port Scanning (Backup)
- Parallel probing of WeMo ports (49152-49155) across subnet
- 60 concurrent workers for fast scanning (~10s for 254 IPs)
- Catches devices missed by UPnP
-
Phase 3 - Device Verification (Backup)
- HTTP verification of active IPs via /setup.xml
- Parallel verification with 60 workers
- Validates and extracts device information
This approach achieves 100% device discovery reliability while maintaining fast scan times (23-30 seconds for complete networks).
Local Control Signal Flow
All device commands travel exclusively over your local network — no cloud hop required at any stage.
Voice path (Google Home + WeMo):
MCP path (AI assistant + this server):
Both paths use local protocols only after the initial voice recognition (Google Cloud handles speech-to-text; Belkin's cloud is never involved).
Feature Comparison
MCP Server vs wemo-ops-center
Comparison of features between this MCP server and the main wemo-ops-center project:
Legend:
- ✅ Implemented - Feature is available
- ❌ Not planned - Feature conflicts with MCP architecture or use case
- ❌ Planned - Feature could be added in future
Why some features aren't planned for MCP:
- Scheduling: Requires 24/7 background daemon polling. MCP servers are typically invoked on-demand by AI assistants, not run as persistent services.
- WiFi Provisioning: Requires changing the host PC's WiFi connection to device setup networks, which is disruptive and platform-specific.
- Maintenance Tools: Destructive operations (factory reset, etc.) better suited for dedicated GUI with confirmation dialogs.
Current MCP Coverage: 5 of 11 core features (45%) - focused on device discovery, monitoring, and control use cases that fit the MCP model.
Development
Setup
Running Tests
Using Development Version
In your MCP client config, use:
Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Run the test suite (
python tests/test_e2e.py) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - see LICENSE file for details.
Acknowledgments
- Built with Model Context Protocol SDK
- Uses pywemo for WeMo device communication
- Related to the wemo-ops-center project (desktop and server applications)
来源:README.md,提交 9f6e29e
工具
0版本历史
1- v1.4.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分