cups-sane-mcp
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., "@cups-sane-mcp print the attached PDF double-sided, two copies"
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.
cups-sane-mcp
An MCP server that lets an AI assistant (any MCP client) use a printer and a scanner on your network: print text and files, scan pages and look at them.
Printing through CUPS: files are handed to CUPS unchanged (PDF, PostScript, PNG, JPEG, TIFF, plain text), with CUPS options passed through (scaling, resolution, tray, pages per sheet, ...). No conversion happens here: for formatted documents the client makes a PDF and uploads it. Optionally prints files from a download link (
print_url, off by default).Scanning through SANE: feeder or flatbed, colour/grey/black-and-white, PDF or images. The client gets small watermarked previews; the full-quality file stays on the machine (or is shared via a short-lived link).
Uploads through any S3-compatible bucket: rather than passing files through the conversation,
get_upload_linkgives the client a presigned upload URL (used from a code sandbox or any HTTP client), andprint_file(id)prints it.
Tools
Tool | What it does |
| Printer status and jobs |
| The printer's own options and the standard CUPS job options, with allowed values |
| Print plain text (CUPS lays it out) |
| Print a small base64 file (tiny files only) |
| Upload a file to the bucket, then print it by id |
| Scan; show the scanner's sources and modes |
| Saved scans: list, preview / download link, reprint |
| Download a file from a link (e.g. cloud storage) and print it; only when |
Every print tool takes the same options: copies, duplex, page_ranges, paper, quality,
scaling (auto, fit, fill, none), ppi, and options for anything else CUPS or the printer accepts
(validated against printer_options).
Related MCP server: printagent
Requirements
Linux with CUPS and cups-filters (lp, lpstat, lpoptions, cancel), SANE (scanimage),
ImageMagick 7 (magick, for scans), Poppler (pdftoppm, pdfinfo) and the Liberation fonts (scan
preview watermark). Python 3.11+.
Install
python -m venv venv && venv/bin/pip install .
venv/bin/cups-sane-mcp # stdio, for local clients
venv/bin/cups-sane-mcp --http # streamable HTTP on 127.0.0.1:8710/mcpFor a local client that starts servers itself, the usual configuration looks like:
{
"mcpServers": {
"printer": {
"command": "/path/to/venv/bin/cups-sane-mcp",
"env": { "MCP_PRINTER": "Office_Printer" }
}
}
}To run it permanently over HTTP, see examples/cups-sane-mcp.service (systemd, sandboxed) and
"Connecting remote clients" below.
Settings (environment variables)
Variable | Default | |
|
| HTTP listener (always 127.0.0.1) |
| – | Public hostname(s) in front of it, comma-separated (Host/Origin checks) |
| – | Extra browser origins allowed to call it, comma-separated, e.g. |
| CUPS default, else first printer | |
| first device | SANE device name, e.g. |
| matched by name | JSON maps from tool names to the device's values, e.g. |
| – | Extra guidance for the client about your scanner's quirks |
|
| Where scans are saved |
|
| Largest file accepted for printing, in MiB (uploads, links, base64) |
| – , | Upload storage; see |
| off |
|
| any public host | Comma-separated host suffixes |
Without a scanner mapping, the server reads the device's --source and --mode choices and matches them
by name (feeder/flatbed/duplex, colour/grey/lineart). If that picks the wrong one, list_scan_sources
shows the device's own names; scan accepts those too, or set MCP_SCAN_SOURCES.
Connecting remote clients
Local clients can use stdio. Remote (web) clients need a public HTTPS URL. The server has no
authentication of its own: put it behind a reverse proxy or tunnel that does (for example an OAuth-capable
proxy or a zero-trust tunnel), and set MCP_PUBLIC_HOST to that hostname. If the client calls it from a
browser page, add that page's origin to MCP_ALLOWED_ORIGINS. For uploads, the client's sandbox must be
allowed to reach your bucket's endpoint host.
Security
Run it as a dedicated user with no access to anything else;
examples/cups-sane-mcp.serviceshows a systemd sandbox (no home directories, network limited to localhost and the scanner).Optional egress filter: route its traffic through a proxy that only allows the S3 endpoint (
examples/tinyproxy.*, withHTTPS_PROXYin the unit).Uploads: use a bucket-scoped key and a short lifecycle rule. Upload links last 15 minutes, scan download links 5 minutes, and uploads are deleted after printing.
print_urlonly downloads and prints files: no HTML rendering, no scripts. Each URL and every redirect must be http(s), onMCP_PRINT_URL_HOSTSif set, and resolve only to public addresses, so links to localhost or your network are refused. SettingMCP_PRINT_URL_HOSTSto your storage providers is recommended. If you use the egress proxy, add those hosts to its filter too.
Known issues
Blank pages from some PDFs. libcupsfilters 2.2.x with PDFio 1.6.6 or older can't read PDF streams with chained filters (e.g.
[/ASCII85Decode /FlateDecode], which ReportLab uses by default). CUPS logscfFilterPDFToPDF: Unsupported compound stream filterand prints a blank page while reporting success. Fixed in PDFio 1.6.7 (libcupsfilters#301): update PDFio. Until then, re-save such PDFs with Flate only (e.g.qpdf --decode-level=generalized), or setrl_config.useA85 = 0in ReportLab.Linux only. It drives the CUPS and SANE command-line tools.
Licence
MIT, see LICENSE.
Available Tools
14 toolscancel_jobB
Cancel a print job by id (e.g. "Office_Printer-42", from print_queue).
Inputs: job_id (required). Returns: result
get_scanA
Show a saved scan's pages as watermarked preview images (up to 5 per call, starting at first_page). upload=True also returns a 5-minute download link to the full-quality file.
Inputs: filename (required), upload, first_page.
get_upload_linkA
Get a one-time link for uploading ONE file (PDF, PostScript, PNG, JPEG, TIFF or text; up to 32 MiB).
Upload it with an HTTP PUT, not by pasting its contents, e.g.:
curl -sS -T /path/to/file.pdf "<url>"
The link works for 15 minutes. Then use the returned id with print_file.
Inputs: no named parameters. Returns: result
list_printersA
List printers and their state.
Inputs: no named parameters. Returns: result
list_scansC
List saved scans, newest first.
Inputs: limit. Returns: result
list_scan_sourcesA
Show the scanner in use, its own source and mode names, and which of them the scan tool's names (adf, flatbed, color, gray, ...) map to. scan accepts either kind of name.
Inputs: no named parameters. Returns: result
list_uploadsA
List files that have been uploaded and not yet printed (they are deleted after a day).
Inputs: no named parameters. Returns: result
printer_optionsB
Show what a printer accepts in the print tools' options (its own options such as tray and
media type, plus standard CUPS job options), with allowed values and defaults (*).
Inputs: printer. Returns: result
print_fileA
Print a file uploaded with get_upload_link, by its id. The upload is deleted after printing unless keep=True (e.g. to print it again with different settings). Prints PDF, PostScript, PNG, JPEG, TIFF or plain text. Print options (all optional): copies, duplex, page_ranges ("1-3,5"), paper, quality, printer; scaling: auto (shrink only if too big), fit (fit the page, keep proportions), fill (fill the page, crop overflow), none (actual size). Usually fit for photos and screenshots, and left unset (printer default) for documents; ppi: override an image's resolution; options: other CUPS options such as {"InputSlot": "Manual", "number-up": "2"}; printer_options lists what the printer accepts.
Inputs: id (required), ppi, keep, paper, +7 more. Returns: result
print_file_dataA
Print a small file sent as base64 (only for tiny files: every byte costs tokens). Prefer get_upload_link + print_file for files, or print_text for plain text. Prints PDF, PostScript, PNG, JPEG, TIFF or plain text. Print options (all optional): copies, duplex, page_ranges ("1-3,5"), paper, quality, printer; scaling: auto (shrink only if too big), fit (fit the page, keep proportions), fill (fill the page, crop overflow), none (actual size). Usually fit for photos and screenshots, and left unset (printer default) for documents; ppi: override an image's resolution; options: other CUPS options such as {"InputSlot": "Manual", "number-up": "2"}; printer_options lists what the printer accepts.
Inputs: data_base64 (required), ppi, paper, copies, +7 more. Returns: result
print_queueB
Show pending print jobs.
Inputs: no named parameters. Returns: result
print_scanA
Print a saved scan by file name (see list_scans), e.g. to make a copy. Print options (all optional): copies, duplex, page_ranges ("1-3,5"), paper, quality, printer; scaling: auto (shrink only if too big), fit (fit the page, keep proportions), fill (fill the page, crop overflow), none (actual size). Usually fit for photos and screenshots, and left unset (printer default) for documents; ppi: override an image's resolution; options: other CUPS options such as {"InputSlot": "Manual", "number-up": "2"}; printer_options lists what the printer accepts.
Inputs: filename (required), ppi, paper, copies, +6 more. Returns: result
print_textA
Print plain text you write (notes, lists, a short letter). CUPS lays it out in a monospaced font. For anything formatted (headings, tables, images), make a PDF and print it with get_upload_link + print_file. Print options (all optional): copies, duplex, page_ranges ("1-3,5"), paper, quality, printer; scaling: auto (shrink only if too big), fit (fit the page, keep proportions), fill (fill the page, crop overflow), none (actual size). Usually fit for photos and screenshots, and left unset (printer default) for documents; ppi: override an image's resolution; options: other CUPS options such as {"InputSlot": "Manual", "number-up": "2"}; printer_options lists what the printer accepts.
Inputs: text (required), ppi, paper, title, +7 more. Returns: result
scanA
Scan a document. Returns the saved file name and watermarked, low-quality preview images.
source is REQUIRED; ask the user where the pages are if you don't know. Use one of these
names, or a source name exactly as list_scan_sources shows it (also for mode):
adf pages stacked in the document feeder: scans every page in it.
adf_duplex feeder, both sides of each page (if the scanner supports it).
flatbed ONE page lying on the glass under the lid.
Some scanners take paper from the feeder whenever it holds any, even if flatbed is
chosen, so whenever pages are in the feeder use adf.
upload=True also uploads the full-quality file and returns a download link valid
for 5 minutes (only ask for it when the actual file is needed, e.g. to save or send it).
The saved file can be reprinted with print_scan.
name: optional file name stem, e.g. "lease-signed".
Tool names: source adf|flatbed|adf_duplex, mode color|gray|bw.
Inputs: source (required), mode, name, paper, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
The four print tools (print_text, print_file, print_file_data, print_scan) share nearly identical option blocks, but each description names a distinct input source and explicitly steers callers away from the weaker variants (e.g. 'prefer get_upload_link + print_file for files'). The only genuinely confusable pair is print_file vs print_file_data, which the descriptions mitigate but do not fully eliminate.
Most tools follow a clear verb_noun pattern (list_printers, cancel_job, get_scan, print_text), and the scan/print families are coherently grouped. Two outliers break the pattern: 'printer_options' uses noun-first with no verb, and 'scan' is a bare verb, plus 'print_queue' is really a listing operation.
14 tools sits squarely in the well-scoped range, and each one maps to a distinct step in the print/scan workflow: discovery, option lookup, submission, queue inspection, cancellation, and scan retrieval. Nothing appears redundant or padded.
Core lifecycle is covered: list printers, inspect capabilities, submit from four input types, view and cancel queue jobs, scan, list/retrieve scans, and manage uploads. Minor gaps remain — no hold/release or pause-printer operations, no scan deletion or cleanup, and no way to query a single job's detailed status beyond print_queue.
Maintenance
Related MCP Connectors
Print from Claude and ChatGPT to your own printer. Free for 5 prints a month; Plus $7.99/mo.
Have It Printed turns a document or a letter an AI assistant just helped you write into real mail. No printer, no ink, no trip to the post office. The assistant starts a job, adds the document (a file, or text it wrote with you), picks how it is mailed and gets the exact price from Have It Printed's own page count. Then it creates a checkout link: you enter the address and pay on haveitprinted.com, so no address or card ever goes through the chat. After payment it can check the order and read the tracking number. Ways to mail: flat and tracked (the default), printed and mailed flat in a rigid mailer with a free tracking number, from $15 for up to 30 pages; a $3 letter of up to 5 pages, folded into a standard envelope and mailed USPS First-Class with no tracking; or $11 by USPS Certified Mail with a tracking number. With an API key, agents can also write letters in a handwriting-style font on designed stationery, send postcards from $2, and pay on their own with a Stripe shared payment token (the bank's checks still apply). Prices include printing and postage. Letters, Certified Mail and postcards go to US addresses; flat and tracked also ships to Canada, Mexico, the UK, Germany, Australia and Japan. Uploaded files are deleted automatically and never used to train AI. Docs: https://haveitprinted.com/developers.html
3D print farm management for AI. Monitor, queue, and control prints on your SimplyPrint account.
Connect your AI to your own devices, 3D printers, factory tools and a shared agent task pool.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to print documents, manage print queues, and control printers on macOS/Linux systems via the CUPS printing system. Supports printing PDFs, text files, and other formats with options like duplex printing, landscape orientation, and multiple copies.622 npm13MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to submit PDFs or JSON-rendered templates to local printers, check printer status, and manage print jobs through MCP tools.18 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to print documents directly on your own printer over a private network, without cloud services or open ports. Supports printing text, URLs, and files with per-person access keys, usage limits, and detailed job control.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to drive cloud printers: listing available printers, sending PDFs, ZPL labels and ESC/POS receipts, tracking print jobs through to completion, and managing webhooks. It connects an MCP client to the InkRelay printing API so printing happens from natural language requests.MIT