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>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-17 22:33:41 +00:00
committed by GitHub
co-authored by thebentern
parent ec3c8378ef
commit bab808cf62
9 changed files with 72 additions and 28 deletions
+3 -3
View File
@@ -49,9 +49,9 @@ pytest tests/ --force-bake --html=report.html
- `MESHTASTIC_FIRMWARE_ROOT` — firmware repo path (defaults to `../` from tests/)
- `MESHTASTIC_MCP_ENV_NRF52` — PlatformIO env for the nRF52 role (default
`heltec-mesh-node-t114`)
`rak4631`)
- `MESHTASTIC_MCP_ENV_ESP32S3` — PlatformIO env for the ESP32-S3 role (default
`t-beam-1w`)
`heltec-v3`)
- `MESHTASTIC_MCP_SEED` — override the session PSK seed (default:
`pytest-<unix-ts>`). Set this to reproduce a specific failing run.
@@ -85,7 +85,7 @@ predicate(), timeout=60)` replaces flaky `time.sleep()` patterns.
`pytest --junitxml=junit.xml` produces CI-integration XML.
`tool_coverage.json` is emitted at session end in the tests directory — shows
which of the 37 MCP tools the run exercised. Useful for closing test gaps.
which of the 38 MCP tools the run exercised. Useful for closing test gaps.
## Adding a new test
+3 -1
View File
@@ -1,7 +1,7 @@
"""Tool-surface coverage: track which MCP tools the test suite actually exercises.
This is NOT line coverage (that's `coverage.py`). This measures which of the
37 public MCP tools in `meshtastic_mcp.server` got invoked during a pytest
38 public MCP tools in `meshtastic_mcp.server` got invoked during a pytest
run — a quick signal for "where are the test-coverage gaps".
Approach: introspect `meshtastic_mcp.server.app` for registered tools, find
@@ -57,6 +57,7 @@ _TOOL_MAP: dict[str, tuple[str, str]] = {
# Serial log sessions — module-level functions on serial_session
"serial_open": ("meshtastic_mcp.serial_session", "open_session"),
"serial_read": ("meshtastic_mcp.serial_session", "read_session"),
"serial_list": ("meshtastic_mcp.registry", "all_sessions"),
"serial_close": ("meshtastic_mcp.serial_session", "close_session"),
# Device reads
"device_info": ("meshtastic_mcp.info", "device_info"),
@@ -67,6 +68,7 @@ _TOOL_MAP: dict[str, tuple[str, str]] = {
"set_config": ("meshtastic_mcp.admin", "set_config"),
"get_channel_url": ("meshtastic_mcp.admin", "get_channel_url"),
"set_channel_url": ("meshtastic_mcp.admin", "set_channel_url"),
"set_debug_log_api": ("meshtastic_mcp.admin", "set_debug_log_api"),
"send_text": ("meshtastic_mcp.admin", "send_text"),
"reboot": ("meshtastic_mcp.admin", "reboot"),
"shutdown": ("meshtastic_mcp.admin", "shutdown"),
@@ -8,7 +8,6 @@ produce confusing mismatches.
from __future__ import annotations
import shutil
from pathlib import Path
import pytest