MCP.so
Sign In
Servers

ESP32 MCP Server

@navado

Allow AI models connect to ESP32 and read connected sensors NMEA2k, ODB/ODBII, NMEA0183. AI generated MCP server.

Overview

What is ESP32 MCP Server?

ESP32 MCP Server is a Model Context Protocol (MCP) server that runs on ESP32 microcontrollers (and Nordic nRF52840 in sensor-only mode). It exposes real-world sensor data and bus protocols to AI assistants and automation tools over WebSocket / JSON‑RPC 2.0, enabling direct hardware interaction from MCP clients.

How to use ESP32 MCP Server?

Clone the repository, install library dependencies with PlatformIO, build and flash the firmware, then upload web assets to LittleFS (optional). On first run, connect to the board’s WiFi AP (ESP32_XXXXXX), open http://192.168.4.1, enter your WiFi credentials, and the board will join your network. Connect any MCP client to ws://<IP>:9000 to start querying sensors, bus data, and bus history.

Key features of ESP32 MCP Server

  • MCP protocol (JSON‑RPC 2.0 over WebSocket) with resource discovery and subscriptions
  • I2C sensor auto‑scan and drivers for BME280, MPU6050, ADS1115, SHT31, BH1750, INA219
  • NMEA 0183 parser (GGA, RMC, VTG, GSV, MWV, DBT, DPT, HDG, HDT) with XOR checksum validation
  • NMEA 2000 / CAN decoding (position, heading, speed, depth, wind, attitude, water temperature)
  • OBD‑II / CAN decoding (60+ PIDs, service 01/09)
  • Persistent ring buffers for bus history (CAN, NMEA, NMEA 2000, OBD‑II) queryable via MCP
  • WiFi setup UI + STA mode; mDNS and UDP discovery; web dashboard and HTTP endpoints

Use cases of ESP32 MCP Server

  • Query live I2C sensor readings (temperature, humidity, pressure, IMU) from an AI assistant
  • Parse NMEA 0183 GPS/marine data from a chart plotter or GPS module and expose it via MCP
  • Decode NMEA 2000 or OBD‑II CAN frames for vessel telemetry or vehicle diagnostics
  • Replay recorded bus history (CAN, serial) for offline analysis or simulation
  • Integrate hardware sensors and serial/CAN buses into an MCP‑based automation pipeline

FAQ from ESP32 MCP Server

Which boards are supported?

ESP32‑S3, ESP32, ESP32‑C3, Adafruit HUZZAH32, and M5Stack Core run the full MCP server (WiFi + WebSocket + CAN). Nordic nRF52840‑DK and Adafruit Feather nRF52840 run in sensor‑only mode (I2C + serial output, no WiFi, no MCP).

What sensors are supported out of the box?

Supported I2C sensors include BME280 (temperature/humidity/pressure), MPU6050 (6‑axis IMU), ADS1115 (ADC), SHT31 (humidity/temperature), BH1750 (light), and INA219 (current/voltage). Driver auto‑detection runs during I2C scan.

How do I connect the server to my network?

Power the board; it broadcasts a WiFi AP named ESP32_XXXXXX. Connect to it, open http://192.168.4.1, enter your WiFi credentials, and save. The board joins your network and prints its IP address on the serial console.

What is the nRF52840 mode?

nRF52840 boards run a separate entry point (main_nrf.cpp) that provides sensors + I2C + serial output only — no WiFi, no MCP WebSocket, no LittleFS, no bus history. For full MCP‑over‑WiFi functionality, bridge via an ESP32‑C3 in AT‑command mode connected to UART1.

What transport and protocol does the server use?

The MCP server communicates over WebSocket on port 9000 using JSON‑RPC 2.0. A browser dashboard and WiFi setup are served over HTTP on port 80. The server also advertises itself via mDNS (_mcp._tcp) and UDP capability broadcasts.

Tags

More from Other