home / mcp / arduino mcp server

Arduino MCP Server

Controls an Arduino LED setup via MCP, enabling AI-driven on/off actions.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "aimanmadan-arduino_mcp_server": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/aiman/Dev/Arduino_MCP",
        "run",
        "main.py"
      ]
    }
  }
}

You can control an Arduino from your computer using the MCP (Model Context Protocol) server. This setup lets an AI client send commands to your Arduino to turn LEDs on and off, enabling real‑world interaction driven by AI. The server runs locally and exposes a simple way for an AI assistant to request LED actions on the connected board.

How to use

Once you have the MCP server running, you interact with it through an MCP client. Your AI assistant can issue high‑level requests like turning the white LED on, turning the red LED on, or turning off all LEDs. The server translates these requests into specific commands sent to the Arduino over a serial connection. You can build flows where the AI adjusts LED states based on context, timing, or sensor input you’ve wired to the board.

How to install

Prerequisites you need before installing the MCP server:

Python 3.12 or higher is required to run the MCP server.

Install the Ultrafast Python package installer and resolver (uv) to manage Python libraries.

How to install (step by step)

pip install uvx

Install the Python dependencies used by the MCP server. This is driven by the uv tool which reads the pyproject.toml and installs the required packages.

Install the dependencies with uv by running the following command from your project directory.

Run the MCP server locally

uv pip install
```

```
# Start the MCP server using the local Arduino MCP project
# This assumes you have the Arduino MCP project checked out at /Users/yourname/Dev/Arduino_MCP
uv run main.py --directory /Users/yourname/Dev/Arduino_MCP

MCP client configuration (example for CLI or editor integration)

You can configure an MCP client to start the local server using the following setup. The example shows how the client would invoke uv to run the Python script from the Arduino_MCP folder. Adjust the paths to match your environment.

{ 
  "mcpServers": {
    "arduino": {
      "command": "uv",
      "args": [
        "run",
        "main.py",
        "--directory",
        "/Users/yourname/Dev/Arduino_MCP"
      ]
    }
  }
}

Additional notes

The server uses a serial connection to your Arduino. Ensure your Arduino is running the StandardFirmataPlus sketch and connected to your computer. The MCP server exposes tool functions that the AI client can call, which in turn command the LEDs on the board.

Configuration you will use with your editor or AI client

The following configuration demonstrates how to run the MCP server locally using uv from the directory where your Arduino_MCP project resides. Update paths to reflect your system.

{
  "mcpServers": {
    "arduino": {
      "type": "stdio",
      "name": "arduino_mcp",
      "command": "uv",
      "args": ["--directory", "/Users/yourname/Dev/Arduino_MCP", "run", "main.py"]
    }
  },
  "envVars": []
}

LED control tools you can invoke

The MCP server provides a set of tools to control the LEDs on the Arduino. You can call these tools from your AI client to turn the white LED on, turn the red LED on, or turn both LEDs off.

Available tools

white_led_ON

Turns the white LED on by sending a command to the Arduino through the MCP server.

red_led_ON

Turns the red LED on by sending a command to the Arduino through the MCP server.

led_OFF

Turns all LEDs off by sending a command to the Arduino through the MCP server.

Arduino MCP Server - aimanmadan/arduino_mcp_server