LUNA
ESP32-based Streamable HTTP MCP server with embedded Lua scripting engine. Bridges Claude AI to physical devices β telescopes (INDI protocol), sensors, BLE peripherals, and TCP devices. Flash-and-run binary distribution, no build required.
README
LUNA
An open Physical AI platform based on ESP32 & Lua that connects LLMs to telescopes, mounts, and legacy instruments for fully autonomous observation.
MCP Server + Lua Scripting Engine on ESP32
Let Claude AI control your telescope, camera, and entire observatory β in plain language.
LUNA Docs (NotebookLM)
π LUNA Docs β Start here for setup guides, technical references, and FAQ. Ask questions directly inside NotebookLM and get answers from the official documentation. π https://notebooklm.google.com/notebook/f2ce997f-18c2-44c4-8738-973b204c190c
π¬ AiBridgeMCP Community β Join our Facebook group to ask questions, share your results, and connect with other users. The developer is also a member. Everyone is welcome. π https://www.facebook.com/groups/1230935959149731
π What's New in v8.9.7 2026-06-04
LUNA v8.9.7 is now officially released! This update introduces exciting wireless capabilities and major enhancements:
- BLE 5.0 Support: Fully integrates Bluetooth Low Energy 5.0 for seamless wireless device connectivity.
- LUNA Node (Sub Network): Introduces wireless sub-device support with no pairing limitsβrun autonomous Lua scripts remotely on child nodes!
- Optimized Stability: Built on FreeRTOS dual-core architecture to ensure stable MCP and Lua execution.
β οΈ Important: To ensure all features and APIs work correctly, please run the
get_lua_guidetool immediately after connecting Claude to the LUNA MCP server.
For full flash binaries and auto-setup tools, check out the latest GitHub Releases.
What is LUNA?
LUNA is a firmware for ESP32 that turns it into an MCP (Model Context Protocol) server with a built-in Lua scripting engine.
Connect LUNA to your telescope or observatory equipment, then control everything through Claude AI β in plain language.
You βββ Claude AI βββ LUNA (ESP32) βββ Telescope / Serial Device
"Go to M42" serial command π slews
You βββ Claude AI βββ LUNA (ESP32) βββ NINA (PC) βββ Camera / Focuser / Guider
"Image M42 tonight" HTTP API π full automation
LUNA runs Lua scripts autonomously on the ESP32. Claude writes the scripts, deploys them, and monitors results β all through the MCP protocol.


