Skip to main content
Glama

Neil MCP

An MCP server that lets Claude drive Neil, a 4-motor robot built with LEGO® SPIKE™ Prime elements. It controls a Raspberry Pi with a Build HAT, sees through a Pi Camera on the robot, and uses an iPhone that overlooks the scene as an external camera.

New to Neil? Start at neil-robot.github.io to see what it offers: videos of Neil at work, how to build one, Neil in research, and teaching Physical AI with it. Neil runs two kinds of AI on the same hardware, each in its own repo:

Repo

How you give Neil a task

neil-mcp (this repo)

Tell it. Type a task in plain words, and an LLM agent such as Claude Code carries it out with Neil's MCP tools.

neil-vla

Show it. Drive Neil through the task with a gamepad a few dozen times, and a vision-language-action model learns it from the recordings.

From parts to a first task

  1. Build Neil from the parts list and the wiring in Hardware; the site shows the build, and the step-by-step instructions are on Gumroad.

  2. Set up the Pi, the phone camera and this repo, and tell the code where the Pi and the phone are: Setup.

  3. Give Claude Code a task, such as "grab the red cup": Usage.

Related MCP server: SO-ARM100 Robot Control MCP

Hardware

Neil's digital model, made in BrickLink Studio

Bill of materials

Item

Qty.

Price each

Notes / link

Raspberry Pi 4 Model B

1

$35+

Runs the MCP robot scripts

Argon NEO Case for Raspberry Pi 4

1

$16

Holds the Pi on the deck; used without its top lid, so the Build HAT sits on the Pi

Raspberry Pi Build HAT

1

$30

Connects and controls the LEGO motors

Build HAT power supply

1

$16

8 V, 6 A (48 W), barrel jack; motors cannot run from USB power

LEGO SPIKE Prime Set (45678)

1

$400

LEGO structural parts, wheels, 1 Large Angular Motor, and 1 Medium Angular Motor; SPIKE hub is not used. Retired by LEGO in 2026, so the price is for a used set

LEGO Technic Large Angular Motor (45602)

2

$50

Additional motors; with the one in the SPIKE set, provides 3 large motors for the wheels and arm. The price is for a used motor

Raspberry Pi Camera Module documentation

1

$20

Camera v1 (OV5647), mounted facing forward

iPhone with SimpleIPCamera

1

—

Existing phone used as the overhead camera

Generic USB Game Controller

1

$5

Any USB gamepad works; the link is one example

Total

about $620

Without the phone

Prices are rough US prices from November 2026; check them before you buy. The LEGO prices are BrickLink's averages for used items over the six months before (set, motor); new SPIKE Prime sets averaged about $450. The Raspberry Pi 4 costs more with more memory: $35 for 1 GB, $100 for 4 GB. The camera price is for a third-party OV5647 board. The Build HAT and its power supply are SparkFun's prices, the case is PiShop's, and the gamepad is Adafruit's.

The SPIKE Prime Set supplies the LEGO body/structure and the robot's Medium Angular Motor, plus one of its three Large Angular Motors. The set's SPIKE hub is not used; motor control is handled by the Raspberry Pi and Build HAT. See the BrickLink set inventory.

No SPIKE Prime set? The site has Neil's 108 LEGO parts as a BrickLink Wanted List (upload it on BrickLink under Want → Upload) and as a CSV. The step-by-step build instructions, the BrickLink Studio model and an 18-minute build video are sold on Gumroad; everything in this repository stays free and open source.

Wiring, seen from above: the power supply into the Build HAT, ports A to D to the four motors, and the camera ribbon to the Pi

The motors are connected as follows:

  • A — left wheel

  • B — right wheel

  • C — gripper

  • D — arm

Setup

Early release (v0.1). This is the code our own robot runs. Expect rough edges in the steps below, and please open an issue when one of them doesn't work for you.

1. Raspberry Pi

  1. Flash Raspberry Pi OS Bookworm with Raspberry Pi Imager. In the customisation step, set hostname rpi, username rpi, your Wi-Fi, and enable SSH (guide).

  2. Set up key-based SSH from your computer, because the server logs in without a password (SSH docs):

    ssh-copy-id rpi@rpi.local
    ssh rpi@rpi.local          # should log in without asking for a password
  3. Enable the serial port that the Build HAT talks over (Build HAT docs): run sudo raspi-config → Interface Options → Serial Port → login shell No, serial hardware Yes, then reboot.

  4. Install the Python libraries on the Pi. The server runs its scripts over SSH with the system python3:

    sudo apt install python3-build-hat python3-picamera2 gpiod lsof   # gpiod/lsof: to reset a stuck HAT
  5. Check the camera and a motor (camera docs, buildhat library):

    rpicam-hello --list-cameras
    python3 -c "from buildhat import Motor; print(Motor('A').get_position())"

