A serverless Cloudflare service converting Markdown to PDF with Arabic RTL, PlantUML as SVG and KaTeX equations, via a web app, a REST API and an MCP server.

An academic project carried out by a team of students with technical assistance from Techno Enjaz to design and build a cloud service that converts Markdown documents to PDF files, running entirely on a Serverless architecture on the Cloudflare platform. The service tackles three areas where many conversion tools struggle: Arabic and right-to-left (RTL) text support, embedding PlantUML diagrams as SVG vector graphics instead of raster images, and rendering LaTeX equations with KaTeX.
The service is available in three ways: a web interface with an editor and live preview, a documented REST API for developers, and an MCP server (Model Context Protocol) that lets AI agents call the conversion directly. The final PDF is generated inside a headless Chromium browser via Cloudflare Browser Rendering (Puppeteer). The project's functional tests successfully converted basic formatting, Arabic text, equations, code highlighting, and three types of PlantUML diagrams.
| Item | Details |
|---|---|
| Project type | Web service, API, and MCP server for document conversion |
| Field | Serverless and edge computing, document processing, AI tool integration |
| Project status | System deployed on Cloudflare and functionally tested on sample documents |
| Techno Enjaz role | Technical support and assistance to the students during project development |
| Core technologies | Cloudflare Pages Functions, Cloudflare Browser Rendering (Puppeteer), Cloudflare D1, Hono, Zod, JWT, bcryptjs, Marked, Gray-matter, Highlight.js, KaTeX, PlantUML |
| Outputs | RTL-capable PDFs, bilingual web interface, documented REST API, MCP server, OpenClaw Skill file, conversion history |
Markdown has become a common standard for writing technical documentation under the Docs-as-Code approach, but converting it into a professional PDF still runs into clear obstacles:
The project was carried out academically by a team of students, with technical assistance and support from Techno Enjaz during development. It is presented among the office's work as an example of its support for serverless cloud services, APIs, and MCP integrations with AI tools.
The system uses a multi-tier architecture that runs entirely on Cloudflare's edge network:
| Tier | Components | Role |
|---|---|---|
| Client | Web interface in HTML, CSS, and JavaScript; external systems; AI agents | Send documents and receive PDF files |
| Back end | Hono on Cloudflare Pages Functions, Zod, JWT, bcryptjs | Routing, authentication, data validation, request handling |
| Conversion engine | Gray-matter, Marked, Highlight.js, KaTeX, PlantUML Encoder | Convert Markdown into a complete HTML page |
| Cloud services | Cloudflare Browser Rendering, Cloudflare D1, PlantUML server | PDF generation, data storage, SVG graphics generation |
Plain (vanilla) web technologies were chosen for the front end instead of frameworks such as React or Vue to keep files small and loading fast, with the Noto Sans Arabic font for Arabic text and Fira Code for code. The SQLite-based D1 database holds tables for users, roles, user profiles, refresh tokens, documents, conversion settings, themes, and API usage logs.
An MCP server was implemented on top of Cloudflare Pages using the Streamable HTTP transport, with a single endpoint that any protocol-compatible client can use. The server provides tools to convert Markdown to PDF, list saved documents, fetch a specific document, and create temporary sessions for guest users. The project also includes an OpenClaw Skill file that describes the service's capabilities and parameters so AI tools can call it directly.
The project ran functional tests on sample documents, which showed:
| Test | What was tested | Documented result |
|---|---|---|
| System features | RTL, live preview, PDF export, equations, code highlighting, PlantUML | All working without extra configuration |
| Basic formatting | Headings, bold and italic, ordered and unordered lists, links | Converted with no layout or text-direction distortion |
| Equations (LaTeX) | Inline and display equations, matrices, complex expressions | Rendered with symbols, sizes, and positions preserved |
| Code highlighting | JavaScript, Python, CSS, SQL, JSON | Syntax highlighting applied for each language inside the PDF |
| PlantUML diagrams | Sequence diagram, class diagram, activity/flow diagram | Converted to vector SVG graphics, with no raster images |
These are functional verification results documented with screenshots of the output. The report did not measure response times, load capacity, or the number of conversions tested, so no specific performance figures are attributed to the service.
According to the outlook in the project, the service could be expanded by:
If you are working on an API or MCP integration for your product and need technical help developing the idea or building a prototype, you can contact the Techno Enjaz office to discuss your project's requirements and the appropriate scope of support.
A cloud service running entirely on Cloudflare's serverless platform, built as an academic project by a team of students with technical assistance from Techno Enjaz. It converts Markdown documents to PDF with Arabic RTL support, PlantUML diagrams as SVG, and LaTeX equations, and is available through a web interface, a REST API, and an MCP server.
The Hono back end verifies identity with JWT and validates input with Zod, then Gray-matter extracts the frontmatter and Marked converts the text to HTML, with Highlight.js code coloring and KaTeX equations. PlantUML diagrams are embedded as inline SVG, Cloudflare Browser Rendering (Puppeteer) generates the PDF, and the operation is logged in D1.
The MCP server runs on Cloudflare Pages over Streamable HTTP and gives AI agents tools to convert Markdown to PDF, list saved documents, fetch a specific document, and create temporary guest sessions. It is accompanied by an OpenClaw Skill file describing the service's capabilities and parameters.
Functional tests successfully converted headings, lists, and links without direction distortion; inline and display equations and matrices; JavaScript, Python, CSS, SQL, and JSON code highlighting; and PlantUML sequence, class, and flow diagrams as SVG graphics. The report did not measure response times or load capacity.
It targets developers, technical writers, researchers, and companies that need automated PDF generation, especially in Arabic. Its limitations include reliance on an external PlantUML server, support for Markdown-to-PDF only, and no parallel processing or collaboration features in the current version.
Reach out to Techno Enjaz engineering team to discuss technical feasibility, prototype hardware, and development scope.