Skip to main content
Glama
printer-mcp

printer-mcp

printer-mcp

A token-authenticated Model Context Protocol server that lets any AI harness print to a CUPS printer on macOS. Self-hosted and reachable from inside or outside your network over streamable HTTP with a Bearer token. Built and tested with a Brother HL-L2442DW; works with any CUPS queue.

  • MCP endpoint: http://YOUR_HOST:18978/mcp (streamable HTTP)

  • Health: http://YOUR_HOST:18978/health (no auth)

  • Auth: Authorization: Bearer <token> on every MCP request.

The server speaks plain HTTP. Anyone on the network path can read the token and the documents you print. Use a strong token, and put it behind TLS (a reverse proxy) or a VPN if that matters to you.

Tools

Tool

Arguments

Purpose

print_file

content_base64, filename, copies?, duplex?, pages?

Print a file (pdf/txt/md/png/jpg/jpeg/gif/webp/tif/tiff, max 25 MB)

print_text

text, title?, copies?, duplex?

Print plain text

printer_status

—

Queue state and default printer

job_status

job_id?

Pending and completed jobs

cancel_job

job_id?, all?

Cancel one job or all

Related MCP server: print-mcp

Run the server

Requirements: macOS with CUPS, a configured printer queue, Node.js 20+.

npm install
cp .env.example .env
# edit .env:
#   PRINTER_MCP_TOKEN  -> a strong secret, e.g. `openssl rand -hex 32`
#   PRINTER_QUEUE      -> your queue name (see `lpstat -p`)
#   PORT               -> default 18978
npm run build
npm start

Check it:

curl http://localhost:18978/health
curl -X POST http://localhost:18978/mcp \
  -H "Authorization: Bearer $PRINTER_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'

Run as a boot service (launchd)

deploy/ has a path-agnostic LaunchDaemon template and installer. It starts the server at boot (no GUI login needed), runs it as the repo owner, and restarts it on crash:

sudo bash deploy/install-daemon.sh
tail -f ~/Library/Logs/printer-mcp.log
sudo launchctl kickstart -k system/com.printer-mcp   # restart

Reach it from outside your network

Forward a TCP port on your router to this host's PORT, then use your public IP or hostname as YOUR_HOST. Keep the token secret. For anything sensitive, prefer a TLS reverse proxy or a VPN over exposing plain HTTP.

Install in a harness

Replace YOUR_HOST and YOUR_TOKEN.

Claude Code

claude mcp add --transport http printer http://YOUR_HOST:18978/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

Codex (~/.codex/config.toml)

[mcp_servers.printer]
url = "http://YOUR_HOST:18978/mcp"
bearer_token_env_var = "PRINTER_MCP_TOKEN"

Export PRINTER_MCP_TOKEN=YOUR_TOKEN where Codex runs.

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "printer": {
      "url": "http://YOUR_HOST:18978/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  }
}

Kimi Code / other HTTP MCP clients: add an HTTP MCP server with the URL above and the Authorization: Bearer YOUR_TOKEN header.

Development

npm test          # jest (unit + MCP integration)
npm run build     # tsc -> build/

Layout: src/printing.ts (CUPS helpers), src/auth.ts (Bearer + health), src/server.ts (MCP tools + stateless streamable HTTP), src/index.ts (entry).

License

MIT — see LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      6
      16 npm
      13
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables generating print-ready PDFs from Markdown and submitting them to CUPS printers. Supports local, Tailscale, and Cloudflare Tunnel access.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables 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
    • A
      license
      Not graded
      quality
      B
      maintenance
      A stdio MCP server that lets AI clients drive an unofficial Paperang P1 thermal printer service, exposing 13 tools for status, device scanning, connection, printing, configuration and job management. It enables text/image output and queue control through natural-language requests without touching the printer's protocol directly.
      2
      MIT