arduino-cli-mcp


Namearduino-cli-mcp JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/oliver0804/arduino-cli-mcp
SummaryArduino CLI MCP Server for VSCode and GitHub Copilot integration - a LLM Machine Communication Protocol implementation
upload_time2025-03-15 04:55:57
maintainerNone
docs_urlNone
authorOliver
requires_python>=3.11
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Arduino CLI MCP

Arduino CLI MCP is a server that provides Arduino CLI integration for VSCode and Claude, allowing you to compile and upload Arduino sketches through the Arduino CLI.

## Overview

Arduino CLI MCP provides a wrapper for Arduino CLI that simplifies workflows through features such as auto-approval of repetitive operations. This tool is particularly useful for developers and educators who frequently work with Arduino projects.

## Introduction to Model Context Protocol (MCP)

Model Context Protocol (MCP) is an open protocol specifically designed to enable Large Language Models (LLMs) to seamlessly integrate with external data sources and tools. Whether you're developing an AI IDE, enhancing chat interfaces, or building automated AI workflows, MCP provides a standardized way to connect LLMs with the context they need. Through MCP, the Arduino CLI MCP server can interact with various AI models, handling Arduino-related operations and commands.

## Installation

```bash
pip install arduino-cli-mcp
```

After installation, you can run it with the following command:

```bash
python -m arduino_cli_mcp
```

## Prerequisites

- Arduino CLI installed and available in PATH
- Python 3.11+
- Working directory with appropriate file permissions

## Configuration

The tool can be configured using JSON format as follows:

```json
"github.com/arduino-cli-mcp": {
  "command": "python",
  "args": [
    "/Users/oliver/code/mcp/arduino-cli-mcp/main.py",
    "--workdir",
    "/Users/oliver/Documents/Cline/MCP/arduino-cli-mcp"
  ],
  "disabled": false,
  "autoApprove": [
    "upload",
    "compile",
    "install_board"
  ]
}
```

### Configuration Options

- `command`: The command to execute (Python in this case)
- `args`: List of arguments passed to the command
  - First argument is the path to the main script
  - `--workdir` specifies the working directory for Arduino CLI operations
- `disabled`: Enable/disable the tool (set to `false` to enable)
- `autoApprove`: List of Arduino CLI operations that can be auto-approved without user confirmation
  - Supported operations: `upload`, `compile`, `install_board`

### Configuration for Claude.app

Add the following to your Claude settings:

```json
"mcpServers": {
  "arduino": {
    "command": "python",
    "args": ["-m", "arduino_cli_mcp"]
  }
}
```

### Configuration for Zed

Add the following to your Zed settings.json file:

```json
"context_servers": {
  "arduino-cli-mcp": {
    "command": "python",
    "args": ["-m", "arduino_cli_mcp"]
  }
},
```

### Custom Configuration - Arduino CLI Path

By default, the server looks for Arduino CLI in the system PATH. You can specify a custom path by adding the `--arduino-cli-path` parameter to the `args` list in your configuration.

Example:

```json
{
  "command": "python",
  "args": ["-m", "arduino_cli_mcp", "--arduino-cli-path=/path/to/arduino-cli"]
}
```

## Usage

Start the MCP server:

```bash
arduino-cli-mcp --workdir /path/to/your/arduino/projects
```

Once configured, the tool will automatically handle Arduino CLI commands, with special handling for operations listed in the `autoApprove` section.

## Arduino CLI MCP Server

This is a Model Context Protocol server that provides Arduino CLI functionality. The server enables large language models to interact with Arduino boards through natural language commands, compile sketches, upload firmware, and manage libraries.

### Available Tools

- `list_boards` - Lists all connected Arduino boards.

  - No parameters required

- `compile_sketch` - Compiles an Arduino sketch.

  - Required parameters:
    - `sketch_path` (string): Path to the sketch file
    - `board_fqbn` (string): Fully qualified board name (e.g., 'arduino:avr:uno')

- `upload_sketch` - Uploads a compiled sketch to a board.

  - Required parameters:
    - `sketch_path` (string): Path to the sketch file
    - `board_fqbn` (string): Fully qualified board name
    - `port` (string): Upload port (e.g., '/dev/ttyACM0', 'COM3')

