Typeset PDFs, from your own code
Add typeset-PDF generation to your app or agent — one HTTP call in, a designed, print-ready PDF out. 1 credit per PDF, and a failed conversion costs nothing.
REST API
One POST, bearer auth, JSON in and a download link out. OpenAPI 3.1 published.
MCP server
Three tools in any MCP client over stdio. Your agent converts without you writing a client.
Claude Skill
Ask for a PDF in plain language; the skill picks the theme and mode and hands back a link.
GPT Action
Import the OpenAPI document into a custom GPT — nothing to build, only to configure.
Convert your first document
Set $MDPRINT_API_URL to this site's origin and $MDPRINT_API_KEY to your key,
then:
curl -X POST $MDPRINT_API_URL/api/v1/convert \
-H "Authorization: Bearer mdp_sk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Quarterly Review\n\nRevenue is up.",
"theme": "default",
"mode": "report"
}'
The response carries a link to the finished PDF, valid for five minutes:
{
"download_url": "https://…/api/download/<token>/quarterly-review.pdf",
"expires_in": 300,
"filename": "quarterly-review.pdf",
"bytes": 214512,
"credits_remaining": 41
}
markdown is the only required field. theme fantasy gives the
tabletop treatment — stat blocks, GM callouts, parchment; default covers reports,
newsletters, newspapers, résumés, certificates and poetry. GET /api/v1/themes lists every
value that exists, so an agent can read the options rather than guess them.
Use it from an MCP client
The MCP server is a thin stdio client over the same API. Drop this into your client's config — Claude Desktop puts it under Settings → Developer → Edit Config:
{
"mcpServers": {
"grimoireprint": {
"command": "npx",
"args": ["-y", "@mdprint/mcp-server"],
"env": { "MDPRINT_API_KEY": "mdp_sk_your_key_here" }
}
}
}
In Claude Code it is one line:
claude mcp add grimoireprint --env MDPRINT_API_KEY=mdp_sk_your_key_here -- npx -y @mdprint/mcp-server
Restart the client and three tools appear: convert_markdown_to_pdf,
list_themes and get_credit_balance. Running out of credits, a bad key or a
rate limit come back as ordinary tool errors saying what to do about them.
stdio, not a remote endpoint. The key comes from the environment, which is what the MCP specification asks of a stdio server. A hosted HTTP endpoint would need full OAuth 2.1, so it is not offered rather than shipped as a deviation.
Or skip the client entirely
- Claude Skill. Copy
skills/markdown-to-pdf/into your skills directory, setMDPRINT_API_KEY, and ask for a PDF in plain language. The skill chooses a theme and document mode from the kind of document you are making and checks the live option list rather than guessing. - GPT Action. In a custom GPT, add an action and import
/api/v1/openapi.json— that endpoint needs no key, so the builder can read the contract first. Set authentication to Bearer with your key. Note that a published GPT sends the builder's key for every user of it;gpt-action/README.mdin the repository spells out what that means before you publish one.
Pricing
One credit per PDF. The credit is spent only once the PDF exists, so a rejected request, an invalid option or a conversion failure is never charged. API keys spend purchased credits, and nothing they produce is watermarked.
Packs are one-time purchases and the credits never expire. The monthly free allowance is for browser use; a key has none, because keys are free to mint and one would be an unlimited free tier. Each key has an hourly conversion allowance — 60 by default, raisable on request — and every response carries the numbers in its headers.
Get a key
Keys are issued on request while self-service key management is being built. Tell us roughly what you are building and how many PDFs a month you expect, and we will send one back with a starting balance.