
PaperSprocket
io.github.inde-xv1.0.0Updated Oct 1, 2026
EU-hosted HTML-to-PDF rendering for agents and MCP clients. Temporary document processing.
Overview
Renders HTML to PDF through the hosted PaperSprocket API and checks the account's prepaid balance.
- What it does
- Exposes exactly two tools. render_html_to_pdf takes an HTML string plus optional page settings (A4 or Letter, portrait or landscape, margins, print background) and returns the PDF as an application/pdf resource, a local file path when writable, and render metadata such as render_id, page_count, charged_cents and balance_cents. check_balance returns the account_id, balance_cents, currency and page_price_cents for the configured account.
- When to use it
- Useful when an assistant needs to turn generated HTML or CSS into a PDF document, for example invoices, reports or formatted exports, and when you want to see the prepaid balance before or after rendering. It is a minimal render-and-balance server, not a document management system.
- Requirements
- Node.js 20 or newer, run locally over stdio via npx papersprocket-mcp or a source checkout. A PaperSprocket account and API key supplied as the PAPERSPROCKET_API_KEY environment variable or in the server's .env file. Optional PAPERSPROCKET_BASE_URL and PAPERSPROCKET_MCP_OUTPUT_DIR settings. Network access to the PaperSprocket API.
Installation
In SourceWeft
- Open PaperSprocket in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
PaperSprocket MCP server
A Model Context Protocol (MCP) server that gives MCP clients direct access to the PaperSprocket API. It exposes exactly two tools:
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.
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)
The 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)
Configuration
The server loads <serverdir>/.env at startup (it does not override
already-set environment variables). .env is gitignored.
Example .env (replace the placeholder — never commit a real key):
Run (stdio)
Connect an MCP client
Point your MCP client at a stdio server:
PAPERSPROCKET_API_KEY is provided via the server .env or environment —
never in the client configuration.
MCP Inspector
List tools → confirm exactly two: render_html_to_pdf and check_balance.
Tool schemas
render_html_to_pdf
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— 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.
Source: README.md at commit a021f7a
Tools
0Version history
1- v1.0.0LatestOct 1, 2026