- `search_library` - Searches for Arduino libraries.

  - Required parameters:
    - `query` (string): Search term

- `install_library` - Installs an Arduino library.

  - Required parameters:
    - `library_name` (string): Name of the library to install

## Interaction Examples

1. Listing connected boards:

```json
{
  "name": "list_boards",
  "arguments": {}
}
```

Response:

```json
{
  "boards": [
    {
      "port": "COM3",
      "fqbn": "arduino:avr:uno",
      "name": "Arduino Uno"
    },
    {
      "port": "COM4",
      "fqbn": "arduino:avr:nano",
      "name": "Arduino Nano"
    }
  ]
}
```

2. Compiling a sketch:

```json
{
  "name": "compile_sketch",
  "arguments": {
    "sketch_path": "/path/to/Blink.ino",
    "board_fqbn": "arduino:avr:uno"
  }
}
```

Response:

```json
{
  "success": true,
  "output": "Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.",
  "binary_path": "/path/to/build/arduino.avr.uno/Blink.ino.hex"
}
```

3. Error response example:

```json
{
  "error": true,
  "message": "Compilation failed: Syntax error on line 5",
  "details": "Missing semicolon at the end of statement"
}
```

## Debugging

You can use the MCP inspector tool to debug the server:

```bash
npx @modelcontextprotocol/inspector python -m arduino_cli_mcp
```

## Example Questions for Claude

1. "What Arduino boards are currently connected to my computer?"
2. "Compile my Blink sketch for Arduino Uno"
3. "Upload my LED project to the Arduino Mega on COM5 port"
4. "Can you search for libraries related to OLED displays?"
5. "Install the Servo library for Arduino"

## Features

- Compile Arduino sketches
- Upload sketches to Arduino boards
- Install Arduino platforms
- List available boards and platforms
- Create and manage Arduino projects
- Search and install libraries

## Contributing

We encourage you to contribute to arduino-cli-mcp to help expand and improve it. Whether you want to add new Arduino-related tools, enhance existing functionality, or improve documentation, your input is valuable.

For examples of other MCP servers and implementation patterns, see:
https://github.com/modelcontextprotocol/servers

Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or improvements to make arduino-cli-mcp more powerful and useful.

## Related Links

