Skip to content

pparth230/MCP-Server-for-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Arduino MCP Server

An MCP (Model Context Protocol) server that enables AI assistants to interact with Arduino hardware. This server provides tools for board detection, sketch uploading, and serial communication.

Features

  • Board Detection: List connected Arduino boards and get detailed board information
  • Sketch Upload: Compile and upload Arduino sketches to connected boards
  • Serial Communication: Monitor serial output and send commands to Arduino

Prerequisites

  • Python 3.10 or higher
  • arduino-cli installed and available in PATH

Installation

# Clone the repository
git clone <your-repo-url>
cd Arduino

# Install the package
pip install -e .

Usage

Running the Server

arduino-mcp

Configuration with Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "arduino": {
      "command": "arduino-mcp"
    }
  }
}

Available Tools

list_boards

Lists all connected Arduino boards with their ports and board types.

{
  "boards": [
    {
      "port": "/dev/ttyUSB0",
      "board_name": "Arduino Uno",
      "fqbn": "arduino:avr:uno"
    }
  ]
}

get_board_info

Get detailed information about a specific board type.

Parameters:

  • fqbn (required): Fully Qualified Board Name (e.g., arduino:avr:uno)

upload_sketch

Compile and upload an Arduino sketch to a connected board.

Parameters:

  • sketch_path (required): Path to the .ino sketch file or sketch directory
  • port (required): Serial port (e.g., /dev/ttyUSB0, COM3)
  • fqbn (required): Fully Qualified Board Name (e.g., arduino:avr:uno)

serial_monitor

Read data from the serial port of a connected Arduino.

Parameters:

  • port (required): Serial port (e.g., /dev/ttyUSB0, COM3)
  • baud_rate (optional): Baud rate for serial communication (default: 9600)
  • duration (optional): How long to monitor in seconds (default: 5)

serial_send

Send data/commands to Arduino via serial port.

Parameters:

  • port (required): Serial port (e.g., /dev/ttyUSB0, COM3)
  • message (required): Message to send to the Arduino
  • baud_rate (optional): Baud rate for serial communication (default: 9600)

Dependencies

  • mcp>=1.0.0 - Model Context Protocol SDK
  • pyserial>=3.5 - Serial communication library

License

MIT

About

Full stack end to end, MCP server for Arduino using Claude Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages