Meshtastic MCP Server
A Model Context Protocol (MCP) server that enables Claude and other AI assistants to interact with Meshtastic mesh networks for off-grid communication.
Features
Connection & Discovery
π Connect to Meshtastic devices via Serial (USB), TCP/IP, or Bluetooth
π Scan for nearby Bluetooth devices
Messaging
π¬ Send and receive text messages on the mesh network
π¨ Send high-priority alert messages
π₯ Retrieve message history
Network Analysis
π‘ Query node information and network topology
πΊοΈ Send traceroute requests with SNR data
π Request and monitor telemetry (device metrics, environment, power, air quality)
πΆ View formatted network information
Location & Navigation
π Share GPS positions
π Send waypoints (points of interest) with icons and expiration
ποΈ Delete waypoints
Device Management
π» List configured channels
βοΈ Get device metadata (firmware, hardware model)
π€ Set device owner name and license status
π Reboot or shutdown devices
Installation
Prerequisites
Python 3.10 or higher
A Meshtastic device (connected via USB or network)
Claude Desktop app or MCP-compatible client
Setup
Clone or create the project directory:
Install dependencies:
Make the server executable:
Configuration
This MCP server works with multiple AI assistants and IDEs. Choose your preferred client:
Quick Setup - Claude Desktop
Add the following to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Replace /absolute/path/to/meshtastic-mcp/ with the actual path to your installation.
Other Clients
See
π Windsurf IDE - AI-powered development environment
π Cursor IDE - AI-first code editor
π¬ ChatGPT Desktop - OpenAI's desktop app
π§ Generic MCP clients - Any MCP-compatible tool
Each client has specific configuration paths and setup steps detailed in the guide.
Usage
Once configured, you can use natural language with Claude to interact with your Meshtastic device:
Connect to Device
Send Messages
Network Discovery & Analysis
Location & Waypoints
Device Management
Read Messages
Available Tools
The MCP server exposes the following tools:
Connection
connect- Connect to a Meshtastic device (serial/TCP/Bluetooth)scan_bluetooth- Scan for nearby Meshtastic devices via Bluetooth
Messaging
send_message- Send text messages to nodes or channelssend_alert- Send high-priority alert messagesget_messages- Retrieve recent received messages
Network Discovery
get_nodes- List all nodes in the mesh networkget_node_info- Get detailed info about a specific nodeget_local_node- Get info about the connected deviceshow_network_info- Get formatted network information
Traceroute
send_traceroute- Send traceroute request to discover path and SNRget_traceroute_results- Retrieve traceroute results
Telemetry
send_telemetry_request- Request device/environment/power/air quality metricsget_telemetry_results- Retrieve telemetry data
Location
send_position- Broadcast GPS coordinates
Waypoints
send_waypoint- Create a waypoint (point of interest)delete_waypoint- Delete a waypoint
Device Management
get_channels- List configured channelsget_device_metadata- Get hardware and firmware informationset_owner- Set device owner name and license statusreboot_node- Reboot the deviceshutdown_node- Shutdown the device
Troubleshooting
Serial Connection Issues
If you have permission issues accessing serial devices:
Linux:
MacOS:
No special permissions needed typically, but ensure the device appears in /dev/tty.*
Finding Your Device
Serial (USB):
Linux: Usually
/dev/ttyUSB0or/dev/ttyACM0MacOS: Usually
/dev/tty.usbserial-*Windows: Usually
COM3,COM4, etc.
TCP/IP:
Check your device's WiFi settings in the Meshtastic app
Default hostname is often
meshtastic.localOr use the IP address directly
Bluetooth:
Use the scan feature:
python test_connection.py --type scanNote the MAC address (e.g.,
AA:BB:CC:DD:EE:FF)See BLUETOOTH.md for detailed Bluetooth setup guide
Message History
The server maintains a message history in memory. This resets when the server restarts. For persistent storage, consider extending the server to save messages to a database.
Development
Project Structure
Extending the Server
To add new tools:
Add a new
Tooldefinition inlist_tools()Add the corresponding handler in
call_tool()Use the
meshtasticPython library for device interaction
Example: Adding a Custom Tool
Security Considerations
The server has full access to your Meshtastic device
Messages are sent over LoRa radio and can be received by anyone in range
Consider encryption settings in your Meshtastic configuration
Be cautious about sharing sensitive information over the mesh
License
MIT License - Feel free to use and modify as needed.
Resources
Client Configuration Guide - Setup for Windsurf, Cursor, ChatGPT, and more
Bluetooth Setup Guide - Detailed guide for BLE connections
Contributing
Contributions welcome! Some ideas for enhancements:
Implement message persistence (database storage)
Add file transfer capabilities
Support for admin messages and remote configuration
Group/DM channel creation
Statistics and analytics dashboards
Automated network health monitoring
Multi-device support
Support
For issues related to:
Meshtastic device/firmware: See Meshtastic Discord
MCP protocol: See MCP Documentation
This server: Open an issue in the repository
This server cannot be installed