If you use a different hostname or user, set ROBOT_HOST / ROBOT_USER in .env (see step 3). If your motors are wired differently, set PORT_LEFT_WHEEL, PORT_RIGHT_WHEEL, PORT_GRIPPER and PORT_ARM.

2. SimpleIPCamera (iPhone)

  1. Install SimpleIPCamera and join the same Wi-Fi as the Pi.

  2. Give the phone a fixed IP, for example 192.168.1.50. Use a DHCP reservation on your router, or set it on the phone: Settings → Wi-Fi → ⓘ → Configure IP → Manual. You can also leave the phone's IP as it is and set SIMPLEIPCAMERA_URL in .env to its address instead.

  3. In the app, set:

    1. FPS to 30

    2. Resolution to 720p

    3. Tap Start Server The server reads http://192.168.1.50:8080/stream.mjpeg unless SIMPLEIPCAMERA_URL says otherwise.

  4. Keep the app in the foreground, because iOS stops the camera when the app goes to the background or the phone locks:

    • Settings → Display & Brightness → Auto-Lock → Never

    • Low Power Mode off

    • Phone on a charger

  5. The app serves one viewer at a time. If you check the stream in a browser, close the tab afterwards.

The server rotates the frames 90° clockwise (SIMPLEIPCAMERA_ROTATION). Change that value if the image comes out sideways.

3. This repo

git clone https://github.com/neil-robot/neil-mcp && cd neil-mcp
python3 -m venv .venv                                   # Python 3.11+
.venv/bin/pip install -e ".[viz,yolo]" mcpmon mcp-memory-service
cp .env.example .env                                    # then edit it: the Pi's host, the phone's address, your Gemini API key

The yolo extra adds the YOLO11 and YOLOE object detectors from ultralytics, which is licensed AGPL-3.0, unlike this repo (see License). Leave it out to install no AGPL code; the VLM then finds the objects instead. The tests need the extra.

All the settings are in .env, which git does not track, so your API key stays out of commits. .env.example lists the ones you are likely to change; neil_mcp/config.py has every one, with its default. A variable that is already set in your shell wins over .env. NEIL_ENV_FILE names another file instead; set it empty to read none. The file is read when the server starts, so after you edit it, reconnect the server in Claude Code's /mcp.

Scene text

While a task runs, the server reads new text in both camera streams, such as a sign or a label. It only reads a view that is still, clear, and changed since the last read. Text containing a word it hasn't seen before becomes a visual signal. The signal is appended to output/signals/neil.jsonl, which Claude Code tails in the background, and carried by the next tool result as visual_signals. Until a result has carried it, the robot pauses: multi-step motions stop at their next step, and motor commands return PAUSED without moving.

Claude Code decides whether the text matters and, if it does, revises its plan. The server only reports what it reads.

The frames behind each signal, with an _ocr.jpg overlay of what was read, are saved in output/scene_text/. The settings are the SCENE_TEXT_* and SIGNALS_OUTBOX entries in neil_mcp/config.py. See neil_mcp/scene_text.py for the design.

The instructions on handling signals reach Claude Code from the server itself, so they are only there when scene text is on.

Usage

Start Claude Code in the repo with claude. It starts the servers listed in .mcp.json, and /mcp shows their status. Then give it a task, e.g. "grab the red cup", or run /grab.

  • Logs: output/logs/mcp_server.log

  • All settings: .env (see step 3). Every one, with its default, is in neil_mcp/config.py.

  • The rules Claude follows in this project: CLAUDE.md

License

The code is licensed under the Apache License 2.0, and the images and videos in docs/ under CC BY 4.0. The optional yolo extra (ultralytics and the YOLO weights) and the embeddings in neil_mcp/yoloe_vpe/ are AGPL-3.0. LICENSES.md lists what is under which license, and the licenses of the dependencies and models.

Trademarks

LEGO®, SPIKE™ and Technic™ are trademarks of the LEGO Group, which does not sponsor, authorize or endorse this project. Raspberry Pi is a trademark of Raspberry Pi Ltd, which does not sponsor or endorse this project.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to control a two-track robot through movement commands, providing independent track control, high-level directional driving (forward, backward, left, right), and emergency stop functionality.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to control SO-ARM100 and LeKiwi robots using natural language instructions and integrated camera vision. It supports multiple communication transports and includes a CLI agent compatible with Claude, Gemini, and GPT models.
      Apache 2.0