# Markdown to PDF API - formatted PDFs from Markdown

Open, no-auth HTTP API and MCP server that turns Markdown into a cleanly formatted PDF - POST Markdown text or a .md file, get the PDF back. Built on FastAPI + ReportLab; the same open-source engine also powers richly styled analytical reports with charts (that pipeline is open source, not a public endpoint). Built for AI agents first, humans second: every page here has a Copy-as-Markdown button so you can hand it straight to your agent.

Kind: REST / HTTP API, MCP Server (AI agents), Document tool, Open - no auth
Base URL: https://mdtopdf.tigzig.com
Full page: https://www.tigzig.com/apis/md-to-pdf

> AI agents: this API is open (no auth). It serves no OpenAPI spec (interactive docs disabled); the full endpoint contract is in the API Endpoints section below. The RFC 9727 catalog at https://api.tigzig.com/.well-known/api-catalog is a site-level directory of all TigZig APIs - go there only if you want a different API, not for more detail on this one.

## Quick start

- MCP server (for AI agents): https://mdtopdf.tigzig.com/mcp - Streamable HTTP, add as a custom connector (Claude.ai / ChatGPT / Cursor / n8n)
- REST API (base URL): https://mdtopdf.tigzig.com/v1 - endpoints listed in the API Endpoints section below

## What it is

One engine that turns Markdown into a professionally formatted PDF (FastAPI + ReportLab). Two public endpoints, both no-auth:
- POST /v1/convert/text - Markdown text as JSON -> PDF returned directly. Canonical (the MCP tool wraps this).
- POST /v1/convert - upload a .md file (multipart) -> PDF returned directly.

Clean paginated document layout: headings, lists, tables, code, blockquotes, rules. Free web tool: https://mdtopdf.tigzig.com

## MCP server (for AI agents)

Mount it in an AI agent and let it produce PDFs as a tool call. No auth. One endpoint:
- https://mdtopdf.tigzig.com/mcp - Streamable HTTP, recommended transport (MCP 2025-03-26). Tool: convert_markdown_to_pdf.

Add to Claude.ai: Settings -> Connectors -> Add custom connector -> paste the URL. Works in Cursor, n8n, any MCP client.

## Styled reports with charts (open source)

The same ReportLab engine also produces richer analytical reports - side-by-side tables, embedded charts, custom styling, saved as a hosted PDF + HTML. That is what powers the TigZig Technical Analysis app (/n8n-tech-analysis).

That report pipeline is NOT offered as a public endpoint here - it is a backend for our own apps and needs a specific multi-step calling convention. But it is fully open source: to build formatted, charted reports yourself, clone the repo and take the code. The ReportLab building blocks (paragraphs, tables, side-by-side frames, image embedding, allowlist HTML sanitizer) are all there.

Repo: https://github.com/amararun/shared-reportlab-md-to-pdf . Worked example: https://github.com/amararun/shared-fastapi-mcp-technical-analysis

## Build your own (open source)

The source is open - the repo runs the whole converter - run it as your own service, or reuse the components for your own report format.

https://github.com/amararun/shared-reportlab-md-to-pdf

Built on FastAPI, ReportLab.

CORS is configured for xlwings (addin.xlwings.org), so you can POST Markdown to it straight from Python-in-Excel and get a PDF back.

Self-hosting a public MCP server is your responsibility for security - a public endpoint needs edge rate limiting, abuse detection and secret hygiene. Full checklist: https://www.tigzig.com/security

## Guides

This page is the REFERENCE - what the endpoints are and how to call them. The guides below are the long-form versions, with worked examples and the edges you only meet in real use:

- Demystifying the API errors - what each error actually means and what to do about it, instead of guessing from a status code. Covers every TigZig API, not just this one.
  https://www.tigzig.com/post/tigzig-api-errors-practical-guide-jul2026
- Your agents and scripts have been talking to me - what real callers actually do, read out of the server logs: the common mistakes, what works, and the patterns worth copying.
  https://www.tigzig.com/post/api-conversation-agents-scripts-jul2026

Each is a plain page with a Markdown twin, so a URL can be handed straight to an agent. Come back to this page for parameter-level detail.

## Rate limits

Published so a well-behaved client can plan around them. These are per-IP limits:

- Per IP: 30 requests / minute.

You get a 429 with Retry-After (seconds) and a body naming the budget you crossed.

Avoiding 429s: Rendering is per-document, so there is no batching trick here - just space out requests and honor Retry-After.

Every successful response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix epoch seconds), read straight from the running limiter; Retry-After is set on 429. The current numbers are also published as machine-readable JSON at https://mdtopdf.tigzig.com/v1/ , derived from live config. Read those at runtime rather than hard-coding the figures above - limits change, and these channels change with them.

## API Endpoints (REST / HTTP)

Base URL: `https://mdtopdf.tigzig.com`

### POST /v1/convert
Convert Markdown
Example: curl -X POST "https://mdtopdf.tigzig.com/v1/convert" -F "file=@<path-to-file>"
### POST /v1/convert/text
Convert Markdown Text Endpoint
Example: curl -X POST "https://mdtopdf.tigzig.com/v1/convert/text" -H 'Content-Type: application/json' -d '{"content":"# Title\n\nHello world","filename":"out.pdf"}'

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/apis/md-to-pdf
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
