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 an intelligent home automation control service built on the MCP (Model Context Protocol). It enables any MCP-compatible AI assistant or API (such as Claude, Cursor, etc.) to interact with your Aqara smart home devices, providing natural language device control, status queries, and scene execution capabilities.
Aqara MCP Server serves as a bridge between AI assistants and the Aqara smart home platform:
device_control
) per MCP protocolYou can either download pre-built executables or build from source.
Visit the GitHub Releases page to download the latest executable for your operating system:
Simply download and extract the appropriate package for your platform.
# Clone the repository
git clone https://github.com/aqara/aqara-mcp-server.git
cd aqara-mcp-server
# Download dependencies
go mod tidy
# Build executable
go build -o aqara-mcp-server
After building, you'll have an aqara-mcp-server
executable in the current directory.
To enable MCP Server access to your Aqara account and device control, you must first complete login authorization.
Please visit the following URL to complete login authorization: 🔗 https://cdn.aqara.com/app/mcpserver/login.html
After successful login, you'll receive necessary authentication information (such as token
, region
) for use in subsequent configuration steps.
⚠️ Security Notice: Please keep your
token
information secure and do not share with others.
Configuration methods vary slightly between different MCP clients. Here's an example of how to configure Claude for Desktop to use this MCP Server:
Open Claude for Desktop Settings
Switch to the Developer tab, then click Edit Config to open the configuration file in a text editor
Add the configuration information from the "Login Success Page" to your client's configuration file claude_desktop_config.json
{
"mcpServers": {
"aqara": {
"command": "/path/to/aqara-mcp-server",
"args": ["run", "stdio"],
"env": {
"token": "your_token_here",
"region": "your_region_here"
}
}
}
}
command
: Full path to your downloaded or built aqara-mcp-server
executableargs
: Use ["run", "stdio"]
to start stdio transport modeenv
: Environment variable configuration
token
: Access token obtained from Aqara login pageregion
: Your Aqara account region (supported regions: CN, US, EU, KR, SG, RU)For other MCP protocol-compatible clients (such as ChatGPT, Cursor, etc.), configuration is similar:
token
and region
stdio
)Restart Claude for Desktop. You can then perform device control, device queries, scene execution, and other operations through natural language.
Example conversations:
MCP clients can interact with Aqara smart home devices by calling these tools.
Control smart home device states or attributes (such as power, temperature, brightness, color, color temperature, etc.).
Parameters:
endpoint_ids
(Array<Integer>, Required): List of device IDs to controlcontrol_params
(Object, Required): Control parameter object containing specific operations:
action
(String, Required): Operation to execute (e.g., "on"
, "off"
, "set"
, "up"
, "down"
, "cooler"
, "warmer"
)attribute
(String, Required): Device attribute to control (e.g., "on_off"
, "brightness"
, "color_temperature"
, "ac_mode"
)value
(String | Number, Optional): Target value (required when action is "set")unit
(String, Optional): Unit of the value (e.g., "%"
, "K"
, "℃"
)Returns: Device control operation result message
Get device list based on specified location (room) and device type (excludes real-time status information).
Parameters:
positions
(Array<String>, Optional): List of room names. Empty array queries all roomsdevice_types
(Array<String>, Optional): List of device types (e.g., "Light"
, "WindowCovering"
, "AirConditioner"
, "Button"
). Empty array queries all typesReturns: Markdown formatted device list including device names and IDs
Get current device status information (for querying real-time status like color, brightness, power state, etc.).
Parameters:
positions
(Array<String>, Optional): List of room names. Empty array queries all roomsdevice_types
(Array<String>, Optional): List of device types. Same options as device_query
. Empty array queries all typesReturns: Markdown formatted device status information
Query device historical log information.
Parameters:
endpoint_ids
(Array<Integer>, Required): List of device IDs to query history forstart_datetime
(String, Optional): Query start time in format YYYY-MM-DD HH:MM:SS
(e.g., "2023-05-16 12:00:00"
)end_datetime
(String, Optional): Query end time in format YYYY-MM-DD HH:MM:SS
attributes
(Array<String>, Optional): List of device attribute names to query (e.g., ["on_off", "brightness"]
). Queries all recorded attributes if not providedReturns: Markdown formatted device historical status information
Query all scenes under user's home, or scenes within specified rooms.
Parameters:
positions
(Array<String>, Optional): List of room names. Empty array queries entire home's scenesReturns: Markdown formatted scene information
Execute specified scenes by scene ID.
Parameters:
scenes
(Array<Integer>, Required): List of scene IDs to executeReturns: Scene execution result message
Get list of all homes under user account.
Parameters: None
Returns: Comma-separated list of home names. Returns empty string or appropriate message if no data
Switch user's current operating home. After switching, subsequent device queries, controls, and other operations will target the newly switched home.
Parameters:
home_name
(String, Required): Name of target homeReturns: Switch operation result message
Automation configuration (currently supports only scheduled or delayed device control tasks).
Parameters:
scheduled_time
(String, Required): Scheduled execution time using standard Crontab format "minute hour day month weekday"
. Examples: "30 14 * * *"
(daily at 14:30), "0 9 * * 1"
(Mondays at 9:00)endpoint_ids
(Array<Integer>, Required): List of device IDs for scheduled controlcontrol_params
(Object, Required): Device control parameters using same format as device_control
tool (including action, attribute, value, etc.)task_name
(String, Required): Name or description of this automation task (for identification and management)execution_once
(Boolean, Optional): Whether to execute only once
true
: Execute task only once at specified time (default)false
: Execute task periodically (daily, weekly, etc.)Returns: Automation configuration result message
.
├── cmd.go # Cobra CLI command definitions and program entry point (contains main function)
├── server.go # MCP server core logic, tool definitions, and request handling
├── smh.go # Aqara smart home platform API interface wrapper
├── middleware.go # Middleware: user authentication, timeout control, exception 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 documentation and image resources
│ ├── img/ # Image resources directory
│ └── *.md # Multi-language README files
├── LICENSE # MIT open source license
└── README.md # Main project documentation
cmd.go
: Cobra framework-based CLI implementation defining run stdio
and run http
startup modes and main entry functionserver.go
: MCP server core implementation responsible for tool registration, request handling, and protocol supportsmh.go
: Aqara smart home platform API wrapper layer providing device control, authentication, and multi-home supportmiddleware.go
: Request processing middleware providing authentication verification, timeout control, and exception handlingconfig.go
: Global configuration management responsible for environment variable processing and API configurationWe welcome contributions through Issues and Pull Requests!
Before submitting code, please ensure:
🌟 If this project helps you, please give us a Star!
🤝 Welcome to join our community and make smart homes smarter together!
This project is licensed under the MIT License.
Copyright (c) 2025 Aqara-Copilot
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
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 for Git repository interaction and automation.
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 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 upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
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.
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.