print-mcp
Click on "Install 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., "@print-mcpPrint report.md to the default printer double-sided"
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.
print-mcp
"We absolutely need to bring ink and paper into this."
print-mcp is a home-network print service that turns Markdown into a print-ready PDF and sends it to your network printer. Run it on any Linux machine on the same home network as the printer, optionally open it to the internet with a Cloudflare Tunnel, and give the MCP endpoint to all of your agents.
Your agent can then:
Use the network printer configured for your home.
Print Markdown with page size, margins, orientation, copies, duplex, and color options.
Check the status of a submitted print job.
The important part: the printer stays on your home network and is never exposed to the internet. Cloudflare only provides the secure public connection to the MCP endpoint; the server renders and submits the job through the network printer.
How It Works
Cloudflare Tunnel
(outbound connection)
|
Any MCP client ------------> MCP server ------------> CUPS ------------> Local printer
| |
Markdown -> PDF USB or IPPThe Docker Compose stack runs three services:
mcpis the MCP server. It renders Markdown and exposes the tools.cupsmanages the local printer queue and submits print jobs.cloudflaredis optional. It publishesmcpthrough a Cloudflare named tunnel without opening an inbound port.
Related MCP server: md-mermaid-to-pdf-mcp
What You Need
A Linux machine that can reach your home network printer.
Docker Engine and the Docker Compose plugin.
A network printer that supports IPP Everywhere, or a USB printer.
For remote agents: a Cloudflare account, a domain on Cloudflare, and a named tunnel.
Docker Desktop is not supported. USB passthrough and host networking differ from the Linux setup this project expects.
Quick Start
1. Configure the server
git clone <your-repo-url> print-mcp
cd print-mcp
cp .env.example .envGenerate secrets and put them in .env:
openssl rand -hex 32 # MCP_BEARER_TOKEN
openssl rand -hex 24 # CUPS_ADMIN_PASSWORDAt minimum, set these values:
MCP_BEARER_TOKEN=your-long-random-token
CUPS_ADMIN_PASSWORD=your-long-random-password2. Configure your network printer
For a modern network printer, add its IP address to .env:
CUPS_PRINTER_IP=192.168.1.50
CUPS_PRINTER_NAME=office-printerWhen the stack starts, CUPS creates an IPP Everywhere queue at ipp://192.168.1.50/ipp/print, enables it, and makes it the default printer.
If you do not want automatic setup, leave CUPS_PRINTER_IP empty and add a queue manually:
docker compose exec cups lpadmin \
-p office-printer \
-E \
-v ipp://192.168.1.50/ipp/print \
-m everywhere
docker compose exec cups lpadmin -d office-printerFor a USB printer, use the USB Compose overlay instead:
docker compose -f compose.yaml -f compose.usb.yaml up -d --build3. Start and test locally
docker compose up -d --build
curl -fsS http://127.0.0.1:8000/healthzThe local endpoints are:
MCP:
http://127.0.0.1:8000/mcpCUPS admin:
http://127.0.0.1:631/admin
Send a local test print:
echo 'Hello from print-mcp.' | docker compose exec -T mcp \
python /app/cli/print_file.py -At this point, print-mcp is running on your home network and can print to the configured network printer. Any MCP client on the same network can use the local endpoint; agents outside your network can use the Cloudflare URL from the next section.
Connect A Remote Agent
To let an MCP client connect from anywhere, put the local MCP endpoint behind a Cloudflare Tunnel.
1. Create the Cloudflare route
In Cloudflare Zero Trust:
Create a named tunnel.
Add a public hostname, for example
print.example.com.Set its service URL to exactly
http://mcp:8000.Copy the tunnel token into
.env.
Then add the same public hostname to the MCP host allow-list:
CLOUDFLARE_TUNNEL_TOKEN=eyJhIjoi...
MCP_ALLOWED_HOSTS=print.example.comThe hostname must match exactly. If it does not, the tunnel can be healthy while the MCP server rejects requests with HTTP 421 Invalid Host header.
2. Start the tunnel
docker compose --profile tunnel up -d --buildYour MCP endpoint is now:
https://print.example.com/mcpThe tunnel makes an outbound connection from your machine to Cloudflare. You do not need to expose port 8000 or open an inbound firewall port.
3. Add it to your MCP client
Configure your MCP-compatible agent or client with the public URL and the same bearer token from .env:
URL: https://print.example.com/mcp
Token: MCP_BEARER_TOKENThe standard authentication header is:
Authorization: Bearer YOUR_MCP_BEARER_TOKENFor older MCP agents that cannot set an authorization header, use the same token as the final path segment instead:
https://print.example.com/mcp/YOUR_MCP_BEARER_TOKENThe server treats this URL as an authenticated alias of /mcp. Path tokens can be
recorded in proxy, tunnel, browser, or server logs, so prefer the header form when
the client supports it.
The exact configuration shape depends on the MCP client. Look for its remote HTTP, Streamable HTTP, or custom MCP server settings.
Now your agent can print.
MCP Tools
The server exposes three tools:
list_printers
Lists configured printers and their current capabilities.
print_markdown
Renders Markdown to PDF and submits it to CUPS. It supports:
titleprinterpage_size:letter,legal, ora4orientation:portraitorlandscapemarginscopies: 1 through 10sides: one-sided, two-sided long-edge, or two-sided short-edgecolor_mode: auto, color, or monochrome
The default is letter paper, portrait orientation, and two-sided long-edge printing.
get_job_status
Returns the current state and timestamps for a CUPS print job.
Raw HTML is disabled. Markdown images may use public HTTP/HTTPS URLs or data URIs. Private, loopback, link-local, multicast, and reserved destinations are blocked, including after redirects.
Local CLI
The same image includes a CLI for printing without an MCP client:
cat notes.md | docker compose exec -T mcp python /app/cli/print_file.py -
docker compose exec -T mcp python /app/cli/print_file.py notes.md \
--page-size a4 \
--orientation portrait \
--margins-mm 12 \
--copies 2 \
--sides two-sided-long-edge \
--color monoThere is also a host-friendly wrapper for files outside the container:
./bin/print-md.sh --page-size a4 ./docs/report.mdConfiguration
Copy .env.example to .env for the complete list. The settings most people need are:
Variable | Purpose |
| Token required by MCP clients |
| Password for CUPS administration |
| IP address for automatic IPP queue setup |
| Name of the automatic CUPS queue |
| Queue used when a tool call omits |
| Required for the |
| Public hostname accepted by the MCP server |
The MCP server and CUPS are bound to localhost by default. Keep them that way when using Cloudflare Tunnel. The tunnel container reaches MCP over the private Compose network.
Troubleshooting
Check service state and logs:
docker compose ps
docker compose logs cups mcp cloudflaredCheck the two health endpoints:
curl http://127.0.0.1:8000/healthz
curl http://127.0.0.1:8000/readyz/healthz confirms that the MCP process is running. /readyz is healthy only after CUPS has at least one configured printer.
Common issues:
HTTP 421 through Cloudflare: add the exact public hostname to
MCP_ALLOWED_HOSTS, then recreate themcpservice withdocker compose up -d mcp.Tunnel is running but the endpoint does not respond: verify the Cloudflare public hostname points to
http://mcp:8000and inspectdocker compose logs cloudflared.Printer is not found: use the printer's explicit IPP URI. Discovery does not reliably cross Docker or Tailscale networks.
CUPS keeps crashing with
cupsdDoSelect() failed - Bad address!: rebuild the image so the CUPS entrypoint applies the file-descriptor limit workaround.
Development
uv sync --extra dev
uv run ruff check .
uv run pytest
docker compose configThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown documents to PDF files with support for syntax highlighting, custom styling, Mermaid diagrams, optional page numbers, and configurable watermarks.176MIT
- FlicenseNot gradedqualityDmaintenanceConverts Markdown files and raw content into professionally styled PDFs with full support for Mermaid diagrams and syntax highlighting. It offers customizable page formats, margins, and modern typography for high-quality document generation.11
- AlicenseBqualityDmaintenanceConverts Markdown files and content to styled PDFs with S3 integration, Mermaid diagrams, and ApexCharts support, supporting stdio, HTTP, and SSE transport modes.3358MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to convert Markdown files and content to beautifully formatted PDF documents using Playwright's Chromium engine.89MIT
Related MCP Connectors
Markdown in, any format out. PDFs merged, split, watermarked. Runs on our own doc engines.
Turn HTML or Markdown into a clean, styled PDF and get a download link.
Generate PDFs from templates via AI chat. Works with Claude, ChatGPT, Cursor, and any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mdp/print-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server