esp-rainmaker-mcp

esp-rainmaker-mcp

MCP server enabling AI and applications to control ESP RainMaker IoT devices via natural language and Python.

8
Stars
5
Forks
8
Watchers
1
Issues
ESP RainMaker MCP Server is a Model Context Protocol (MCP) server wrapper around the esp-rainmaker-cli Python library. It enables MCP-compatible clients such as LLMs and specialized AI applications to interact with and control ESP RainMaker IoT devices using natural language. The server runs locally, leveraging official RainMaker cloud APIs through authenticated CLI sessions, and provides tools for managing device parameters, schedules, and groups. Integration is seamless across multiple clients including Cursor, Claude Desktop, Windsurf, and Gemini CLI, making IoT management intuitive and accessible.

Key Features

Provides a Model Context Protocol (MCP) server interface to ESP RainMaker devices
Enables natural language IoT device control through LLMs and AI applications
Uses official ESP RainMaker cloud APIs securely via CLI authentication
Supports device status checks and parameter adjustments
Facilitates node discovery and detailed device information retrieval
Offers schedule creation, editing, and management for devices
Allows group (home/room) creation and device grouping
Integrates seamlessly with MCP clients such as Cursor, Claude Desktop, Windsurf, and Gemini CLI
Stores credentials locally for enhanced user security
Provides Python interface and configuration via uv package manager

Use Cases

Controlling ESP RainMaker IoT devices using AI chat interfaces
Automating home devices with natural language commands through integrated MCP clients
Monitoring device status and fetching detailed device information remotely
Batch updating device parameters or managing multiple devices simultaneously
Managing and organizing devices into homes and rooms for streamlined automation
Scheduling device operations like on/off times via AI-driven interfaces
Integrating ESP32 device control into custom software or scripting workflows
Providing remote support or device configuration assistance through AI tools
Enabling secure, local, and cloud-backed IoT device administration for technical users
Bridging legacy or non-MCP-aware tools into modern AI-centric IoT control architectures

README

ESP RainMaker MCP Server

This project provides a Model Context Protocol (MCP) server wrapper around the esp-rainmaker-cli Python library. It allows MCP-compatible clients (like LLMs or applications such as Cursor, Claude Desktop, and Windsurf) to interact with your ESP RainMaker devices using the official CLI.

Introduction to Model Context Protocol (MCP)

The Model Context Protocol (MCP) is a standardized framework that enables AI systems to interact with external tools, data sources, and services in a unified manner. Introduced by Anthropic and adopted by major AI organizations, MCP acts as a universal interface, much like USB-C for hardware, allowing seamless integration across different platforms.

Key Benefits of MCP in ESP RainMaker

  • Unified Interaction: MCP allows AI models to access and control IoT devices using natural language prompts, making interactions more intuitive and accessible.
  • Real-time Control: With MCP, users can execute actions such as turning devices on/off, adjusting settings, and managing schedules directly through AI interfaces.
  • Local Server, Cloud-Backed Control: The ESP RainMaker MCP server runs locally and stores credentials on your machine. However, device management actions are performed via the official ESP RainMaker cloud APIs through the esp-rainmaker-cli.

By integrating MCP, the ESP RainMaker platform enhances its capabilities, allowing tools like Claude, Cursor, Windsurf, and Gemini CLI to manage IoT devices efficiently and securely.

Prerequisites

  • Python: Version 3.10 or higher
  • uv: The uv Python package manager. Install from Astral's uv documentation.
  • ESP RainMaker CLI Login: You must have successfully logged into ESP RainMaker using the standard esp-rainmaker-cli login command in your terminal at least once. This server relies on the credentials saved by that process.
  • RainMaker Nodes added into your account since onboarding isn't supported by the MCP server.

Installation & Setup

  1. Clone the Repository:

    bash
    git clone https://github.com/espressif/esp-rainmaker-mcp.git
    cd esp-rainmaker-mcp
    
  2. Install Dependencies using uv: This command installs esp-rainmaker-cli, mcp[cli], and any other dependencies listed in pyproject.toml into a virtual environment managed by uv.

    bash
    uv sync
    

    (This assumes uv is installed)

  3. Login to ESP Rainmaker using esp-rainmaker-cli

    bash
    uv run esp-rainmaker-cli login
    

[!NOTE] Direct login via username/password within MCP is not supported for security reasons. Please use the standard CLI login flow first.

Client Configuration

