Skip to content

Add MCP server for interacting with meshtastic devices and testing framework / TUI#10194

Merged
thebentern merged 17 commits intodevelopfrom
mcp-server
Apr 18, 2026
Merged

Add MCP server for interacting with meshtastic devices and testing framework / TUI#10194
thebentern merged 17 commits intodevelopfrom
mcp-server

Conversation

@thebentern
Copy link
Copy Markdown
Contributor

No description provided.

@thebentern thebentern requested a review from Copilot April 17, 2026 22:23
@github-actions github-actions bot added needs-review Needs human review enhancement New feature or request labels Apr 17, 2026
@thebentern thebentern added the needs-tacos Every night can be taco night label Apr 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Python-based MCP server (mcp-server/) to interact with Meshtastic firmware builds and USB-connected devices (build/flash/monitor/admin), plus a tiered pytest hardware test harness and supporting operator + agent documentation.

Changes:

  • Introduces the meshtastic_mcp package with PlatformIO + vendor-tool wrappers, serial monitor sessions, device discovery, and meshtastic-python admin/info operations.
  • Adds a tiered pytest suite (unit + hardware tiers), a wrapper runner script (run-tests.sh), and tooling for test/TUI artifacts (flash log tailing, fwlog tailing, reproducer bundles, tool-coverage reporting).
  • Adds repo-level agent guidance and Copilot/Claude prompt content for running/diagnosing/reproducing the hardware test suite.

Reviewed changes

Copilot reviewed 63 out of 72 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
mcp-server/tests/unit/test_userprefs_parse.py Unit tests for userPrefs parsing/overrides
mcp-server/tests/unit/test_testing_profile.py Unit tests for testing-profile + PSK generator
mcp-server/tests/unit/test_pio_wrapper.py Unit tests for pio wrapper utilities
mcp-server/tests/unit/test_boards.py Unit tests for PlatformIO env enumeration
mcp-server/tests/unit/init.py Unit test package marker
mcp-server/tests/tool_coverage.py MCP tool invocation coverage shim/report
mcp-server/tests/test_00_bake.py Session bake/flash orchestration test
mcp-server/tests/telemetry/test_placeholders.py Telemetry roadmap placeholders (skipped)
mcp-server/tests/telemetry/test_device_telemetry_broadcast.py Device telemetry broadcast integration test
mcp-server/tests/telemetry/init.py Telemetry test package marker
mcp-server/tests/provisioning/test_userprefs_survive_factory_reset.py Provisioning reset behavior integration test
mcp-server/tests/provisioning/test_unset_region_blocks_tx.py Negative provisioning test (currently skipped)
mcp-server/tests/provisioning/test_placeholders.py Provisioning roadmap placeholders (skipped)
mcp-server/tests/provisioning/test_bake_region_modem_slot.py Provisioning bake correctness integration test
mcp-server/tests/provisioning/test_admin_key_baked.py Admin-key bake test (currently skipped)
mcp-server/tests/provisioning/init.py Provisioning test package marker
mcp-server/tests/monitor/test_placeholders.py Monitor roadmap placeholders (skipped)
mcp-server/tests/monitor/test_boot_log_no_panic.py Boot-log panic marker integration test
mcp-server/tests/monitor/init.py Monitor test package marker
mcp-server/tests/mesh/test_placeholders.py Mesh roadmap placeholders (skipped)
mcp-server/tests/mesh/test_mesh_formation.py Mesh formation integration test
mcp-server/tests/mesh/test_direct_with_ack.py Directed send + ACK integration test
mcp-server/tests/mesh/test_broadcast_delivers.py Broadcast delivery integration test
mcp-server/tests/mesh/test_bidirectional.py Multi-role bidirectional comms test
mcp-server/tests/mesh/_receive.py Shared pubsub receive collector helper
mcp-server/tests/mesh/init.py Mesh test package marker
mcp-server/tests/fleet/test_psk_seed_isolates_runs.py Seed isolation property test
mcp-server/tests/fleet/test_placeholders.py Fleet roadmap placeholders (skipped)
mcp-server/tests/fleet/init.py Fleet test package marker
mcp-server/tests/admin/test_placeholders.py Admin roadmap placeholders (skipped)
mcp-server/tests/admin/test_owner_survives_reboot.py Owner persistence integration test
mcp-server/tests/admin/test_channel_url_roundtrip.py Channel URL round-trip integration test
mcp-server/tests/admin/init.py Admin test package marker
mcp-server/tests/init.py Tests package marker
mcp-server/tests/README.md Test harness operator documentation
mcp-server/src/meshtastic_mcp/serial_session.py Long-running pio device monitor sessions
mcp-server/src/meshtastic_mcp/registry.py Session registry + per-port locks
mcp-server/src/meshtastic_mcp/pio.py PlatformIO subprocess wrapper + streaming tee
mcp-server/src/meshtastic_mcp/info.py Read-only device queries
mcp-server/src/meshtastic_mcp/hw_tools.py Vendor tool wrappers (esptool/nrfutil/picotool)
mcp-server/src/meshtastic_mcp/flash.py Build/flash/1200bps touch utilities
mcp-server/src/meshtastic_mcp/devices.py Serial device discovery/enrichment
mcp-server/src/meshtastic_mcp/connection.py Port resolution + exclusive locking + connect ctx
mcp-server/src/meshtastic_mcp/config.py Firmware root + binary resolution helpers
mcp-server/src/meshtastic_mcp/cli/_reproducer.py Failure reproducer bundle builder
mcp-server/src/meshtastic_mcp/cli/_history.py Cross-run history + sparkline helper
mcp-server/src/meshtastic_mcp/cli/_fwlog.py Firmware log JSONL tailer worker
mcp-server/src/meshtastic_mcp/cli/_flashlog.py Flash-log tailer worker
mcp-server/src/meshtastic_mcp/cli/init.py CLI package marker/docs
mcp-server/src/meshtastic_mcp/boards.py PlatformIO env parsing + caching + filters
mcp-server/src/meshtastic_mcp/admin.py Admin operations (config/channels/messaging/actions)
mcp-server/src/meshtastic_mcp/main.py python -m meshtastic_mcp entry point
mcp-server/src/meshtastic_mcp/init.py Package metadata/version
mcp-server/run-tests.sh Hardware test runner wrapper + preflight
mcp-server/pyproject.toml Packaging + dependencies + scripts
mcp-server/README.md MCP server operator documentation
mcp-server/.gitignore Ignore test artifacts + venv
AGENTS.md Repo agent guidance + MCP/test harness refs
.mcp.json MCP server registration (currently machine-specific)
.gitignore Repo ignore updates (session sidecar, lock)
.github/prompts/mcp-test.prompt.md Copilot prompt: run/interpret suite
.github/prompts/mcp-repro.prompt.md Copilot prompt: flake repro/diff
.github/prompts/mcp-diagnose.prompt.md Copilot prompt: device health report
.github/copilot-instructions.md Agent instructions: MCP + HIL test harness section
.claude/commands/test.md Claude command: run/interpret suite
.claude/commands/repro.md Claude command: flake repro/diff
.claude/commands/diagnose.md Claude command: device health report
.claude/commands/README.md Claude commands index

