Skip to main content

cups-mcp

An MCP server that lets an AI assistant (any MCP client) print on your network through CUPS.

Why this one?

Most printer MCP servers print a file path on the server, which only works when the AI runs on the same machine. This one also works for assistants that run elsewhere, such as web or mobile clients:

  • Secure file transfer. The client gets a one-time upload link, valid for 15 minutes, uploads the file straight to your private S3-compatible bucket, and prints it by id. Files never pass through the conversation, the server never reads arbitrary paths on your machine, and uploads are deleted after printing.
  • Real printer options. Files go to CUPS unchanged (PDF, PostScript, PNG, JPEG, TIFF, plain text). Every print tool takes scaling, resolution, duplex, page ranges, paper and quality, plus any option the printer itself offers (tray, media type, pages per sheet, ...), checked against what that printer supports.

Formatted documents (HTML, Markdown, Word) aren't converted: the client makes a PDF and prints that.

Tools

Tool What it does
list_printers, print_queue, cancel_job Printer status and jobs
printer_options What a printer accepts, with allowed values
print_text Print plain text
get_upload_link, list_uploads, print_file Upload a file, then print it by id
print_file_data Print a small file sent inline (tiny files only)

Every print tool takes the same options: copies, duplex, page_ranges, paper, quality, scaling, ppi, and options for anything else the printer accepts.

scaling is CUPS's print-scaling option, passed through unchanged:

Value Effect
auto The printer chooses between fit and fill, depending on the document and page
auto-fit Shrink to fit only if it's bigger than the page
fit Scale to fit the page, keeping proportions
fill Fill the page, cropping what doesn't fit
none No scaling: actual size (the image's own resolution, or ppi if given)

Left unset, the printer's default applies. Images then often print at their stored resolution, which can come out small; to change that for everything printed to a queue, set the default in CUPS, e.g. lpadmin -p Office_Printer -o print-scaling-default=fit.

Install

Needs Linux with CUPS, and Python 3.11+. Installing builds pycups, so it also needs a C compiler and the CUPS development headers (libcups2-dev on Debian/Ubuntu; included with the cups package on Arch).

pipx install cups-mcp          # or: uv tool install cups-mcp
cups-mcp                       # stdio, for local clients
cups-mcp --http                # HTTP on 127.0.0.1:8710/mcp

For a local client that starts servers itself:

{
  "mcpServers": {
    "printer": {
      "command": "cups-mcp",
      "env": { "MCP_PRINTER": "Office_Printer" }
    }
  }
}

To run it permanently over HTTP, see examples/cups-mcp.service and "Connecting remote clients" below.

Settings (environment variables)

Variable Default
MCP_PORT, MCP_PATH 8710, /mcp HTTP listener (always 127.0.0.1)
MCP_PUBLIC_HOST – Public hostname(s) in front of it, comma-separated
MCP_ALLOWED_ORIGINS – Extra browser origins allowed to call it, comma-separated, e.g. https://app.example.com
MCP_PRINTER CUPS default, else first printer
CUPS_SERVER local CUPS A CUPS server on another machine, e.g. printserver.lan:631 (also CUPS_USER, CUPS_ENCRYPTION)
MCP_CUPS_PASSWORD – Password for a CUPS server that asks for one (with CUPS_USER)
MCP_MAX_MB 32 Largest file accepted for printing, in MiB
MCP_MAX_COPIES 10 Most copies allowed in one print job
S3_ENDPOINT_URL, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_ADDRESSING_STYLE – , us-east-1, …, auto Upload storage; see examples/s3.env.example

To print through CUPS on another machine, that server must accept remote clients (cupsctl --remote-any, or Listen/Allow in cupsd.conf). If it requires a login, set CUPS_USER and MCP_CUPS_PASSWORD (preferably with CUPS_ENCRYPTION=Required).

Connecting remote clients

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 must be able to reach your bucket's endpoint.

Security

  • Run it as a dedicated user; examples/cups-mcp.service shows a sandboxed systemd unit.
  • Use a storage key limited to the one bucket, and a lifecycle rule that deletes old objects.
  • The client can upload but never gets a link to read an upload back, and the server never downloads from URLs it's given.

Known issues

  • Blank pages from some PDFs. libcupsfilters 2.2.x with PDFio 1.6.6 or older prints PDFs with chained stream filters (e.g. [/ASCII85Decode /FlateDecode], ReportLab's default) as blank pages, while reporting success. Fixed in PDFio 1.6.7 (libcupsfilters#301): update PDFio, or re-save such PDFs with Flate only (e.g. qpdf --decode-level=generalized).
  • Linux only.

Licence

MIT, see LICENSE.

Metadata

Release files for cups-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cups-mcp 0.1.1
File Size Uploaded Provenance Actions
cups_mcp-0.1.1.tar.gz 12.3 kB With provenance Details for cups_mcp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cups-mcp 0.1.1
File Interpreter ABI Platform Actions
cups_mcp-0.1.1-py3-none-any.whl Python 3 none any Details for cups_mcp-0.1.1-py3-none-any.whl

Total release size: 25.1 kB

Release files / cups_mcp-0.1.1.tar.gz

Download URL cups_mcp-0.1.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5ca9f8d8f33e7bf90c25c859fe959f06a4a91bb2b1720a2d85570426727f143a
BLAKE2b-256 checksum
How to use checksums
467947dd57c670a1ee50eeff1f554a9592963c53f12eff24c3abe020fae53b9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / cups_mcp-0.1.1-py3-none-any.whl

Download URL cups_mcp-0.1.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd40f216a695f00f58fbd8c6548d967d43833ab8d568b826c872a8924856bedf
BLAKE2b-256 checksum
How to use checksums
2d1a90a70160261d2e04087ea18c5c5a83188cde595690c2391c16c3d15bd57b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for cups-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cups_mcp-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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