smarthome-mcp
Click on "Install 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., "@smarthome-mcpTurn on the living room lights and check the bedroom temperature."
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.
🏠 MCPControler
基于 Model Context Protocol (MCP) 的智能家居多智能体控制系统
让任何 AI 智能体(Claude Desktop、TRAE、Cursor……)都能感知环境、控制设备
📖 简介
MultiAgentSystem 是一个 MCP 服务器。它把智能家居设备封装成一组标准化的「工具」,任何兼容 MCP 协议的智能体客户端接入后,大模型即可自主决定何时读传感器、何时控制设备——无需为每个客户端单独编写集成代码。
🌡️ 感知:读取房间温度传感器数据
💡 执行:控制房间灯光开关
🔌 协议标准:基于 MCP 2.x,一次实现,处处接入
🪶 零样板代码:工具的 JSON Schema 由类型提示与 docstring 自动生成
Related MCP server: Home Assistant MCP Server
🏗️ 架构
flowchart LR
subgraph Agents["🤖 智能体客户端(任选其一)"]
A1["Claude Desktop"]
A2["TRAE"]
A3["Cursor / 自定义 Agent"]
end
subgraph MAS["MultiAgentSystem · MCP 服务器"]
direction TB
T1["🌡️ get_temperature<br/>感知环境"]
T2["💡 control_light<br/>执行控制"]
end
subgraph Home["🏠 智能家居设备层"]
D1["温度传感器"]
D2["智能灯"]
end
A1 & A2 & A3 <-->|"MCP 协议(stdio)"| MAS
T1 -->|"读取数据"| D1
T2 -->|"下发指令"| D2🛠️ 工具一览
工具 | 功能 | 参数 |
| 获取指定房间的当前温度 |
|
| 打开 / 关闭指定房间的灯 |
|
🚀 快速开始
1. 安装
git clone https://github.com/Ada-Junk/MultiAgentSystem.git
cd MultiAgentSystem
# 创建虚拟环境并安装依赖(二选一)
uv venv && uv pip install -r requirements.txt # 方式一:uv
python -m venv .venv # 方式二:pip
pip install -r requirements.txt # (Windows 先执行 .venv\Scripts\activate)2. 运行服务器
python smarthome_mcp.py # stdio 传输
# 或使用官方 CLI
mcp run smarthome_mcp.py服务器以 stdio 方式运行,本身没有可见输出——它等待 MCP 客户端的连接。
3. 接入智能体客户端
在任意 MCP 客户端的配置文件中注册本服务器(以 Claude Desktop / TRAE 为例):
{
"mcpServers": {
"smarthome-mcp": {
"command": "python",
"args": ["D:/path/to/MultiAgentSystem/smarthome_mcp.py"]
}
}
}重启客户端后,即可用自然语言指挥智能体:
🧑 「客厅有点暗,顺便看下卧室温度」
🤖 调用
get_temperature("bedroom")→ 传感器返回 22.0°C 🤖 调用control_light("living_room", "on")→ 已打开客厅的灯
🧩 工作原理
MCP 2.x 的高阶 API 屏蔽了协议细节——只需用装饰器注册普通 Python 函数:
mcp = MCPServer("smarthome-mcp")
@mcp.tool()
def control_light(room: str, state: str) -> str:
"""打开或关闭指定房间的灯"""
...框架会自动完成:
解析函数签名 → 生成工具的 JSON Schema(参数名、类型、描述)
解析 docstring → 生成大模型可读的工具说明
处理 JSON-RPC 消息编解码与 stdio 传输
因此新增一个设备能力,只需要再写一个函数。
🔧 扩展新设备
以「窗帘控制」为例,在 smarthome_mcp.py 中追加:
@mcp.tool()
def control_curtain(room: str, position: int) -> str:
"""设置指定房间窗帘的开合程度
Args:
room: 房间名,例如 'living_room'
position: 开合百分比,0(全关)到 100(全开)
"""
return f"操作成功: {room} 的窗帘已调整到 {position}%。"保存后重启客户端即可,无需任何其他配置。
📁 项目结构
MultiAgentSystem/
├── smarthome_mcp.py # MCP 服务器:工具定义与注册
├── requirements.txt # Python 依赖
├── .gitignore # 忽略虚拟环境、缓存等运行产物
├── LICENSE # MIT 协议
└── README.md📄 许可证
本项目基于 MIT License 开源,欢迎自由使用与二次开发。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Chat with your Zihin.ai agents, list them and load platform skills from any MCP client.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Hosted MCP server for live public-data APIs and Skills for AI agents.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control and monitor Home Assistant smart home devices through natural language interactions. Supports device control, entity state monitoring, history access, and automation generation with both MCP protocol and standalone HTTP REST API modes.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Home Assistant smart home devices via MCP, with zero external dependencies. Supports calling services, getting states, and looking up service parameters.51MIT
- AlicenseNot gradedqualityCmaintenanceEnables natural language control of Loxone smart home systems, including lighting, audio, climate, and environmental monitoring, through MCP-compatible clients.292AGPL 3.0
- FlicenseNot gradedqualityFmaintenanceEnables AI assistants to control and query smart home devices through Homey Pro via an HTTP-based MCP server.2
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ada-Junk/MCPControler'
If you have feedback or need assistance with the MCP directory API, please join our Discord server