MCP Arduino Server - Secure MCP Server by ALMC Security 2025

MCP Arduino Server

View on GitHub

MCP Arduino Server (mcp-arduino-server)

License: MITPyPI version

A FastMCP-powered bridge exposing arduino-cli functionality via the Model Context Protocol (MCP). Manage sketches, boards, libraries, files, plus generate WireViz schematics from YAML or natural language.

Requirements

  • Python ≥3.10
  • arduino-cli in PATH
  • MCP SDK (mcp[cli])
  • WireViz (optional; for diagram generation)
  • OPENAI_API_KEY (for AI‑powered WireViz)
  • thefuzz[speedup] (optional; enables fuzzy local library search)

Installation

From PyPI:

pip install mcp-arduino-server

From source:

git clone https://github.com/Volt23/mcp-arduino-server.git
cd mcp-arduino-server
pip install .

Configuration

Environment variables override defaults:

VariableDefault / Description
ARDUINO_CLI_PATHauto-detected
WIREVIZ_PATHauto-detected
MCP_SKETCH_DIR~/Documents/Arduino_MCP_Sketches/
LOG_LEVELINFO
OPENAI_API_KEYyour OpenAI API key (required for AI‑powered WireViz)
OPENROUTER_API_KEYoptional alternative to OPENAI_API_KEY

Quick Start

mcp-arduino-server

Server listens on STDIO for JSON-RPC MCP calls. Key methods:

Sketches

  • create_new_sketch(name)
  • list_sketches()
  • read_file(path)
  • write_file(path, content[, board_fqbn])(auto-compiles & opens .ino)

Build & Deploy

  • verify_code(sketch, board_fqbn)
  • upload_sketch(sketch, port, board_fqbn)

Libraries

  • lib_search(name[, limit])
  • lib_install(name)
  • list_library_examples(name)

Boards

  • list_boards()
  • board_search(query)

File Ops

  • rename_file(src, dest)
  • remove_file(path)(destructive; operations sandboxed to home & sketch directories)

WireViz Diagrams

  • generate_circuit_diagram_from_description(desc, sketch="", output_base="circuit")(AI‑powered; requires OPENAI_API_KEY, opens PNG automatically)

MCP Client Configuration

To integrate with MCP clients (e.g., Claude Desktop), set your OpenAI API key in the environment (or alternatively OPENROUTER_API_KEY for OpenRouter):

{
  "mcpServers": {
    "arduino": {
      "command": "/path/to/mcp-arduino-server",
      "args": [],
      "env": {
        "WIREVIZ_PATH": "/path/to/wireviz",
        "OPENAI_API_KEY": "<your-openai-api-key>"
      }
    }
  }
}

Troubleshooting

  • Set LOG_LEVEL=DEBUG for verbose logs.
  • Verify file and serial-port permissions.
  • Install missing cores: arduino-cli core install <spec>.
  • Run arduino-cli commands manually to debug.

License

MIT

Related in Development - Secure MCP Servers

ServerSummaryActions
AI Image Generation基于火山引擎(抖音豆包)的图像生成服务,专门设计用于与 Cursor MCP 服务集成。支持自定义图片宽高比、保...View
Composer Package README MCP ServerView
d2-mcpA Model Context Protocol (MCP) server for working with D2: Declarative Diagramming, enabling seamles...View
MCP ServerModel Context Protocol (MCP) là một giao thức mở được phát triển bởi Anthropic để chuẩn hóa cách các...View
USolverA Model Context Protocol server that exposes tools for solving combinatorial, convex, integer progra...View
AutodocumentAn MCP (Model Context Protocol) server that automatically generates documentation for code repositor...View