brotherkeeper-mcp
Print and preview text labels on USB-attached Brother label printers via MCP tools.
List printers (
list_printers): see every attached printer with model, serial, loaded tape (width, type, colors), printable height, and errors.Check status (
printer_status): inspect one printer's tape, printable height, and faults (no media, cover open) — fails if off or unplugged.Preview a label (
preview_label): lay out text (multi-line via\n) on the current tape and get a PNG preview plus layout details without printing; choose font, font size, alignment, fixed length, or printer.Print a label (
print_label): print text with copies, fixed length, font/size, alignment, and printer selection; returns print details and a preview image.Batch print (
print_label_set): print several different labels in one job to save ~25 mm of blank lead-in tape per job, with options for cuts between labels, chaining (leave last label inside), uniform font size, and dry-run preview.Pick a printer: target by model, serial, or tape width (e.g.
"24mm") when several are attached.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@brotherkeeper-mcp show me which printers are attached and what tape they have loaded"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BrotherKeeper
Print text labels on Brother label printers over USB from the command line, Python, or any MCP-capable agent. It doesn't need Brother's app or driver.
Tested on the PT-P710BT (P-touch Cube Plus) and PT-2730 tape printers, and the QL-570 paper-label printer (DK rolls, continuous or die-cut). Several printers can be attached at once. To add another model, see docs/ADDING_A_PRINTER.md.
Detects the loaded tape or label roll (width, type, colors, die-cut size) from the printer itself.
On die-cut labels the size is fixed, so text is rotated whenever that gives bigger text (e.g. along the 62 mm side of a 62×29 mm label).
Sizes the text to fill the tape height, and cuts the label to fit the text. You can also give a fixed length.
Supports multiple lines (
\n), several copies, alignment, and any TrueType font.
Probably also works on the PT-P700 / PT-P750W / PT-E550W (same raster protocol), but those are untested.
Install
brew install libusb
uv syncRelated MCP server: ptouch-mcp
Make shortcuts
make label "Hello World" # print (or TEXT="..."; extra flags via FLAGS="-n 3")
make label-set A1 A2 A3 # several labels in ONE job (one lead-in, not three)
make label-set "Shelf A, Shelf B" # multi-word labels: separate with commas
make preview "Hello World" # write preview.png, don't print
make status # attached printers and their tapes
make label "Hi" PRINTER=24mm # pick a printer (model, serial or tape width)
make calibrate PRINTER=ql # calibration rulers/target (for adding printers)
make run-mcp # MCP server on stdio
make run-keepalive # keep the printer awake (foreground)
make install-keepalive # ...or as a launchd agent (uninstall-keepalive to remove)Command line
uv run label "Hello World" # fit the text
uv run label "Garage\nScrews M4" # two lines
uv run label "Bin 7" --length 40 -n 3 # three 40 mm labels
uv run label --list # attached printers and their tapes
uv run label "Hi" -P 2730 # pick a printer: model, serial or tape width
uv run label "Hi" -P 24mm # ...e.g. whichever has 24 mm tape loaded
uv run label "Test" --dry-run --preview out.png
echo "from stdin" | uv run label -MCP server (for agents)
brotherkeeper-mcp is a stdio MCP server that provides these tools:
tool | what it does |
| every attached printer with its loaded tape and errors |
| one printer's loaded tape, printable height, errors |
| lay out text for the current tape and return a PNG preview, without printing |
| print it ( |
| print several labels in one job (less tape waste); |
This repo has a .mcp.json, so Claude Code picks it up automatically when it runs in this folder.
To use it from anywhere, add it to Claude Code at user scope:
claude mcp add --scope user brotherkeeper -- uv --directory /path/to/BrotherKeeper run brotherkeeper-mcpSeveral printers
With more than one printer attached, choose one with -P/--printer (CLI), PRINTER=
(make), the printer argument (MCP), or set BROTHERKEEPER_PRINTER as a default. You can
choose by model name (p710bt, 2730), by serial number, or by loaded tape width (9mm, 24mm).
If you don't choose and more than one printer is attached, the tool lists them and asks you to pick.
Keeping the printer awake
The PT-P710BT switches itself completely off after it's idle for a while (1 hour on USB power, 10 minutes on battery).
Once it's off, you can't wake it over USB or Bluetooth.
label --keepalive sends a status request to every attached printer, and that should restart the idle timer.
contrib/com.brotherkeeper.keepalive.plist runs it every 20 minutes:
make install-keepalive # installs the launchd agent pointing at this checkout
make uninstall-keepalive # removes itNotes
Tape waste: the cutter sits roughly 25 mm past the print head. Each job starts where the last cut was, so that ~25 mm has already gone past the head and comes out blank. Two ways to reduce it:
Print several labels in one job (
label a b c,make label-set, MCPprint_label_set). You pay the ~25 mm once per job instead of once per label.--chain: the printer doesn't feed out the last label, so the next job carries on right after it with no blank lead-in. The catch is that the last label stays inside the printer until you print again.
Minimum length and margins: the printer won't cut a label shorter than about 25 mm. It pads short labels at the end, and it adds its own blank margins (about 2.6 mm at the front and 1.7 mm at the back). The layout accounts for all of this, so text is centered on the actual cut label. These values were measured on one PT-P710BT (the PT-2730's are below). If yours differ, set
BROTHERKEEPER_LEAD_MM,BROTHERKEEPER_TRAIL_MMorBROTHERKEEPER_MIN_LENGTH_MM.QL-570: 300 dpi, a 720-dot head, and DK roll sizes taken from brother_ql's label table. If its status shows no media, reseat the roll. Margins on continuous rolls aren't measured yet (about 3 mm is assumed).
PT-2730: it uses an older command set:
ESC i R 1for raster mode, uncompressed lines, and only the auto-cut (ESC i M) and margin (ESC i d) settings. Without auto-cut it wouldn't cut between labels. It ignores--chainand doesn't report tape colors. Its minimum label length is about 23.3 mm, with margins of about 1.1 mm at the front and 2.2 mm at the back.Protocol: Brother "Raster Command Reference" for PT-E550W/P750W/P710BT, and ptouch-print for the older models.
License
MIT
Available Tools
5 toolslist_printersA
List every attached Brother label printer with its model, serial, loaded tape (width, type, colors), printable height and errors. Use this to pick a printer (e.g. by tape width) when several are attached.
Inputs: no named parameters. Returns: result
preview_labelA
Lay out a label for the currently loaded tape WITHOUT printing it and return a preview image plus layout details. Use "\n" in text for multiple lines. Text is auto-sized to fill the tape height; the label length fits the text unless length_mm is given.
Inputs: text (required), font, align, printer, +2 more.
printer_statusA
Get one label printer's state: loaded tape (width, type, colors), printable height, and any errors (no media, cover open, ...). printer: model, serial or tape width ("24mm") when several are attached. Fails if the printer is off or unplugged.
Inputs: printer.
print_labelA
Print a text label on the Brother P-touch printer (uses tape).
text: label text; use "\n" for multiple lines.
copies: number of identical labels (each cut separately).
length_mm: fixed label length; omit to fit the text.
font_size: pixel size; omit for the largest that fits the tape.
font: font name or path (default Arial Bold).
align: left, center or right.
printer: model, serial or tape width ("24mm") when several are attached. Returns what was printed and a preview image.
Inputs: text (required), font, align, copies, +3 more.
print_label_setA
Print several different labels in ONE job. Prefer this over calling print_label repeatedly: the printer feeds ~25 mm of blank tape at the start of every job, so batching saves tape.
texts: one entry per label; use "\n" inside an entry for multiple lines.
copies: print the whole set this many times.
cut: cut between labels (false = one continuous strip).
chain: leave the last label inside the printer (it comes out with the next job), saving the trailing feed; the user must print again or feed to get it.
uniform: same font size on every label.
dry_run: lay out and preview without printing.
printer: model, serial or tape width ("24mm") when several are attached. Other options as for print_label. Returns details and a preview image.
Inputs: texts (required), cut, font, align, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool targets a distinct action/resource: list all printers, inspect one printer, preview layout, print one label, or print a batch. The descriptions explicitly distinguish print_label from print_label_set and clarify when to prefer batching. Preview versus print is also clearly separated.
Most names follow a consistent snake_case verb_noun pattern (list_printers, preview_label, print_label, print_label_set). printer_status is the lone noun-first outlier, but it remains readable and unambiguous.
Five tools is well-scoped for a label-printing server, covering discovery, status, preview, and both single and batch printing. Every tool earns its place without redundancy.
The surface covers the core lifecycle: list printers, check status, preview layout, print a label, and print a set. Minor gaps exist around feed/advance or job-cancel operations, especially since the chain option references needing to feed the printer afterward.
Related MCP Connectors
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Validate, preview and convert ZPL (Zebra) label code to PDF with your ZPLPDF plan quota.
Thermal label MCP server: render, validate, debug and convert ZPL, EPL, TSPL and CPCL labels.
Generate QR codes, GS1-128, Code-128, EAN-13 & UPC-A as SVG/PNG, plus Avery & Zebra label sheets.
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 gradedqualityBmaintenanceEnables printing labels on Brother P-touch tape printers via MCP, allowing natural language requests to create, preview, and print labels.MIT
- AlicenseAqualityNot gradedmaintenanceEnables 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 gradedqualityBmaintenanceEnables AI clients to build and validate ZPL II label specifications from JSON (text, 27 barcode symbologies, boxes, CJK via built-in TrueType fonts), send them over TCP raw 9100 or Windows spooler/USB, query printer status via Link-OS SGD or legacy ~HI/~HS, batch-print labels from .xlsx rosters, and reconstruct printable ZPL from a photo of an existing label. Includes a preview transport for rendering without hardware.2MIT