Comment thread mcp-server/README.md Outdated
Comment thread mcp-server/src/meshtastic_mcp/flash.py
Comment thread mcp-server/src/meshtastic_mcp/serial_session.py
Comment thread mcp-server/src/meshtastic_mcp/registry.py Outdated
Comment thread .mcp.json
Comment thread mcp-server/tests/tool_coverage.py
Comment thread mcp-server/tests/README.md
Comment thread mcp-server/tests/unit/test_userprefs_parse.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@thebentern
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/91dc128a-ed50-4d07-8bb2-3dc6623a05f7

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 17, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot apply changes based on the comments in this thread

Applied the requested fixes from that review thread in commit bab808c.

This includes: timeout-safe 1200bps touch behavior, env-resolved serial metadata fixes, dead-session registry cleanup, tool coverage map alignment with all registered tools, corrected test README env defaults, removal of the unused import, and replacing machine-specific .mcp.json paths with repo-relative values.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 67 out of 76 changed files in this pull request and generated 3 comments.

Comment thread mcp-server/src/meshtastic_mcp/pio.py
Comment thread mcp-server/src/meshtastic_mcp/cli/_history.py
Comment thread mcp-server/src/meshtastic_mcp/connection.py
Copilot AI and others added 2 commits April 17, 2026 23:58
Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
@thebentern thebentern merged commit c8dac10 into develop Apr 18, 2026
124 of 132 checks passed
thebentern added a commit that referenced this pull request Apr 18, 2026
…amework / TUI (#10194)

* Start of MCP server and test suite

* Add MCP server for interacting with meshtastic devices and testing framework / TUI

* Update mcp-server/README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix mcp-server review feedback from thread

Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/91dc128a-ed50-4d07-8bb2-3dc6623a05f7

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Enhance StreamAPI and PhoneAPI for improved log record handling and concurrency control

* Semgrep fixes

* Trunk and semgrep fixes

* optimize pio streaming tee file writes

Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* chore: remove redundant log handle assignment

Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Consolidate type imports and remove placeholder test files

* Add tests for config persistence and more exchange messages

* Refactor position test to validate on-demand request/reply behavior

* Remove  position request/reply test and update README for telemetry behavior

* Fix transmit history file to get removed on factory reset

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs-review Needs human review needs-tacos Every night can be taco night

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants