Skip to main content

Python client and MCP server for Elegoo Centauri Carbon 3D printers

Project description

pycentauri

Python client, CLI, and MCP server for the Elegoo Centauri Carbon 3D printer.

pycentauri speaks the printer's native SDCP v3 protocol over its local WebSocket (port 3030) — no cloud account required. It exposes three surfaces:

  1. An async Python library for direct integration.
  2. A centauri CLI for quick status checks, snapshots, and control.
  3. An MCP server so AI agents (Claude Code, Claude Desktop, Cursor, any MCP-compatible client) can monitor and drive the printer as a tool.

Status: alpha. The protocol has been reverse-engineered from the official elegoo-link C++ SDK and the CentauriLink project. It works against the original Centauri Carbon on current firmware. The newer Centauri Carbon 2 (which uses MQTT) is not supported.

Install

pip install pycentauri            # library + CLI
pip install "pycentauri[mcp]"     # + MCP server dependencies

Quick start — CLI

# Find printers on your LAN
centauri discover

# One-shot status (pretty or JSON)
centauri status --host 192.168.1.209
centauri status --host 192.168.1.209 --json

# Stream live status updates
centauri watch --host 192.168.1.209

# Grab a webcam snapshot
centauri snapshot --host 192.168.1.209 shot.jpg

# Files on the printer
centauri files --host 192.168.1.209

# Control actions require --enable-control
centauri print start cube.gcode --host 192.168.1.209 --enable-control
centauri print pause              --host 192.168.1.209 --enable-control
centauri print resume             --host 192.168.1.209 --enable-control
centauri print stop               --host 192.168.1.209 --enable-control

The host can also come from PYCENTAURI_HOST or ~/.config/pycentauri/config.toml.

Quick start — Python

import asyncio
from pycentauri import Printer

async def main():
    async with await Printer.connect("192.168.1.209") as printer:
        status = await printer.status()
        print(status.state, status.progress, status.temp_nozzle)

        jpeg = await printer.snapshot()
        with open("shot.jpg", "wb") as f:
            f.write(jpeg)

        async for update in printer.watch():
            print(update.state, update.progress)

asyncio.run(main())

Quick start — MCP

Register the server with your agent. With Claude Code:

claude mcp add pycentauri -- python -m pycentauri.mcp
# or, with control actions enabled (gives the agent start/pause/stop/upload):
claude mcp add pycentauri -- python -m pycentauri.mcp --enable-control

Set PYCENTAURI_HOST in your MCP server env so the agent can't target an arbitrary IP. The server exposes these tools:

Tool Always available Description
get_status yes State, temperatures, progress, elapsed/remaining
get_attributes yes Model, firmware, mainboard ID
list_files yes Files stored on the printer
get_snapshot yes Webcam frame as MCP Image content
discover_printers yes LAN scan
start_print only with --enable-control Starts a print
pause_print only with --enable-control Pauses the current print
resume_print only with --enable-control Resumes a paused print
stop_print only with --enable-control Stops the current print
upload_file only with --enable-control Uploads a file to the printer

Safety

Control actions are gated behind an explicit enable_control=True (library) or --enable-control flag (CLI / MCP). Destructive MCP tools are not even registered when the flag is off, so an LLM never sees them. Still: leaving a printer running unattended with write-capable agents is your responsibility.

Credits & licensing

  • Protocol reference: elegoo-link (Apache-2.0) and CentauriLink.
  • pycentauri is licensed under Apache-2.0. See LICENSE.
  • Not affiliated with or endorsed by Elegoo.

Project details


Download files

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

Source Distribution

pycentauri-0.1.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

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

pycentauri-0.1.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file pycentauri-0.1.0.tar.gz.

File metadata

  • Download URL: pycentauri-0.1.0.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycentauri-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ebe66518a17644adb8ca19ec16fa6d8b5d58837cca7a13f707125ad14dfa115f
MD5 afb8d7e856ba3944d8858a267096172a
BLAKE2b-256 d23fbdfa273cf3b2cd793c91cf09346489468fb6b19b2fbc543bd1a3a482ce13

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycentauri-0.1.0.tar.gz:

Publisher: publish.yml on bjan/pycentauri

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

File details

Details for the file pycentauri-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycentauri-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pycentauri-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaf95519df282112ac1c4f39c67a1668e202bd725aefaf09a463922a6ceca814
MD5 f9444e1331d99f41c04cbd5eceed529a
BLAKE2b-256 5605af5d8fc36f4ec783ffb557ba42e3d35b937e31e60323fedfd6a9773273e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycentauri-0.1.0-py3-none-any.whl:

Publisher: publish.yml on bjan/pycentauri

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page