Feyagate

MCP Tools

MCP smart home gateway for AI agents. Multi-platform IoT device control via MCP protocol.

Install

openclaw skills install feyagate

FeyaGate Skill — MCP Smart Home Gateway for AI Agents

MCP-based multi-platform smart home gateway supporting Xiaomi, Tuya, Midea, eWeLink, Serial, and GPIO. Compatible with OpenClaw, Claude Code, Hermes, Codex, Windsurf, Copilot, 小智AI and other MCP-compatible AI agents.

Before Using Any Tool

Run this check before calling any FeyaGate MCP tool:

feyagate status
  • If status is RUNNING → proceed with tool calls.
  • If status is STOPPED or command not found → run feyagate start first. If feyagate is not installed, run pip install feyagate-skill && feyagate setup && feyagate start.

Dual API endpoints:

EndpointProtocolURL
MCP (PC proxy)Streamable HTTP JSON-RPC 2.0http://localhost:38080/mcp/http
MCP (ESP32 gateway)WebSocket / Streamable HTTPws://<gateway>:8765/mcp / http://<gateway>:8765/mcp/http
HTTP REST (ESP32 gateway)REST APIhttp://<gateway>:8080/api/v1/...

Note: The PC proxy (miloco-mcp-server) provides all gateway MCP tools plus additional extensions (camera P2P, Xiaomi auth, etc.).

Quick Start

pip install feyagate-skill       # Step 1: Install Python package
feyagate setup                   # Step 2: Download MCP server binary (~30MB)
feyagate start                   #        Start service (localhost:38080)
feyagate install-claude          # Step 3: Register with your AI agent
feyagate auth                    # Step 4: Authorize smart home platform

Other agent install commands: install-cursor, install-openclaw, install-hermes, install-codex, install-windsurf, install-copilot

Full step-by-step guide: QUICKSTART.md

Server Lifecycle (CLI)

ActionCommand
Install binaryfeyagate setup [--dir PATH]
Startfeyagate start [--port PORT]
Stopfeyagate stop
Restartfeyagate restart [--port PORT]
Statusfeyagate status
Logsfeyagate log [-n 50]
Upgradefeyagate upgrade
Auth Xiaomifeyagate auth [--status] [--code CODE]

Manual Scripts (Advanced)

ActionmacOS/LinuxWindows
Installbash scripts/install.shscripts\install.ps1
Setupbash scripts/setup.shscripts\setup.bat
Startbash scripts/start.shscripts\start.bat
Stopbash scripts/stop.shscripts\stop.bat
Verifybash scripts/verify.shscripts\verify.bat
Statusbash scripts/health_check.shscripts\health_check.bat
Custom portbash scripts/start.sh --port 9090scripts\start.bat --port 9090
Upgradebash scripts/upgrade.shpowershell -File scripts\upgrade.ps1
Check updatesbash scripts/upgrade.sh --checkpowershell -File scripts\upgrade.ps1 -Check

Cross-Platform Tools

Unified interfaces that work across all platforms. System auto-detects device platform.

ToolArgumentsReturns
device/listfilter (string[]), platform (opt)devices[] with platform field
device/specsdeviceId (string)Platform-specific spec: properties, actions
platform/statusAll platform connection/auth/sync status
gateway/infoVersion, device count, ports
scene/listplatform (string)scenes[]
scene/triggerplatform (string), sceneId (string)Trigger result

Parameter convention: device/specs uses deviceId (camelCase); platform-specific tools (xiaomi/*, tuya/*, etc.) use device_id (snake_case).

Sub-Skill Loading Guide (for AI agents)

This skill uses a modular structure. The main skill defines cross-platform tools; platform-specific tools are in sub-skill files.

Loading strategy:

  1. Always load this main SKILL.md first — it provides the core cross-platform tools and MCP endpoint info.
  2. Load sub-skills on demand based on the user's intent. Each sub-skill's trigger keywords (listed in frontmatter sub_skills) indicate when to load it.
  3. Cross-platform workflow (no sub-skill needed): device/listdevice/specs → identify platform → load corresponding sub-skill for control operations.
Sub-SkillFileWhen to LoadCovers
feyagate-xiaomiskills/xiaomi.mdXiaomi/Mi Home devices, cameras, XiaoAI speakersMIOT device control, OAuth auth, camera P2P, XiaoAI TTS/music
feyagate-tuyaskills/tuya.mdTuya/Smart Life devicesDP property read/write, QR code auth
feyagate-mideaskills/midea.mdMidea/美的 appliancesAC/appliance control, account auth
feyagate-ewelinkskills/ewelink.mdeWeLink/Sonoff devicesSwitch control, multi-channel
feyagate-automationskills/automation.mdScheduling, automation, rooms, memorySchedule, trigger engine, room, memory, skill system
feyagate-extensionskills/extension.mdSerial, GPIO, license, configSerial, GPIO, Xiaozhi AI, license, config, stats

License System

  • Free edition: Xiaomi platform only (device control, cameras, XiaoAI, MCP proxy)
  • Licensed edition: All platforms (Xiaomi + Tuya + Midea + eWeLink)
  • tuya/set_property, midea/set_property, ewelink/set_property return license_required on free edition
  • get_properties and all other tools work without license

Configuration

config/config.yaml:

server:
  http_port: 38080
  ws_port: 8765
  bind_address: "0.0.0.0"
auth:
  cloud_server: "cn"      # cn / de / sg / us / ru / i2
  token_file: "data/auth_token.json"
camera:
  frame_interval: 500
  buffer_max_size: 20
  buffer_ttl: 300
  jpeg_quality: 90
tuya:
  token_file: "data/tuya_token.json"
midea:
  token_file: "data/midea_token.json"
ewelink:
  token_file: "data/ewelink_token.json"
xiaozhi:
  endpoint: ""            # ws:// or wss:// (empty = disabled)

Troubleshooting

SymptomFix
command not found: feyagatepip install feyagate-skill
FeyaGate not installedfeyagate setup
connection refusedfeyagate start
authorized: falsefeyagate auth (Xiaomi) or use platform-specific auth tool
cannot open shared object filefeyagate upgrade or re-run feyagate setup
Tool not foundCheck tool name (see tools/list output)
key 'device_id' not foundPlatform tools use device_id; cross-platform device/specs uses deviceId
license_required errorSet license key via license/set tool

Full API reference: FeyaGate_MCP_API.md, FeyaGate_HTTP_API.md