PaperSprocket MCP server
The PaperSprocket MCP server lets MCP clients render HTML to PDF and check a PaperSprocket account balance via exactly two tools.
render_html_to_pdf(html, page?): Convert non-empty HTML to a PDF through the PaperSprocket API.Optionally control page size (A4 or Letter), orientation (portrait/landscape), margins (0–50 mm, default 10 mm), and print background (default true).
Receive the PDF as an
application/pdfMCP resource (base64 blob), a best-effort local file path, and render metadata:render_id,page_count,charged_cents,balance_cents,bytes,idempotency_key.Renders are billed to the configured account and use a fresh idempotency key per logical render, retried up to 2× on transient network failure without double-charging.
check_balance(account_id): Read the configured account’s prepaid balance, returningaccount_id,balance_cents,currency, andpage_price_cents.No top-up or API-key-management tools; the API key is server-side config only.
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., "@PaperSprocket MCP server Render this HTML invoice to an A4 PDF and show the cost."
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.
PaperSprocket MCP server
A Model Context Protocol (MCP) server that gives MCP clients direct access to the PaperSprocket API. It exposes exactly two tools:
Tool | Description |
| Render HTML to a PDF through the PaperSprocket API. Returns the PDF as an |
| Read the prepaid balance of the configured PaperSprocket account. Returns |
This is a minimal native MCP server built directly on
@modelcontextprotocol/sdk. No top-up tools, no API-key-management tools —
just render and balance-check.
What is PaperSprocket?
PaperSprocket is a hosted API that turns HTML into PDFs. You send it HTML, it returns a well-formed PDF. There is no business-field schema to learn: you control the layout with your own HTML and CSS, PaperSprocket handles the PDF processing. See the official documentation.
Related MCP server: @docweave/mcp
Requirements
Node.js >= 20
A PaperSprocket API key. The server reads it from server-side config only (environment or
.env) — it is never a caller-supplied tool argument, and is never embedded in source, examples, or this document.
Install
Run via npx (primary)
npx -y papersprocket-mcpThe package papersprocket-mcp is published to npm and registered in the
official MCP Registry under identity io.github.inde-x/papersprocket (active,
version 1.0.0). Point your MCP client at npx -y papersprocket-mcp and provide
PAPERSPROCKET_API_KEY in the client's environment (the server reads it
server-side only).
From source (optional / development)
git clone https://github.com/inde-x/papersprocket-mcp.git
cd papersprocket-mcp
npm ci
cp .env.example .env # then set PAPERSPROCKET_API_KEY (see Configuration)Configuration
The server loads <serverdir>/.env at startup (it does not override
already-set environment variables). .env is gitignored.
Variable | Required | Default | Purpose |
| yes | — | Your PaperSprocket API key. Secret/config state — never a tool argument. |
| no |
| API base URL. Fixed/config state. |
| no |
| Directory where rendered PDFs are also written (best-effort) for filesystem-local clients. |
Example .env (replace the placeholder — never commit a real key):
PAPERSPROCKET_API_KEY=psk_your_api_key_here
# PAPERSPROCKET_BASE_URL=https://papersprocket.com/api
# PAPERSPROCKET_MCP_OUTPUT_DIR=./outputRun (stdio)
node server.js # MCP over stdio
node server.js --list-tools # print tool schemas, then exitConnect an MCP client
Point your MCP client at a stdio server:
# primary — published npm distribution:
Command: npx
Arguments: -y papersprocket-mcp
# or a local source checkout:
Command: node
Arguments: /path/to/papersprocket-mcp/server.jsPAPERSPROCKET_API_KEY is provided via the server .env or environment —
never in the client configuration.
MCP Inspector
npx @modelcontextprotocol/inspector node /path/to/papersprocket-mcp/server.jsList tools → confirm exactly two: render_html_to_pdf and check_balance.
Tool schemas
render_html_to_pdf
{
"html": { "type": "string", "description": "HTML to render (non-empty)." },
"page": {
"properties": {
"size": { "enum": ["A4", "Letter"] },
"orientation": { "enum": ["portrait", "landscape"] },
"margin_mm": { "top|right|bottom|left": { "type": "number", "minimum": 0, "maximum": 50 } },
"print_background": { "type": "boolean" }
}
}
}html— required, non-empty string.page— optional. Defaults mirror the service's closed v1 schema:sizeA4,orientationportrait,margin_mm10on all sides,print_backgroundtrue. Unknown fields are rejected.
Result (two MCP content blocks):
text— metadata JSON:tool,format,render_id,page_count,charged_cents,balance_cents,bytes,file_path,idempotency_key.resource—application/pdfblob (base64) with afile://(orurn:) URI.
check_balance
{ "account_id": { "type": "string" } }account_id— required, non-empty string.
Result: { account_id, balance_cents, currency, page_price_cents }
(text block).
Idempotency
A fresh random idempotency key is generated for each logical render.
On a transient network failure the server retries up to 2× reusing the same key, so a retry of one logical render cannot double-charge.
Server-side, PaperSprocket dedupes on
(Idempotency-Key, request hash), so a true replay returns the original result without a second debit.
Security / secret boundary
PAPERSPROCKET_API_KEYis read from.env/ environment — it is not a field in any tool input schema.PAPERSPROCKET_BASE_URLis fixed/config state, not an agent-controlled argument.The key is sent only as the
AuthorizationHTTP header. No other credentials exist.Rendered PDFs written to
output/are your own content; the directory is gitignored.
Pricing
$10 initial prepaid credit
$10 top-ups
$0.02 / page
Getting a key
Create a PaperSprocket account to get your API key and prepaid credit:
Onboarding: https://papersprocket.com/onboarding/?source=mcp
License
MIT — see LICENSE.
Available Tools
2 toolscheck_balanceB
Check the prepaid balance of the configured PaperSprocket account. Returns account_id, balance_cents, currency, and page_price_cents.
Inputs: account_id (required).
render_html_to_pdfA
Render HTML to a PDF through the PaperSprocket API. Returns the PDF as an application/pdf embedded resource (base64 blob), the local file path when the server can write it, and render metadata (render_id, page_count, charged_cents, balance_cents). Billed to the configured PaperSprocket account.
Inputs: html (required), page.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one performs the core rendering action and the other retrieves account balance information. There is no overlap or ambiguity in when to use each tool.
Both tools follow a consistent snake_case verb_noun pattern (render_html_to_pdf, check_balance). The convention is predictable and readable.
With only two tools, the surface feels thin for a server that wraps a rendering API. While each tool earns its place, the set is minimal and may leave agents wanting more operations.
The core workflow of rendering HTML to PDF and checking balance is covered, but there are minor gaps such as retrieving render history, checking render status, or managing account details. These gaps are unlikely to block basic usage.
Related MCP Connectors
HTML/URL to PDF rendering API with a remote MCP server. Send HTML or a URL, get a print-ready PDF back.
Remote MCP server for HTML-to-PDF and screenshots with OAuth and API-key auth.
Render HTML, Markdown, or URLs to images, PDF, or branded artifacts; extract and watch pages.
MCP server for Api2Pdf — generate PDFs & images from HTML, URLs or office files; merge, barcodes.
Related MCP Servers
AlicenseAqualityCmaintenanceRender branded PDF documents (invoices, reports, certificates) and PNG social images directly from any MCP client using DocJet templates or raw HTML with JSON data.344 npmMIT- AlicenseAqualityDmaintenanceWrite and read PDF documents via MCP: generate PDFs from HTML, URLs, or templates, and extract text from PDFs with OCR support.255 npmMIT
- AlicenseNot gradedqualityDmaintenanceLets MCP clients create professional receipt PDFs, return structured receipt data, and check prepaid API credit through a remote endpoint.1MIT
- AlicenseAqualityBmaintenanceDeterministic file operations for AI agents: 40 operations over plain HTTPS. PDF merge, split, redact, sanitize, OCR, Office and PDF to Markdown, RAG chunking, charts, QR codes, C2PA AI labelling. find_tool suggests the right one. $0.01 per operation, 100 free, no signup, credits never expire.552 npmMIT