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.
Files changed (3) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +77 -99
  3. 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
- # arduino-mcp-server
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
- ## Features
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
- If needed, set `ARDUINO_CLI_PATH`:
50
- - PowerShell (current session): `$env:ARDUINO_CLI_PATH='C:\\path\\to\\arduino-cli.exe'`
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
- ## Run
60
- ```bash
61
- npm start
62
- ```
12
+ Add to your AI agent MCP config.
63
13
 
64
- For local development:
14
+ Claude Desktop (`claude_desktop_config.json`):
65
15
 
66
- ```bash
67
- npm run dev
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
- ## Environment variables
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": "node",
82
- "args": ["D:/Projects/arduino-mcp-server/build/index.js"],
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
- ## Board Reference Data
93
- The server includes a starter board reference database at `data/board-reference.json` with common pin mappings.
94
- You can expand this file or replace it with data from an external source later.
95
-
96
- ## MCP Capability Coverage
97
- - Tools: compile/upload/monitor/board discovery and reference lookup
98
- - Resource: `arduino://boards/reference` for board metadata
99
- - Prompts:
100
- - `arduino-cli-bootstrap-policy` for dependency/bootstrap behavior
101
- - `arduino-setup-assistant` for wiring/setup guidance
102
-
103
- ## Publish To MCP Registry
104
- This repo includes a registry manifest at `server.json`.
105
-
106
- ### Prerequisites
107
- 1. Publish the npm package first (`identifier` and `version` in `server.json` must exist):
108
- - `npm login`
109
- - `npm run build`
110
- - `npm publish --access public`
111
- 2. Get a registry auth token (Bearer token) for `registry.modelcontextprotocol.io`.
112
-
113
- ### Publish command
114
- PowerShell:
115
-
116
- ```powershell
117
- $env:MCP_REGISTRY_TOKEN="<your_registry_token>"
118
- curl --request POST `
119
- --url https://registry.modelcontextprotocol.io/v0.1/publish `
120
- --header "Accept: application/json, application/problem+json" `
121
- --header "Authorization: Bearer $env:MCP_REGISTRY_TOKEN" `
122
- --header "Content-Type: application/json" `
123
- --data-binary "@server.json"
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).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arduino-mcp-server",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Arduino CLI wrapper MCP server",
5
5
  "type": "module",
6
6
  "main": "build/index.js",