To add this project as an MCP server in supported MCP clients (Cursor, Claude Desktop, Windsurf, and Gemini CLI), you'll need to add the same JSON configuration to each client's config file. The configuration is identical across all clients:

MCP Server Configuration (All Clients)

Use the following JSON configuration for all MCP clients:

json
{
   "mcpServers": {
      "ESP-RainMaker-MCP": {
         "command": "uv",
         "args": [
            "run",
            "--with",
            "esp-rainmaker-cli",
            "--with",
            "mcp[cli]",
            "mcp",
            "run",
            "<absolute_path_to_repo>/server.py"
         ]
      }
   }
}

[!IMPORTANT] Replace <absolute_path_to_repo>/server.py with the actual absolute path to the server.py file within the cloned esp-rainmaker-mcp directory on your system.

Cursor MCP Server Setup

  1. Open Cursor and click on the settings (gear icon) at the top right.

  2. Navigate to "Tools & Integrations" from the settings menu.

  3. Click on "MCP Tools" in the integrations section.

  4. Click on "New MCP Server" to add a new server.

  5. This will open the mcp.json file. Add the JSON configuration shown above.

Claude Desktop MCP Server Setup

  1. Open Claude Desktop and go to Settings -> Developer -> Edit Config.

  2. This will open the configuration file (claude_desktop_config.json). Add the JSON configuration shown above.

  3. Save the changes and restart Claude Desktop to apply the new settings.

Windsurf MCP Server Setup

  1. Open Windsurf and look for the hammer-type icon under the chat text input area.

  2. Click on the hammer icon and select "Configure" from the options. This will open the plugins window.

  3. Click on "View raw config" which will show you the ~/.codium/windsurf/mcp_config.json file.

  4. Add the JSON configuration shown above to the file.

  5. Save the changes and click on "Refresh" under the chat text window to load the ESP RainMaker MCP tools.

Gemini CLI MCP Server Setup

  1. Locate your Gemini CLI settings file. On macOS, this is typically at ~/.gemini/settings.json.
  2. Open the settings.json file in your preferred text editor.
  3. Add the JSON configuration shown above to the mcpServers section of the file. If the section does not exist, create it as shown in the example.
  4. Save the file and restart Gemini CLI if it is running.

[!NOTE] The configuration for all four applications (Cursor, Claude Desktop, Windsurf, and Gemini CLI) is the same, so you can use the same JSON structure for all of them.

[!NOTE] The --with arguments ensure uv includes the necessary dependencies when running the mcp run command.

How it Works

This server acts as a bridge. It uses the mcp library to handle the Model Context Protocol communication. When a tool is called:

  1. It uses functions from the installed esp-rainmaker-cli library.
  2. The library functions read locally stored authentication tokens.
  3. It makes the necessary API calls to the ESP RainMaker cloud.
  4. It returns the results (or errors) back through the MCP protocol.

Available Tools

This MCP server exposes the following tools for interacting with ESP RainMaker:

Authentication & Configuration

  • login_instructions():
    • Provides instructions (formatted with Markdown) on how to log in using the standard esp-rainmaker-cli login command in your terminal. This server relies on the external CLI's browser-based login flow to securely store credentials. Rendering as Markdown depends on the MCP client's capabilities.
  • check_login_status():
    • Checks if a valid login session exists based on credentials stored locally by esp-rainmaker-cli. Confirms if the server can communicate with the ESP RainMaker backend.

Node Management

  • get_nodes():
    • Lists all node IDs associated with the logged-in user.
  • get_node_details(node_id: str = None, fields: str = None, name: str = None, type_: str = None):
    • Get detailed information for nodes including config, status, and params.
    • Supports filtering and field selection:
      • fields: comma-separated list of fields to include (e.g. "node_id,name,type,config,params,status.connectivity,fw_version,mapping_timestamp")
      • name: substring match (user-visible name from params)
      • type_: substring match (device type)
      • node_id: single node ID (for one node) or None (for all)
    • Returns a dict (single node) or list of dicts (all nodes).
    • Example:
      python
      get_node_details(ctx, fields="node_id,name,type")
      
  • get_node_status(node_id: str):
    • Get the online/offline connectivity status for a specific node ID.
  • get_params(node_id: str):
    • Get current parameter values for a device.
  • set_params(node_id: str, params_dict: dict):
    • Set parameters for one or more devices.
    • node_id: Single ID or comma-separated list (e.g., "light1,light2")
    • params_dict: Parameters to set, e.g., {"Light": {"Power": true}}

