by aqara
Provides an intelligent home automation control service that bridges MCP‑compatible AI assistants with Aqara smart home devices, enabling natural language device control, status queries, scene execution, and scheduled automation.
Enables AI assistants such as Claude, Cursor, or any MCP‑compatible client to interact with Aqara smart home devices through natural language. The server receives MCP tool calls, translates them into Aqara Cloud API requests, and returns results back to the client.
git clone https://github.com/aqara/aqara-mcp-server.git
cd aqara-mcp-server
go mod tidy
go build -o aqara-mcp-server
https://cdn.aqara.com/app/mcpserver/login.html, log in, and copy the generated token and region.{
"mcpServers": {
"aqara": {
"command": "/path/to/aqara-mcp-server",
"args": ["run", "stdio"],
"env": {
"token": "your_token_here",
"region": "your_region_here"
}
}
}
}
Adjust the path and environment values, then restart the client.run stdio (or future run http) mode. The client will now be able to call tools such as device_control, device_query, run_scenes, etc.Q: Which AI assistants can I use? A: Any client that implements the MCP protocol, e.g., Claude for Desktop, Cursor, or custom MCP‑compatible tools.
Q: Do I need to run the server continuously? A: Yes, the server must be running while the client interacts with it. It can run as a background process or service.
Q: How is my token protected? A: The token is passed as an environment variable and never stored in source code. Keep it secret and rotate if compromised.
Q: Can I use HTTP instead of stdio?
A: HTTP mode is planned for a future release. Currently, run stdio is the supported transport.
Q: Is there support for non‑Chinese regions?
A: Supported regions include CN, US, EU, KR, SG, and RU – set the appropriate region env variable.
English | 中文 | 繁體中文 | Français | 한국어 | Español | 日本語 | Deutsch | Italiano
Aqara MCP Server is a smart home automation control service built on the Model Context Protocol (MCP). This platform enables seamless integration between AI assistants (like Claude, Cursor, etc.) and the Aqara smart home ecosystem.
Aqara MCP Server acts as a bridge between AI assistants and the Aqara smart home platform:
device_control) according to the MCP protocol.Regardless of the deployment mode, you first need to obtain Aqara authentication credentials:
Visit the Login Page: 🔗 https://cdn.aqara.com/app/mcpserver/login.html
Complete the Login Process:
api_key and base_url.Store Credentials Securely:
⚠️ Please keep your
api_keyinformation safe and do not disclose it to others.

Choose the deployment method that suits your needs:
Suitable for: Users who want to get started quickly without local environment setup.
Advantages:
Configure MCP Client:
Open Settings:

Add Server Configuration:
{
"mcpServers": {
"aqara": {
"type": "http",
"url": "https://[mcp-server-domain]/echo/mcp", // base_url
"headers": {
"Authorization": "Bearer [YOUR_API_KEY_HERE]" // api_key
}
}
}
}
Restart the Application:
Suitable for: Users who require data sovereignty, custom configurations, or offline use.
Advantages:
Installation Steps:
Download the Program (choose one):
Recommended: Download Pre-compiled Version
Visit GitHub Releases to download the latest version for your operating system.
Alternatively: Build from Source
git clone https://github.com/aqara/aqara-mcp-server.git
cd aqara-mcp-server
go mod tidy
go build -ldflags="-s -w" -o aqara-mcp-server
Set Environment Variables:
export aqara_api_key="your_api_key_here"
export aqara_base_url="your_base_url_here"
Configure MCP Client (e.g., Claude for Desktop):
Open Settings:

Edit Configuration File:

Add Server Configuration (claude_desktop_config.json):
{
"mcpServers": {
"aqara": {
"command": "/path/to/aqara-mcp-server",
"args": ["run", "stdio"],
"env": {
"aqara_api_key": "your_api_key_here",
"aqara_base_url": "your_base_url_here"
}
}
}
}
Restart the Application:
Use the following test commands to verify that the configuration is successful:
User: "Show all devices in my home"
Assistant: [Queries device list via MCP]
User: "Turn on the living room light"
Assistant: [Executes device control via MCP]
User: "Run the evening scene"
Assistant: [Executes scene via MCP]
If you see a message like "🔧 Connected to Aqara MCP Server," the configuration is successful!
| Tool Category | Tool | Description |
|---|---|---|
| Device Control | device_control |
Direct device operations |
| Device Query | device_query, device_status_query, device_log_query |
Comprehensive device information |
| Scene Management | get_scenes, run_scenes |
Automated scene control |
| Home Management | get_homes, switch_home |
Multi-home environment support |
| Automation | automation_config |
Scheduled task configuration |
device_controlControls the state or attributes of smart home devices (e.g., on/off, temperature, brightness, color, color temperature).
Parameters:
endpoint_ids (Array<Integer>, required): A list of device IDs to be controlled.control_params (Object, required): A control parameter object containing specific actions:
action (String, required): The action to perform (e.g., "on", "off", "set", "up", "down", "cooler", "warmer").attribute (String, required): The device attribute to control (e.g., "on_off", "brightness", "color_temperature", "ac_mode").value (String | Number, optional): The target value (required when action is "set").unit (String, optional): The unit of the value (e.g., "%", "K", "℃").Returns: A message indicating the result of the device control operation.
device_queryRetrieves a comprehensive list of devices based on specified locations (rooms) and device types, with support for filtering (does not include real-time status information).
Parameters:
positions (Array<String>, optional): A list of room names. An empty array queries all rooms.device_types (Array<String>, optional): A list of device types (e.g., "Light", "WindowCovering", "AirConditioner", "Button"). An empty array queries all types.Returns: A Markdown-formatted list of devices, including device names and IDs.
device_status_queryGets the current status information of devices (used to query real-time status like color, brightness, on/off).
Parameters:
positions (Array<String>, optional): A list of room names. An empty array queries all rooms.device_types (Array<String>, optional): A list of device types. Same options as device_query. An empty array queries all types.Returns: Markdown-formatted device status information.
device_log_queryQueries the historical log information of devices.
Parameters:
endpoint_ids (Array<Integer>, required): A list of device IDs for which to query history.start_datetime (String, optional): The query start time in YYYY-MM-DD HH:MM:SS format (e.g., "2023-05-16 12:00:00").end_datetime (String, optional): The query end time in YYYY-MM-DD HH:MM:SS format.attributes (Array<String>, optional): A list of device attribute names to query (e.g., ["on_off", "brightness"]). If not provided, all logged attributes are queried.Returns: Markdown-formatted historical device status information.
get_scenesQueries all scenes in a user's home or scenes in specified rooms.
Parameters:
positions (Array<String>, optional): A list of room names. An empty array queries scenes for the entire home.Returns: Markdown-formatted scene information.
run_scenesExecutes specified scenes by their scene IDs.
Parameters:
scenes (Array<Integer>, required): A list of scene IDs to be executed.Returns: A message indicating the result of the scene execution.
get_homesGets a list of all homes under the user's account.
Parameters: None
Returns: A comma-separated list of home names. Returns an empty string or a corresponding message if no data is available.
switch_homeSwitches the user's currently active home. After switching, subsequent device queries, controls, etc., will target the newly switched home.
Parameters:
home_name (String, required): The name of the target home.Returns: A message indicating the result of the switch operation.
automation_configConfigures automation (currently only supports scheduled or delayed device control tasks).
Parameters:
scheduled_time (String, required): The scheduled execution time in standard Crontab format "min hour day month week". E.g., "30 14 * * *" (execute at 14:30 every day), "0 9 * * 1" (execute at 9:00 every Monday).endpoint_ids (Array<Integer>, required): A list of device IDs to be controlled on a schedule.control_params (Object, required): Device control parameters, in the same format as the device_control tool (including action, attribute, value, etc.).task_name (String, required): The name or description of this automation task (for identification and management).execution_once (Boolean, optional): Whether to execute only once.
true: Executes the task only once at the specified time (default).false: Executes the task periodically (e.g., daily, weekly).Returns: A message indicating the result of the automation configuration.
.
├── cmd.go # Cobra CLI command definitions and program entry point (contains main function)
├── server.go # Core MCP server logic, tool definitions, and request handling
├── smh.go # Aqara smart home platform API interface wrapper
├── middleware.go # Middleware: user authentication, timeout control, panic recovery
├── config.go # Global configuration management and environment variable handling
├── go.mod # Go module dependency management file
├── go.sum # Go module dependency checksum file
├── readme/ # README documents and image resources
│ ├── img/ # Image resource directory
│ └── *.md # Multi-language README files
├── LICENSE # MIT open source license
└── README.md # Main project document
cmd.go: CLI implementation based on the Cobra framework, defining run stdio and run http start modes and the main entry function.server.go: Core MCP server implementation, responsible for tool registration, request handling, and protocol support.smh.go: Aqara smart home platform API wrapper layer, providing device control, authentication, and multi-home support.middleware.go: Request handling middleware, providing authentication validation, timeout control, and exception handling.config.go: Global configuration management, responsible for handling environment variables and API configuration.# Clone the repository
git clone https://github.com/aqara/aqara-mcp-server.git
cd aqara-mcp-server
# Install dependencies
go mod tidy
# Run tests
go test ./...
# Optimized build
go build -ldflags="-s -w" -o aqara-mcp-server
git checkout -b feature/amazing-featuregit commit -m 'Add some amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.
Copyright © 2025 Aqara-Copilot. All rights reserved.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.