- [Arduino CLI Documentation](https://arduino.github.io/arduino-cli/)

## License

This project is licensed under the MIT License - see the LICENSE file for details.

---

_For the Chinese version, please refer to [README.zh-tw.md](README.zh-tw.md)_

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oliver0804/arduino-cli-mcp",
    "name": "arduino-cli-mcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Oliver",
    "author_email": "Oliver0804 <icetzsr@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b2/28/55998e720294349043145bafc6b3d521e007d965f0fa2ef976b4845a2f97/arduino_cli_mcp-0.1.3.tar.gz",
    "platform": null,
    "description": "# Arduino CLI MCP\n\nArduino CLI MCP is a server that provides Arduino CLI integration for VSCode and Claude, allowing you to compile and upload Arduino sketches through the Arduino CLI.\n\n## Overview\n\nArduino CLI MCP provides a wrapper for Arduino CLI that simplifies workflows through features such as auto-approval of repetitive operations. This tool is particularly useful for developers and educators who frequently work with Arduino projects.\n\n## Introduction to Model Context Protocol (MCP)\n\nModel Context Protocol (MCP) is an open protocol specifically designed to enable Large Language Models (LLMs) to seamlessly integrate with external data sources and tools. Whether you're developing an AI IDE, enhancing chat interfaces, or building automated AI workflows, MCP provides a standardized way to connect LLMs with the context they need. Through MCP, the Arduino CLI MCP server can interact with various AI models, handling Arduino-related operations and commands.\n\n## Installation\n\n```bash\npip install arduino-cli-mcp\n```\n\nAfter installation, you can run it with the following command:\n\n```bash\npython -m arduino_cli_mcp\n```\n\n## Prerequisites\n\n- Arduino CLI installed and available in PATH\n- Python 3.11+\n- Working directory with appropriate file permissions\n\n## Configuration\n\nThe tool can be configured using JSON format as follows:\n\n```json\n\"github.com/arduino-cli-mcp\": {\n  \"command\": \"python\",\n  \"args\": [\n    \"/Users/oliver/code/mcp/arduino-cli-mcp/main.py\",\n    \"--workdir\",\n    \"/Users/oliver/Documents/Cline/MCP/arduino-cli-mcp\"\n  ],\n  \"disabled\": false,\n  \"autoApprove\": [\n    \"upload\",\n    \"compile\",\n    \"install_board\"\n  ]\n}\n```\n\n### Configuration Options\n\n- `command`: The command to execute (Python in this case)\n- `args`: List of arguments passed to the command\n  - First argument is the path to the main script\n  - `--workdir` specifies the working directory for Arduino CLI operations\n- `disabled`: Enable/disable the tool (set to `false` to enable)\n- `autoApprove`: List of Arduino CLI operations that can be auto-approved without user confirmation\n  - Supported operations: `upload`, `compile`, `install_board`\n\n### Configuration for Claude.app\n\nAdd the following to your Claude settings:\n\n```json\n\"mcpServers\": {\n  \"arduino\": {\n    \"command\": \"python\",\n    \"args\": [\"-m\", \"arduino_cli_mcp\"]\n  }\n}\n```\n\n### Configuration for Zed\n\nAdd the following to your Zed settings.json file:\n\n```json\n\"context_servers\": {\n  \"arduino-cli-mcp\": {\n    \"command\": \"python\",\n    \"args\": [\"-m\", \"arduino_cli_mcp\"]\n  }\n},\n```\n\n### Custom Configuration - Arduino CLI Path\n\nBy default, the server looks for Arduino CLI in the system PATH. You can specify a custom path by adding the `--arduino-cli-path` parameter to the `args` list in your configuration.\n\nExample:\n\n```json\n{\n  \"command\": \"python\",\n  \"args\": [\"-m\", \"arduino_cli_mcp\", \"--arduino-cli-path=/path/to/arduino-cli\"]\n}\n```\n\n## Usage\n\nStart the MCP server:\n\n```bash\narduino-cli-mcp --workdir /path/to/your/arduino/projects\n```\n\nOnce configured, the tool will automatically handle Arduino CLI commands, with special handling for operations listed in the `autoApprove` section.\n\n## Arduino CLI MCP Server\n\nThis is a Model Context Protocol server that provides Arduino CLI functionality. The server enables large language models to interact with Arduino boards through natural language commands, compile sketches, upload firmware, and manage libraries.\n\n### Available Tools\n\n- `list_boards` - Lists all connected Arduino boards.\n\n  - No parameters required\n\n- `compile_sketch` - Compiles an Arduino sketch.\n\n  - Required parameters:\n    - `sketch_path` (string): Path to the sketch file\n    - `board_fqbn` (string): Fully qualified board name (e.g., 'arduino:avr:uno')\n\n- `upload_sketch` - Uploads a compiled sketch to a board.\n\n  - Required parameters:\n    - `sketch_path` (string): Path to the sketch file\n    - `board_fqbn` (string): Fully qualified board name\n    - `port` (string): Upload port (e.g., '/dev/ttyACM0', 'COM3')\n\n- `search_library` - Searches for Arduino libraries.\n\n  - Required parameters:\n    - `query` (string): Search term\n\n- `install_library` - Installs an Arduino library.\n\n  - Required parameters:\n    - `library_name` (string): Name of the library to install\n\n## Interaction Examples\n\n1. Listing connected boards:\n\n```json\n{\n  \"name\": \"list_boards\",\n  \"arguments\": {}\n}\n```\n\nResponse:\n\n```json\n{\n  \"boards\": [\n    {\n      \"port\": \"COM3\",\n      \"fqbn\": \"arduino:avr:uno\",\n      \"name\": \"Arduino Uno\"\n    },\n    {\n      \"port\": \"COM4\",\n      \"fqbn\": \"arduino:avr:nano\",\n      \"name\": \"Arduino Nano\"\n    }\n  ]\n}\n```\n\n2. Compiling a sketch:\n\n```json\n{\n  \"name\": \"compile_sketch\",\n  \"arguments\": {\n    \"sketch_path\": \"/path/to/Blink.ino\",\n    \"board_fqbn\": \"arduino:avr:uno\"\n  }\n}\n```\n\nResponse:\n\n```json\n{\n  \"success\": true,\n  \"output\": \"Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.\",\n  \"binary_path\": \"/path/to/build/arduino.avr.uno/Blink.ino.hex\"\n}\n```\n\n3. Error response example:\n\n```json\n{\n  \"error\": true,\n  \"message\": \"Compilation failed: Syntax error on line 5\",\n  \"details\": \"Missing semicolon at the end of statement\"\n}\n```\n\n## Debugging\n\nYou can use the MCP inspector tool to debug the server:\n\n```bash\nnpx @modelcontextprotocol/inspector python -m arduino_cli_mcp\n```\n\n## Example Questions for Claude\n\n1. \"What Arduino boards are currently connected to my computer?\"\n2. \"Compile my Blink sketch for Arduino Uno\"\n3. \"Upload my LED project to the Arduino Mega on COM5 port\"\n4. \"Can you search for libraries related to OLED displays?\"\n5. \"Install the Servo library for Arduino\"\n\n## Features\n\n- Compile Arduino sketches\n- Upload sketches to Arduino boards\n- Install Arduino platforms\n- List available boards and platforms\n- Create and manage Arduino projects\n- Search and install libraries\n\n## Contributing\n\nWe encourage you to contribute to arduino-cli-mcp to help expand and improve it. Whether you want to add new Arduino-related tools, enhance existing functionality, or improve documentation, your input is valuable.\n\nFor examples of other MCP servers and implementation patterns, see:\nhttps://github.com/modelcontextprotocol/servers\n\nPull requests are welcome! Feel free to contribute new ideas, bug fixes, or improvements to make arduino-cli-mcp more powerful and useful.\n\n## Related Links\n\n- [Arduino CLI Documentation](https://arduino.github.io/arduino-cli/)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\n_For the Chinese version, please refer to [README.zh-tw.md](README.zh-tw.md)_\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Arduino CLI MCP Server for VSCode and GitHub Copilot integration - a LLM Machine Communication Protocol implementation",
    "version": "0.1.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/oliver0804/arduino-cli-mcp/issues",
        "Documentation": "https://github.com/oliver0804/arduino-cli-mcp#readme",
        "Homepage": "https://github.com/oliver0804/arduino-cli-mcp"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "211c9067f97b4af2fa5c2ebc53da18ab96ccd3dda84d2d2323c3fa9f35dd7e5f",
                "md5": "d9da8bab412d002019628f3a5f8ce2cc",
                "sha256": "331e2d5820c3caa8a1f8695f460b222fc89997200e2f5584a70510b0606fd2df"
            },
            "downloads": -1,
            "filename": "arduino_cli_mcp-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d9da8bab412d002019628f3a5f8ce2cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 6098,
            "upload_time": "2025-03-15T04:55:56",
            "upload_time_iso_8601": "2025-03-15T04:55:56.657034Z",
            "url": "https://files.pythonhosted.org/packages/21/1c/9067f97b4af2fa5c2ebc53da18ab96ccd3dda84d2d2323c3fa9f35dd7e5f/arduino_cli_mcp-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b22855998e720294349043145bafc6b3d521e007d965f0fa2ef976b4845a2f97",
                "md5": "c1b892db61eb1ad7f3a71273d2e089b0",
                "sha256": "9ed5e2f1856ce6eb0fc4c9ff8e435df0c7628e6d8501f55b92a0786309fadca0"
            },
            "downloads": -1,
            "filename": "arduino_cli_mcp-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c1b892db61eb1ad7f3a71273d2e089b0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 6557,
            "upload_time": "2025-03-15T04:55:57",
            "upload_time_iso_8601": "2025-03-15T04:55:57.945978Z",
            "url": "https://files.pythonhosted.org/packages/b2/28/55998e720294349043145bafc6b3d521e007d965f0fa2ef976b4845a2f97/arduino_cli_mcp-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-15 04:55:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oliver0804",
    "github_project": "arduino-cli-mcp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "arduino-cli-mcp"
}
        
Elapsed time: 0.88134s