Schedule Management

  • get_schedules(node_id: str):
    • Get schedules for a device.
  • set_schedule(node_id: str, operation: str, ...):
    • Manage device schedules.
    • operation: "add", "edit", "remove", "enable", or "disable"
    • For add/edit: Provide name, trigger, and action
    • Common triggers:
      • Daily 8 AM: {"m": 480, "d": 127}
      • Weekdays 6:30 PM: {"m": 1110, "d": 31}
    • Example action: {"Light": {"Power": true}}

Group Management (Home/Room Hierarchy)

  • create_group(name: str, group_type: str = None, ...):

    • Create a home or room.
    • Required: name, group_type ("home" or "room")
    • For rooms: parent_group_id required
    • Example: create_group("Living Room", "room", parent_group_id="home_id")
  • get_group_details(group_id: str = None, include_nodes: bool = False):

    • Get group information. For all groups, use group_id=None.
    • Set include_nodes=True to include device details.
    • Returns: Group hierarchy, members, and metadata.
  • update_group(group_id: str, ...):

    • Update group properties or manage devices.
    • Optional: name, description, add_nodes, remove_nodes
    • Examples:
      • Rename: update_group("group_id", name="New Name")
      • Add devices: update_group("group_id", add_nodes="light1,light2")
  • add_device_to_room(device_node_id: str, room_group_id: str):

    • Add device to room (handles parent group automatically).
    • Example: add_device_to_room("light1", "kitchen_id")

License

This project is licensed under the terms specified in the LICENSE file.

Star History

Star History Chart

Repository Owner

espressif
espressif

Organization

Repository Details

Language Python
Default Branch main
Size 55 KB
Contributors 2
License Apache License 2.0
MCP Verified Sep 5, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • awslabs/mcp

    awslabs/mcp

    Specialized MCP servers for seamless AWS integration in AI and development environments.

    AWS MCP Servers is a suite of specialized servers implementing the open Model Context Protocol (MCP) to bridge large language model (LLM) applications with AWS services, tools, and data sources. It provides a standardized way for AI assistants, IDEs, and developer tools to access up-to-date AWS documentation, perform cloud operations, and automate workflows with context-aware intelligence. Featuring a broad catalog of domain-specific servers, quick installation for popular platforms, and both local and remote deployment options, it enhances cloud-native development, infrastructure management, and workflow automation for AI-driven tools. The project includes Docker, Lambda, and direct integration instructions for environments such as Amazon Q CLI, Cursor, Windsurf, Kiro, and VS Code.

    • 6,220
    • MCP
    • awslabs/mcp
  • cloudflare/mcp-server-cloudflare

    cloudflare/mcp-server-cloudflare

    Connect Cloudflare services to Model Context Protocol (MCP) clients for AI-powered management.

    Cloudflare MCP Server enables integration between Cloudflare's suite of services and clients using the Model Context Protocol (MCP). It provides multiple specialized servers that allow AI models to access, analyze, and manage configurations, logs, analytics, and other features across Cloudflare's platform. Users can leverage natural language interfaces in compatible MCP clients to read data, gain insights, and perform automated actions on their Cloudflare accounts. This project aims to streamline the orchestration of security, development, monitoring, and infrastructure tasks through standardized MCP connections.

    • 2,919
    • MCP
    • cloudflare/mcp-server-cloudflare
  • mcp

    mcp

    Universal remote MCP server connecting AI clients to productivity tools.

    WayStation MCP acts as a remote Model Context Protocol (MCP) server, enabling seamless integration between AI clients like Claude or Cursor and a wide range of productivity applications, such as Notion, Monday, Airtable, Jira, and more. It supports multiple secure connection transports and offers both general and user-specific preauthenticated endpoints. The platform emphasizes ease of integration, OAuth2-based authentication, and broad app compatibility. Users can manage their integrations through a user dashboard, simplifying complex workflow automations for AI-powered productivity.

    • 27
    • MCP
    • waystation-ai/mcp
  • mcpmcp-server

    mcpmcp-server

    Seamlessly discover, set up, and integrate MCP servers with AI clients.

    mcpmcp-server enables users to discover, configure, and connect MCP servers with preferred clients, optimizing AI integration into daily workflows. It supports streamlined setup via JSON configuration, ensuring compatibility with various platforms such as Claude Desktop on macOS. The project simplifies the connection process between AI clients and remote Model Context Protocol servers. Users are directed to an associated homepage for further platform-specific guidance.

    • 17
    • MCP
    • glenngillen/mcpmcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results