home / mcp / arduino mcp server
Controls an Arduino LED setup via MCP, enabling AI-driven on/off actions.
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.
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.
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.
pip install uvxInstall 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.
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_MCPYou 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"
]
}
}
}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.
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": []
}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.
Turns the white LED on by sending a command to the Arduino through the MCP server.
Turns the red LED on by sending a command to the Arduino through the MCP server.
Turns all LEDs off by sending a command to the Arduino through the MCP server.