arduino-mcp-server 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +77 -99
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Akshat Nerella
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Akshat Nerella
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,85 +1,41 @@
|
|
|
1
|
-
#
|
|
2
|
-
Arduino MCP server that wraps `arduino-cli` so AI agents can discover boards/ports, compile/upload sketches, read serial output, and query board pin references.
|
|
1
|
+
# Arduino MCP Server
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
- MCP tools for:
|
|
6
|
-
- listing connected boards and serial ports
|
|
7
|
-
- detecting connected hardware with inferred FQBN and next commands
|
|
8
|
-
- checking `arduino-cli` availability with OS-specific install guidance (`arduino_cli_doctor`)
|
|
9
|
-
- auto-installing `arduino-cli` when missing (`install_arduino_cli`)
|
|
10
|
-
- ensuring required board cores are installed (`ensure_core_installed`)
|
|
11
|
-
- listing supported boards
|
|
12
|
-
- compiling sketches
|
|
13
|
-
- uploading sketches
|
|
14
|
-
- reading a serial snapshot (time-bounded monitor)
|
|
15
|
-
- fetching `arduino-cli board details`
|
|
16
|
-
- querying local board pin/reference metadata
|
|
17
|
-
- Structured JSON responses so agents can reason over output
|
|
18
|
-
- Optional sketch path sandboxing via `ARDUINO_SKETCH_ROOT`
|
|
19
|
-
|
|
20
|
-
## Requirements
|
|
21
|
-
- Node.js 20+
|
|
22
|
-
- `arduino-cli` installed and available on `PATH` (or set `ARDUINO_CLI_PATH`)
|
|
23
|
-
|
|
24
|
-
## Agent Workflow Contract
|
|
25
|
-
Use this workflow in AI agents:
|
|
26
|
-
1. Call `arduino_cli_doctor` first.
|
|
27
|
-
2. If `installed=false`, call `install_arduino_cli` with `{"method":"auto"}`.
|
|
28
|
-
3. If auto-install fails, use the returned OS-specific `installGuide`.
|
|
29
|
-
4. Set `ARDUINO_CLI_PATH` if the binary is not on `PATH`.
|
|
30
|
-
5. Re-run `arduino_cli_doctor` and continue only when `installed=true`.
|
|
31
|
-
6. Only then call `detect_hardware`, `compile_sketch`, `upload_sketch`, etc.
|
|
32
|
-
|
|
33
|
-
Do not attempt fallback hardware scans before `arduino-cli` is available.
|
|
34
|
-
|
|
35
|
-
When `detect_hardware` returns unresolved/non-standard board matches, the tool now includes
|
|
36
|
-
`requiresUserBoardConfirmation` and an `agentAction` question payload. Agents should ask the user
|
|
37
|
-
to confirm board model/FQBN before continuing.
|
|
38
|
-
|
|
39
|
-
`compile_sketch` and `upload_sketch` automatically ensure board core installation from FQBN by default
|
|
40
|
-
(`autoInstallCore=true`), so agents should not need manual `arduino-cli core install` in normal flows.
|
|
41
|
-
|
|
42
|
-
## Install Arduino CLI Quickly
|
|
43
|
-
Official docs: https://docs.arduino.cc/arduino-cli/installation/
|
|
44
|
-
|
|
45
|
-
- Windows (recommended): `winget install ArduinoSA.CLI`
|
|
46
|
-
- macOS: `brew install arduino-cli`
|
|
47
|
-
- Linux: `brew install arduino-cli` or official install script
|
|
3
|
+
Arduino MCP server for `arduino-cli` workflows: dependency checks/install, hardware detection, compile/upload, serial monitoring, and board reference lookup.
|
|
48
4
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- Bash/Zsh (current session): `export ARDUINO_CLI_PATH=/absolute/path/to/arduino-cli`
|
|
5
|
+
## Quick Start
|
|
6
|
+
Install globally:
|
|
52
7
|
|
|
53
|
-
## Install
|
|
54
8
|
```bash
|
|
55
|
-
npm install
|
|
56
|
-
npm run build
|
|
9
|
+
npm install -g arduino-mcp-server
|
|
57
10
|
```
|
|
58
11
|
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
npm start
|
|
62
|
-
```
|
|
12
|
+
Add to your AI agent MCP config.
|
|
63
13
|
|
|
64
|
-
|
|
14
|
+
Claude Desktop (`claude_desktop_config.json`):
|
|
65
15
|
|
|
66
|
-
```
|
|
67
|
-
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"arduino": {
|
|
20
|
+
"command": "npx",
|
|
21
|
+
"args": ["-y", "arduino-mcp-server"],
|
|
22
|
+
"env": {
|
|
23
|
+
"ARDUINO_CLI_PATH": "arduino-cli",
|
|
24
|
+
"ARDUINO_SKETCH_ROOT": "D:/Projects/arduino-sketches"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
68
29
|
```
|
|
69
30
|
|
|
70
|
-
|
|
71
|
-
- `ARDUINO_CLI_PATH`: path/command for Arduino CLI. Default: `arduino-cli`
|
|
72
|
-
- `ARDUINO_SKETCH_ROOT`: optional absolute path. When set, `sketchPath` inputs must resolve under this root.
|
|
73
|
-
|
|
74
|
-
## Example MCP client config (stdio)
|
|
75
|
-
Use your built `build/index.js` as the command target.
|
|
31
|
+
Codex MCP config:
|
|
76
32
|
|
|
77
33
|
```json
|
|
78
34
|
{
|
|
79
35
|
"mcpServers": {
|
|
80
36
|
"arduino": {
|
|
81
|
-
"command": "
|
|
82
|
-
"args": ["
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "arduino-mcp-server"],
|
|
83
39
|
"env": {
|
|
84
40
|
"ARDUINO_CLI_PATH": "arduino-cli",
|
|
85
41
|
"ARDUINO_SKETCH_ROOT": "D:/Projects/arduino-sketches"
|
|
@@ -89,36 +45,58 @@ Use your built `build/index.js` as the command target.
|
|
|
89
45
|
}
|
|
90
46
|
```
|
|
91
47
|
|
|
92
|
-
##
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
48
|
+
## Features
|
|
49
|
+
- `arduino_cli_doctor` and `install_arduino_cli` for dependency bootstrap
|
|
50
|
+
- `detect_hardware` with board/FQBN inference and user-confirmation guidance
|
|
51
|
+
- `ensure_core_installed` with automatic core setup from FQBN
|
|
52
|
+
- `compile_sketch` and `upload_sketch` with optional auto core install
|
|
53
|
+
- Serial monitoring and board/port listing tools
|
|
54
|
+
- Local board reference resource and setup prompts
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
- Node.js 20+
|
|
58
|
+
- `arduino-cli` available on `PATH` (or let the server install it via tools)
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
- `ARDUINO_CLI_PATH`: Arduino CLI command/path (default: `arduino-cli`)
|
|
62
|
+
- `ARDUINO_SKETCH_ROOT`: optional absolute root for sketch operations
|
|
63
|
+
|
|
64
|
+
## MCP Surface
|
|
65
|
+
Tools:
|
|
66
|
+
- `arduino_cli_doctor`
|
|
67
|
+
- `install_arduino_cli`
|
|
68
|
+
- `detect_hardware`
|
|
69
|
+
- `ensure_core_installed`
|
|
70
|
+
- `compile_sketch`
|
|
71
|
+
- `upload_sketch`
|
|
72
|
+
- `read_serial_snapshot`
|
|
73
|
+
- `list_connected_boards`
|
|
74
|
+
- `list_supported_boards`
|
|
75
|
+
- `list_serial_ports`
|
|
76
|
+
- `get_board_details`
|
|
77
|
+
- `list_board_reference`
|
|
78
|
+
- `search_board_reference`
|
|
79
|
+
|
|
80
|
+
Resources:
|
|
81
|
+
- `arduino://boards/reference`
|
|
82
|
+
|
|
83
|
+
Prompts:
|
|
84
|
+
- `arduino-cli-bootstrap-policy`
|
|
85
|
+
- `arduino-setup-assistant`
|
|
86
|
+
|
|
87
|
+
## Development
|
|
88
|
+
```bash
|
|
89
|
+
git clone https://github.com/akshatnerella/arduino-mcp-server
|
|
90
|
+
cd arduino-mcp-server
|
|
91
|
+
npm install
|
|
92
|
+
npm run typecheck
|
|
93
|
+
npm run build
|
|
94
|
+
npm run dev
|
|
124
95
|
```
|
|
96
|
+
|
|
97
|
+
## Release
|
|
98
|
+
- PRs into `main` must come from `release/*` branches.
|
|
99
|
+
- PRs must include exactly one bump label: `patch`, `minor`, or `major`.
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
MIT, see [LICENSE](LICENSE).
|