Arduino_MCP_Server
MCP server from AimanMadan/Arduino_MCP_Server
claude mcp add --transport stdio aimanmadan-arduino_mcp_server python main.py \ --env ARDUINO_PORT="The serial port Arduino is connected to (e.g., COM3 or /dev/ttyUSB0). If your code reads from a specific port, set it here or handle autodetection in the script." \ --env PYTHONUNBUFFERED="1"
How to use
Prerequisites include a compatible Arduino board with the StandardFirmataPlus sketch uploaded, Python 3.12 or newer, and the uv utility to install Python dependencies. The server exposes tools that the AI client can call to control the LEDs. For Claude Desktop, configure the MCP client to point at main.py via uv (as shown in the README example), then start Claude Desktop and issue commands such as enabling the white LED, enabling the red LED, or turning off both LEDs. The server handles the translation from AI intent to pin state changes, giving you a bridge between AI instructions and tangible hardware actions.
How to install
Prerequisites
- Arduino board (Uno/Nano or similar) with USB connection
- Two LEDs (white and red) and two 1k–220Ω resistors
- Firmata installed on Arduino (StandardFirmataPlus)
- Python 3.12+ and the uv tool
- Claude Desktop or another MCP-compatible AI client
Installation steps:
- Install Arduino firmware
- Upload StandardFirmataPlus to the Arduino using the Arduino IDE:
- Open Arduino IDE
- Tools > Board: select your board
- Tools > Port: select the Arduino port
- Sketch > Include Library > Manage Libraries: ensure Firmata is available (if needed)
- Open File > Examples > Firmata > StandardFirmata
- Upload to board
- Prepare the Python MCP server
- Ensure Python 3.12+ is installed
- In the project directory, install dependencies using uv:
uv pip install - Confirm that main.py (the MCP server) is configured to use your Arduino port (set ARDUINO_PORT if needed).
- Run the MCP server
- Start the server with Python (as configured in mcp_config):
python main.py - If you prefer using uv to run, you can adapt the command in your MCP client config as shown in the README (pointing to the directory containing main.py and running it).
- Optional: Claude Desktop configuration
- In Claude Desktop, set up claude_desktop_config.json with the path to your uv command, the project directory, and the run command, as illustrated in the README.
- Launch Claude Desktop and verify that the MCP server shows as active when commands are issued.
Additional notes
Tips and potential issues:
- Ensure the ARDUINO_PORT environment variable or your code’s port setting matches the actual port the Arduino is on (e.g., COM3 on Windows or /dev/ttyACM0 / /dev/ttyUSB0 on Linux/macOS).
- The Firmata sketch must be installed and running on the Arduino for Python (pyfirmata2) to communicate.
- If you see permission or serial access errors, make sure your user has access to the serial port and that no other program is using it.
- When wiring LEDs, use current-limiting resistors (220Ω suggested) to protect the LEDs and the Arduino pins.
- If Claude Desktop’s config path changes, update claude_desktop_config.json accordingly so the MCP server starts automatically.
- The environment variable ARDUINO_PORT is optional if main.py detects the port automatically; set it to avoid detection issues on some setups.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP