niimbot-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
niimbot-mcp
An MCP server + toolset to print to NIIMBOT BLE label printers directly — no vendor app, no cloud. The MCP provides the toolset and guidance; the calling agent composes what to print (text / QR / image).
Reverse-engineered from the community protocol work (niimbluelib, niimprint) and confirmed live against a NIIMBOT B1.
Hardware confirmed
NIIMBOT B1, 203 dpi, 50 mm print head (384 px wide).
BLE quirk: despite advertising the ISSC
49535343-…UART service, the B1 only replies on characteristicbef8d6c9-9c21-4c9e-b632-bd58c1009f9f. Both write and notify go through that one characteristic.
Related MCP server: Memobird GT1 MCP Server
Protocol (packet framing)
55 55 | TYPE | LEN | DATA… | XOR_CHECKSUM | AA AA
checksum = TYPE ^ LEN ^ (each data byte)Working print flow (B1):
SET_DENSITY 0x21 → SET_LABEL_TYPE 0x23 → START_PRINT 0x01 (2-byte page
count) → START_PAGE 0x03 → SET_DIMENSION 0x13 (6-byte: rows, cols, copies)
→ bitmap rows 0x85 (pos:2 | black_count:3 | repeats:1 | row_data) →
END_PAGE 0xE3 → poll GET_PRINT_STATUS 0xA3 → END_PRINT 0xF3.
The bare 1-byte
START_PRINTand the 4-byteSET_DIMENSIONproduce blank output or many copies on the B1 — use the forms above.
⚠️ BLE flow control (the big one)
Stream every packet with write-WITH-response (write_gatt_char(..., response=True)).
With response=False, the BLE stack silently drops packets under backpressure:
~half the rows dropped → the page clips mid-way (~120px on a 240px label), which looks exactly like a wrong label-size / geometry bug (it is not).
all rows dropped → nothing feeds, which looks like a transient BLE drop or a dead link (it is not).
If a print clips or fails to feed, check this FIRST — before geometry, label
size, or connection theories. Also: do not send ALLOW_PRINT_CLEAR (0x20) —
the B1 does not support it and it silently breaks every subsequent print.
Safe margin
Content is inset by a configurable safe_margin_mm (default 3mm) on all sides so
text/QR captions don't print off the label edge. check_fit accounts for it.
Install
python3 -m venv .venv
./.venv/bin/pip install -U bleak pillow qrcode "mcp[cli]"macOS: grant your terminal Bluetooth permission (System Settings → Privacy & Security → Bluetooth) on first run.
MCP tools
Tool | Purpose |
| Read first. How-to + current effective config. |
| Current stored paper/printer config. |
| Persist label size / orientation / density / address. |
| Discover nearby printers. |
| Live battery / paper / firmware (connects). |
| Render to PNG without printing. |
| Render and print. |
Orientation
horizontal(default): text reads left-to-right across the label width.vertical: rotated 90°, for long thin labels.
QR and images auto-fit the label either way. Config persists to
~/.config/niimbot-mcp/config.json.
Register with Kiro Crew
Add to ~/.kiro/agents/kirocrew.json under mcpServers:
"niimbot": {
"command": "/Users/italo/Code/niimbot-mcp/.venv/bin/python",
"args": ["/Users/italo/Code/niimbot-mcp/server.py"]
}Layout
niimbot/
packet.py # 55 55…AA AA framing + codec
client.py # async BLE client + print flow
config.py # persisted paper/printer settings
render.py # text/QR/image → oriented, label-sized 1-bit bitmap
server.py # MCP server (toolset + guide)
scan.py probe.py diag.py # discovery utilities used during bring-upTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Thermal label MCP server: render, validate, debug and convert ZPL, EPL, TSPL and CPCL labels.
AI tools for MyPost A4 labels, 4x6 thermal printers and LabelChop resources.
Turn your product list into print-ready label PDFs with barcodes, from your AI assistant.
Print address labels from a list or a spreadsheet without opening Word.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables printing PNG labels to a nearby thermal label printer over local serial or Bluetooth, with tools for rendering previews, checking printer status, and printing with confirmation.52MIT
- AlicenseNot gradedqualityCmaintenanceEnables direct local Bluetooth printing of text and images to a Memobird GT1 thermal printer without the official app or cloud services.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to design, preview, and print labels on a Bluetooth label printer, manage templates and saved labels, check printer status, scan for devices, and query fonts.10MIT
- AlicenseNot gradedqualityCmaintenanceEnables Mac users to discover and select a Bluetooth thermal printer, preview Chinese text, image, and mixed layouts as PNGs, inspect device and job status, and send a prepared job only after local confirmation.MIT