Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Aqara Mcp Server

    Aqara's official MCP Server

    20 stars
    Go
    Updated Oct 19, 2025

    Table of Contents

    • Table of Contents
    • Features
    • How It Works
    • Quick Start
    • Prerequisites
    • Step 1: Account Authentication
    • Step 2: How to Use
    • Option A: Remote MCP Server (Recommended)
    • Option B: Local MCP Server
    • Step 3: Verification
    • API Reference
    • Core Tools Overview
    • Device Control API
    • device_control
    • Device Query API
    • device_query
    • device_status_query
    • device_log_query
    • Scene Management API
    • get_scenes
    • run_scenes
    • Home Management API
    • get_homes
    • switch_home
    • Automation Configuration API
    • automation_config
    • Project Structure
    • Directory Structure
    • Core File Descriptions
    • Development & Contribution
    • Development Environment Setup
    • Code Quality Standards
    • Contribution Guidelines
    • License

    Table of Contents

    • Table of Contents
    • Features
    • How It Works
    • Quick Start
    • Prerequisites
    • Step 1: Account Authentication
    • Step 2: How to Use
    • Option A: Remote MCP Server (Recommended)
    • Option B: Local MCP Server
    • Step 3: Verification
    • API Reference
    • Core Tools Overview
    • Device Control API
    • device_control
    • Device Query API
    • device_query
    • device_status_query
    • device_log_query
    • Scene Management API
    • get_scenes
    • run_scenes
    • Home Management API
    • get_homes
    • switch_home
    • Automation Configuration API
    • automation_config
    • Project Structure
    • Directory Structure
    • Core File Descriptions
    • Development & Contribution
    • Development Environment Setup
    • Code Quality Standards
    • Contribution Guidelines
    • License

    Documentation

    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.

    Table of Contents

    • Table of Contents
    • Features
    • How It Works
    • Quick Start
    • Prerequisites
    • Step 1: Account Authentication
    • Step 2: How to Use
    • Option A: Remote MCP Server (Recommended)
    • Option B: Local MCP Server
    • Step 3: Verification
    • API Reference
    • Core Tools Overview
    • Device Control API
    • [device_control](#device_control)
    • Device Query API
    • [device_query](#device_query)
    • [device_status_query](#device_status_query)
    • [device_log_query](#device_log_query)
    • Scene Management API
    • [get_scenes](#get_scenes)
    • [run_scenes](#run_scenes)
    • Home Management API
    • [get_homes](#get_homes)
    • [switch_home](#switch_home)
    • Automation Configuration API
    • [automation_config](#automation_config)
    • Project Structure
    • Directory Structure
    • Core File Descriptions
    • Development \& Contribution
    • Development Environment Setup
    • Code Quality Standards
    • Contribution Guidelines
    • License

    Features

    • ✨ Comprehensive Device Control: Fine-grained control over various attributes of Aqara smart devices, including on/off, brightness, color temperature, and modes.
    • 🔍 Flexible Device Query: Ability to query device lists and their detailed statuses by room or device type.
    • 🎬 Smart Scene Management: Supports querying and executing user-predefined smart home scenes.
    • 📈 Device History: Query the historical status change records of devices within a specified time range.
    • ⏰ Automation Configuration: Supports configuring scheduled or delayed device control tasks.
    • 🏠 Multi-Home Support: Supports querying and switching between different homes under a user's account.
    • 🔌 MCP Protocol Compatibility: Fully compliant with the MCP specification, allowing for easy integration with various AI assistants.
    • 🔐 Secure Authentication: Utilizes a login authorization + signature-based security mechanism to protect user data and device security.
    • 🌐 Cross-Platform: Developed in Go, can be compiled into executables for multiple platforms.
    • 🔧 Easily Extensible: Modular design allows for the convenient addition of new tools and features.

    How It Works

    Aqara MCP Server acts as a bridge between AI assistants and the Aqara smart home platform:

    mermaid
    graph LR
        A[AI Assistant - MCP Host] --> B[MCP Client]
        B --> C[Aqara MCP Server]
        C --> D[Aqara Cloud API]
        D --> E[AIOT Devices]

    1. AI Assistant: The user issues a command through an AI assistant (e.g., "Turn on the living room light").

    2. MCP Client: Parses the user's command and calls the corresponding tool provided by the Aqara MCP Server (e.g., device_control) according to the MCP protocol.

    3. Aqara MCP Server (This Project): Receives the request from the client, communicates with the Aqara Cloud API using the configured Aqara credentials, and executes the actual device operation or data query.

    4. Response Flow: The Aqara Cloud API returns the result, which is passed back to the MCP client via the Aqara MCP Server and finally presented to the user.

    ---

    Quick Start

    Prerequisites

    • Aqara Account with registered smart devices.
    • MCP-enabled Client (e.g., Claude for Desktop, Cursor).
    • Go 1.24+ (only required for local deployment from source).

    Step 1: Account Authentication

    Regardless of the deployment mode, you first need to obtain Aqara authentication credentials:

    1. Visit the Login Page:

    🔗 https://cdn.aqara.com/app/mcpserver/login.html

    2. Complete the Login Process:

    • Log in with your Aqara credentials.
    • Obtain the api_key and base_url.

    3. Store Credentials Securely:

    ⚠️ Please keep your api_key information safe and do not disclose it to others.

    Configuration Example

    Step 2: How to Use

    Choose the deployment method that suits your needs:

    Option A: Remote MCP Server (Recommended)

    Suitable for: Users who want to get started quickly without local environment setup.

    Advantages:

    • ✅ Ready to Use: No need to download or compile; configure and use directly.
    • ✅ Automatic Updates: The server is automatically maintained and updated.
    • ✅ High Availability: Professional operations ensure service stability.
    • ✅ Multi-Platform Compatibility: No operating system restrictions.

    Configure MCP Client:

    1. Open Settings:

    • Launch Cursor.

    Open Setting

    2. Add Server Configuration:

    json
    {
          "mcpServers": {
            "aqara": {
              "type": "http",
              "url": "https://[mcp-server-domain]/echo/mcp",  // base_url
              "headers": {
                "Authorization": "Bearer [YOUR_API_KEY_HERE]"  // api_key
              }
            }
          }
        }

    3. Restart the Application:

    • Restart Cursor for the changes to take effect.

    Option B: Local MCP Server

    Suitable for: Users who require data sovereignty, custom configurations, or offline use.

    Advantages:

    • ✅ Data Privacy: All data is processed locally.
    • ✅ Full Control: Customizable configuration and extensible features.
    • ✅ Offline Availability: Basic functions are not affected by network interruptions.
    • ✅ No Restrictions: Not limited by cloud services.

    Installation Steps:

    1. 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

    bash
    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

    2. Set Environment Variables:

    bash
    export aqara_api_key="your_api_key_here"
        export aqara_base_url="your_base_url_here"

    Configure MCP Client (e.g., Claude for Desktop):

    1. Open Settings:

    • Launch Claude for Desktop.
    • Navigate to: Settings → Developer.

    Claude Open Setting

    2. Edit Configuration File:

    • Click "Edit Configuration".

    Claude Edit Configuration

    3. Add Server Configuration (claude_desktop_config.json):

    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"
              }
            }
          }
        }

    4. Restart the Application:

    • Restart Claude for Desktop for the changes to take effect.

    Step 3: Verification

    Use the following test commands to verify that the configuration is successful:

    code
    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!

    ---

    API Reference

    Core Tools Overview

    Tool CategoryToolDescription
    Device Controldevice_controlDirect device operations
    Device Querydevice_query, device_status_query, device_log_queryComprehensive device information
    Scene Managementget_scenes, run_scenesAutomated scene control
    Home Managementget_homes, switch_homeMulti-home environment support
    Automationautomation_configScheduled task configuration

    Device Control API

    device_control

    Controls the state or attributes of smart home devices (e.g., on/off, temperature, brightness, color, color temperature).

    Parameters:

    • endpoint_ids _(Array\, 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 Query API

    device_query

    Retrieves 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\, optional)_: A list of room names. An empty array queries all rooms.
    • device_types _(Array\, 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_query

    Gets the current status information of devices (used to query real-time status like color, brightness, on/off).

    Parameters:

    • positions _(Array\, optional)_: A list of room names. An empty array queries all rooms.
    • device_types _(Array\, 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_query

    Queries the historical log information of devices.

    Parameters:

    • endpoint_ids _(Array\, 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\, 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.

    Scene Management API

    get_scenes

    Queries all scenes in a user's home or scenes in specified rooms.

    Parameters:

    • positions _(Array\, optional)_: A list of room names. An empty array queries scenes for the entire home.

    Returns: Markdown-formatted scene information.

    run_scenes

    Executes specified scenes by their scene IDs.

    Parameters:

    • scenes _(Array\, required)_: A list of scene IDs to be executed.

    Returns: A message indicating the result of the scene execution.

    Home Management API

    get_homes

    Gets 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_home

    Switches 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 Configuration API

    automation_config

    Configures 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\, 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.

    Project Structure

    Directory Structure

    text
    .
    ├── 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

    Core File Descriptions

    • **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.

    Development & Contribution

    Development Environment Setup

    bash
    # 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

    Code Quality Standards

    • Go Language: Follows official Go coding standards.
    • Documentation: Comprehensive API documentation.
    • Testing: Minimum 80% code coverage.
    • Security: Regular security audits.

    Contribution Guidelines

    1. Fork the repository

    2. Create a feature branch: git checkout -b feature/amazing-feature

    3. Commit your changes: git commit -m 'Add some amazing feature'

    4. Push to the branch: git push origin feature/amazing-feature

    5. Open a Pull Request

    ---

    License

    This project is licensed under the MIT License - see the LICENSE file for details.

    ---

    Copyright © 2025 Aqara-Copilot. All rights reserved.

    Similar MCP

    Based on tags & features

    • MC

      Mcp Cyclops

      Go·
      29
    • OC

      Ocireg Mcp

      Go·
      11
    • MC

      Mcpjungle

      Go·
      617
    • AN

      Anyquery

      Go·
      1.4k

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • MC

      Mcp Cyclops

      Go·
      29
    • OC

      Ocireg Mcp

      Go·
      11
    • MC

      Mcpjungle

      Go·
      617
    • AN

      Anyquery

      Go·
      1.4k

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k