Skip to main content

MCP Server for Arduino CLI providing sketch, board, library, and file management tools.

Project description

MCP Arduino Server (mcp-arduino-server)

License: MIT PyPI 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:

Variable Default / Description
ARDUINO_CLI_PATH auto-detected
WIREVIZ_PATH auto-detected
MCP_SKETCH_DIR ~/Documents/Arduino_MCP_Sketches/
LOG_LEVEL INFO
OPENAI_API_KEY your OpenAI API key (required for AI‑powered WireViz)
OPENROUTER_API_KEY optional 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_arduino_server-0.1.5.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_arduino_server-0.1.5-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_arduino_server-0.1.5.tar.gz.

File metadata

  • Download URL: mcp_arduino_server-0.1.5.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for mcp_arduino_server-0.1.5.tar.gz
Algorithm Hash digest
SHA256 12535847c43ed437fc27db009b18970b5ab7217733b5f0c42ae718abb9ce8ba4
MD5 29aa625a1c604c1875e45b2ea499c0c3
BLAKE2b-256 bcfd32416e2c46c26d19f3bfe625f9a68c4e69bba1067919fba474c19b875d23

See more details on using hashes here.

File details

Details for the file mcp_arduino_server-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_arduino_server-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a58e97c9dbb84b83cc0d1eb7d2bde99992030da7f4acaeeefc63585249852807
MD5 509d7bdecab3443176131ac25280fed9
BLAKE2b-256 a83744fc1266e3f411cc6d08ac7767fc52e0a4c7f9c8a09993090cfe1c1c191a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page