β New in v5.9.3 β Vixen Mount Support (UDP)
LUNA now supports Vixen Wireless Unit mounts (AXD, SXP, SXD2, AP, SX2, AXJ, SXP2) via UDP, and Vixen STAR BOOK TEN via HTTP β all through the new udp.* Lua module.
| Mount | Protocol | Connection |
|---|---|---|
| Vixen Wireless Unit (AXD/SXP/SXD2/AP/SX2/AXJ/SXP2) | UDP | 192.168.6.1 : 60023 |
| Vixen STAR BOOK TEN | HTTP GET | 169.254.1.1 : 80 |
-- Example: slew Vixen Wireless Unit to a target
udp.begin(50000)
udp.connect("192.168.6.1", 60023)
udp.write("$MTTGT=1,83.82,β5.39,Orion Nebula\r\n")
udp.write("$MTMV2\r\n")
local resp = udp.read(2000)
udp.close()
log.write("GoTo response: " .. (resp or "timeout"))
Claude knows the full Vixen command set internally via
vixen_guideβ just tell it where to point.
β New in v5.9.2 β NINA Astrophotography Integration
LUNA now controls NINA (Nighttime Imaging 'N' Astronomy) β the world's most popular free astrophotography software β directly via its HTTP API.
What this means
| Without LUNA | With LUNA + NINA |
|---|---|
| Build sequences manually (30β50 settings) | Just tell Claude what you want to image |
| Start imaging manually | "Image M42 at 3 min, 20 frames" β done |
| Configure each device separately | Claude coordinates telescope, camera, focuser, guider, dome, and weather sensor together |
| Troubleshoot errors yourself | Claude explains what went wrong and suggests fixes |
Verified working (2026-03-27)
β
Camera connection and status
β
Capture start / stop
β
Autofocus
β
Filter wheel control
β
Sequence start / stop
β
Guider start / stop
β
ASCOM / Alpaca device control (switch, weather sensor)
β
Stellarium integration
How it works
"Image M42 tonight"
β Check weather sensors β safe to observe? (LUNA + Alpaca)
β‘ Slew telescope to M42 (Alpaca)
β’ Run autofocus (NINA HTTP API)
β£ Test exposure β plate solve β correct pointing (NINA HTTP API)
β€ Start main imaging sequence (NINA HTTP API)
β₯ Re-focus periodically as temperature drops (NINA HTTP API)
β¦ Auto-abort if weather deteriorates (LUNA monitoring)
NINA is the "hands", Claude is the "brain", LUNA is the "nervous system."
Requirements for NINA integration
- NINA v3.x β nighttime-imaging.eu (free)
- NINA Advanced API plugin (free, installed from within NINA)
- Port: 1888 (default), API Enabled: ON
- LUNA and the NINA PC on the same WiFi network
Key Features
- MCP Server β connects directly to Claude via the Model Context Protocol
- Lua 5.1 scripting engine β write, save, and run scripts on the ESP32
- Autonomous operation β scripts run independently; Claude monitors and intervenes as needed
- Vixen mount support β Wireless Unit (UDP) and STAR BOOK TEN (HTTP) via new
udp.*module (v5.9.3) - NINA integration β control astrophotography software via HTTP POST (v5.9.2)
- http module β
http.get/http.put/http.postfor ASCOM/Alpaca, NINA Advanced API, and Vixen STAR BOOK TEN - udp module β
udp.begin/udp.connect/udp.write/udp.read/udp.closefor Vixen Wireless Unit (v5.9.3) - MCP Resources β Claude reads device state naturally, like reading a gauge
- Script-to-script data passing β
log.save()/log.load()enable stateful workflows without Claude - Serial device control β full RS-232C control via
serial.query(),serial.write(),serial.read() - FreeRTOS dual-core β MCP server and Lua engine run on separate cores; no blocking
Supported Devices
| Variant | Baud Rate | Target Devices |
|---|---|---|
| LUNA Standard | 9,600 bps | Meade LX200, OnStep, LX200-compatible mounts |
| LUNA Temma2 | 19,200 bps | Takahashi Temma2 |
PC Software Integration (v5.9.2+)
| Software | Protocol | Port |
|---|---|---|
| NINA Advanced API | HTTP POST/GET | 1888 |
| Stellarium Remote Control | HTTP POST/GET | 8090 |
| ASCOM / Alpaca devices | HTTP GET/PUT | varies |
Vixen Mount Integration (v5.9.3)
| Mount | Protocol | Address |
|---|---|---|
| Vixen Wireless Unit (AXD/SXP/SXD2/AP/SX2/AXJ/SXP2) | UDP | 192.168.6.1 : 60023 |
| Vixen STAR BOOK TEN | HTTP GET | 169.254.1.1 : 80 |
LUNA works with any RS-232C serial device and any ASCOM/Alpaca-compatible device on your LAN.
Requirements
Hardware
- ESP32 development board (ESP32-DevKitC or compatible)
- RS-232C interface circuit (MAX3232 or equivalent)
- Power: 5V via micro USB (power bank or USB charger)
Ready-to-use LUNA boards (LUNA OnStepNinja V2 β pre-wired, pre-flashed) are available from the author.
Software / Service
- Claude Desktop (free)
- MCP connector (included in the GitHub Releases download package)
Getting Started
Step 1 β Flash the Firmware
Download the firmware binary from GitHub Releases:
| File | Target |
|---|---|
LUNA_v5.9.3_Standard.bin |
LX200 / OnStep (9600 bps) |
LUNA_v5.9.3_Temma2.bin |
Takahashi Temma2 (19200 bps) |
Flash to your ESP32 using esptool or ESP32 Flash Download Tool.
π See LUNA_Quick_Setup_Guide.md for full instructions.
Step 2 β Connect Claude Desktop to LUNA
Configure Claude Desktop using the MCP connector included in the download package.
π See LUNA_Quick_Setup_Guide.md for the 3-step setup.
Step 3 β Start talking to your telescope
You: "Go to M42"
Claude: β slews telescope to M42
You: "Image M42 tonight, 3 minutes per frame, 20 frames"
Claude: β autofocuses, plate solves, starts NINA sequence
Example: Full Observatory Automation
-- LUNA Lua script: check weather, then start NINA sequence
local resp, code = http.get(
"http://192.168.x.x/api/v1/observingconditions/0/humidity", 2000)
if code == 200 then
local humidity = -- parse resp
if humidity < 80 then
http.post("http://192.168.x.x:1888/v2/api/sequence/start", "{}",
"application/json", 3000)
log.write("Sequence started. Humidity: " .. humidity .. "%")
else
notify.set("Humidity too high (" .. humidity .. "%). Imaging skipped.")
end
end
MCP Tools Available to Claude
| Tool | Description |
|---|---|
lua_exec |
Execute a Lua script immediately |
lua_save |
Save a script to the ESP32 (SPIFFS) |
lua_run |
Run a saved script asynchronously |
lua_status |
Check execution state and results |
lua_log |
Read the script log buffer |
lua_stop |
Stop a running script |
lua_list |
List saved scripts |
serial_query |
Send a command and read response |
serial_write |
Send a raw serial command |
serial_read |
Read serial data |
fs_read |
Read a file from ESP32 storage |
fs_write |
Write a file to ESP32 storage |
check_notify |
Receive async notifications from Lua scripts |
Lua API (inside scripts)
-- Serial control
serial.write(cmd)
serial.read(timeout_ms)
serial.query(cmd, timeout_ms)
-- HTTP (LAN only β ASCOM/Alpaca/NINA/Stellarium/Vixen STAR BOOK TEN)
http.get(url, timeout_ms)
http.put(url, body, content_type, timeout_ms)
http.post(url, body, content_type, timeout_ms) -- v5.9.2
-- UDP (Vixen Wireless Unit) -- v5.9.3
udp.begin(local_port)
udp.connect(host, port)
udp.write(data)
udp.read([timeout_ms])
udp.close()
-- Logging & data passing
log.write(message)
log.read([n]) -- n omitted = latest line
log.save() -- persist to flash
log.load() -- restore from flash
-- Hardware
hw.delay(ms)
hw.millis()
hw.free_heap()
hw.led(0 or 1)
-- Notify Claude
notify.set("message")
-- Script chaining
luna.run("next_script_name")
Hardware
LUNA OnStepNinja V2 β pre-built board available from the author:
- Pre-flashed with LUNA v5.9.3
- RS-232C connector (D-sub 9-pin) included
- Power: 5V micro USB
- Compatible with NS-5000, OnStep, and LX200-compatible mounts
β οΈ Cable note: Use a straight RS-232C cable between LUNA and a PC. Use a cross cable between LUNA and NS-5000 / OnStep.
Contact: GitHub Issues
Documentation
| Document | Description |
|---|---|
| LUNA_Quick_Setup_Guide.md | First-time setup (3 steps) |
| LUNA_USER_MANUAL.md | Full reference manual |
| LUNA_Lua_Guide.md | Lua scripting guide |
π LUNA Docs on NotebookLM β Ask questions about LUNA directly.
License
The LUNA firmware binary is distributed under the MIT License. Source code is proprietary and not published.
Copyright Β© 2026 Nishioka Sadahiko
Third-Party Licenses
LUNA incorporates Lua 5.1, distributed under the MIT License:
Copyright Β© 1994β2012 Lua.org, PUC-Rio. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
See also: https://www.lua.org/license.html
Author
Nishioka Sadahiko GitHub: @OnStepNinja
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.