Skip to main content

firmata-client-mcp

An MCP (Model Context Protocol) server that lets an LLM control an Arduino's GPIO over the Firmata protocol.

Built on FastMCP and the firmata-client library. It exposes digital/analog I/O, PWM, and basic servo control as MCP tools so an agent can read sensors and drive actuators on a connected board.

⚠️ This server lets an AI agent drive physical hardware. Please read the Safety section before connecting a board.


Features

  • Discover serial ports and connect to a board running StandardFirmata
  • Query board capabilities (firmware, pin modes, analog mapping)
  • Digital read / write
  • Analog (ADC) read with sample averaging
  • PWM (analog) write
  • Servo control with a settable "origin" reference point
  • Structured JSON responses and actionable error messages

Requirements

  • Python 3.13+ (required by the firmata-client dependency)
  • An Arduino (or compatible board) flashed with StandardFirmata (File → Examples → Firmata → StandardFirmata in the Arduino IDE)
  • Python dependencies:
    • mcp[cli]
    • firmata-client
    • pyserial (installed with firmata-client)
    • pydantic (installed with mcp)

Installation

Using uv (recommended):

uv pip install firmata-client-mcp

Or via pip:

pip install firmata-client-mcp

Or from source:

git clone https://github.com/NaoNaoMe/firmata-client-mcp.git
cd firmata-client-mcp
uv sync

Configuration

Claude Desktop Config

Add the server to your claude_desktop_config.json:

{
  "mcpServers": {
    "firmata-client-mcp": {
      "command": "uvx",
      "args": [
        "firmata-client-mcp"
      ]
    }
  }
}

A typical first interaction:

  1. arduino_list_ports - find your board's serial port
  2. arduino_connect - connect using that port
  3. arduino_get_board_info - inspect supported modes per pin
  4. arduino_set_pin_mode - configure a pin (e.g. pin 13 -> OUTPUT)
  5. arduino_digital_write - turn it on

Tools

Tool Description Read-only
arduino_list_ports List available serial ports
arduino_connect Connect to a board on a given port
arduino_disconnect Disconnect from the current board
arduino_get_board_info Firmware info and per-pin capabilities
arduino_set_pin_mode Set a pin to INPUT/OUTPUT/ANALOG/PWM/SERVO
arduino_digital_write Set a digital pin HIGH/LOW
arduino_digital_read Read a digital pin (majority of 5 samples)
arduino_analog_write Write a PWM value (0-255)
arduino_analog_read Read an analog channel (averaged)
arduino_set_servo_origin Register the current angle as a reference
arduino_servo_move Move a servo to an angle offset from origin

A note on pin vs. analog channel

arduino_analog_read takes an analog channel number (0 = A0, 1 = A1, …), but arduino_set_pin_mode expects the digital pin number. Use the analog_mapping returned by arduino_get_board_info to translate between them.

A note on servo movement

arduino_servo_move moves the servo to origin + value degrees (clamped to 0-180), where origin is whatever you registered with arduino_set_servo_origin (default 0). The move is relative to the origin, not cumulative - calling it twice with the same value results in the same physical position.

Safety

This server gives an autonomous agent direct control of electrical outputs and moving parts. Before use:

  • Supervise it. Do not run it unattended while a board with actuators is powered.
  • Mind your wiring. An agent can set any configured pin HIGH or drive PWM/servos; verify current limits, and mechanical end-stops yourself.
  • Setting SERVO mode does not define a position. The physical angle right after a mode change is undefined and hardware-dependent.
  • The author(s) accept no liability for damage to hardware or surroundings. Use at your own risk.

Limitations

  • Single board / single client at a time (module-level connection state, no locking - intended for local stdio use).
  • Pin numbers are accepted in the range 0-69 (covers boards up to Arduino Mega); the actual valid range depends on your board.
  • Reads block briefly (~100 ms) while sampling.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

firmata_client_mcp-0.1.1.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

firmata_client_mcp-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file firmata_client_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: firmata_client_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for firmata_client_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c54641749bac76e4a372cad0c6a0b55be0376f917d060b97ec822774845b4a7
MD5 324a0c7faa4818d74e94ec3b8d3ff739
BLAKE2b-256 9f9b23b6aa6aac018e265edde4e2ec95e5507ddd017b1e4ae3c2a6f056a30fb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for firmata_client_mcp-0.1.1.tar.gz:

Publisher: python-publish.yml on NaoNaoMe/firmata-client-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file firmata_client_mcp-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for firmata_client_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b07fed53e74425e4a1c93d842a6bd95aa436368aeca20e4ebc82881afe541e1d
MD5 45ad1c431b1b4e4902b9e9a7101b247a
BLAKE2b-256 02281a633f773c8e6beba295aa87e99ecb7c38a955862a711459649ea5c36987

See more details on using hashes here.

Provenance

The following attestation bundles were made for firmata_client_mcp-0.1.1-py3-none-any.whl:

Publisher: python-publish.yml on NaoNaoMe/firmata-client-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page