Skip to main content
Glama
cups-sane-mcp

cups-sane-mcp

by ispb88

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_PATHNoHTTP listener path./mcp
MCP_PORTNoHTTP listener port (always bound to 127.0.0.1).8710
S3_BUCKETNoS3 bucket used for upload storage.
S3_REGIONNoS3 region for upload storage.us-east-1
MCP_MAX_MBNoLargest file accepted for printing, in MiB (uploads, links, base64).32
MCP_PRINTERNoPrinter to use; defaults to the CUPS default printer, else the first printer.
MCP_SCANNERNoSANE device name, e.g. escl:https://192.0.2.10:443; defaults to the first device scanimage finds.
MCP_SCAN_DIRNoDirectory where scans are saved.~/Documents/Scans
MCP_PRINT_URLNoSet to 1 to enable the print_url tool.off
MCP_SCAN_MODESNoJSON map from tool names to the device's mode values; defaults to matching the device's --mode choices by name.
MCP_SCAN_NOTESNoExtra guidance for the client about your scanner's quirks.
MCP_PUBLIC_HOSTNoPublic hostname(s) in front of the server, comma-separated (used for Host/Origin checks).
S3_ENDPOINT_URLNoS3-compatible endpoint URL for upload storage; see examples/s3.env.example.
MCP_SCAN_SOURCESNoJSON map from tool names to the device's source values, e.g. {"adf": "ADF Front", "flatbed": "Flatbed"}. The keys become the tool's choices.
S3_ACCESS_KEY_IDNoS3 access key ID for upload storage.
MCP_ALLOWED_ORIGINSNoExtra browser origins allowed to call the server, comma-separated, e.g. https://app.example.com.
MCP_PRINT_URL_HOSTSNoComma-separated host suffixes print_url may download from, e.g. dropboxusercontent.com,googleusercontent.com; defaults to any public host.
S3_ADDRESSING_STYLENoS3 addressing style for upload storage.auto
S3_SECRET_ACCESS_KEYNoS3 secret access key for upload storage.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_printersA

List printers and their state.

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 (*).

print_queueB

Show pending print jobs.

cancel_jobB

Cancel a print job by id (e.g. "Office_Printer-42", from print_queue).

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.

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.

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.

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.

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.
list_scansC

List saved scans, newest first.

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.

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.
list_uploadsA

List files that have been uploaded and not yet printed (they are deleted after a day).

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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.7/5.0

Scored across 14 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo recent community issues