How to build an MCP server: One-Click PDF Generator
In this tutorial, you will build and publish a Model Context Protocol (MCP) server that converts Markdown to PDF, then call it from a Dedalus agent to return a downloadable file link.
Agents are here. As agent-human collaboration becomes the norm, LLMs need to express their work in formats we can actually understand.
But there's a gap between how LLMs like to write, plaintext and markdown files that overwhelm human readers, and what we like to read, well formatted documents and PDFs.
Today, we're bridging that gap. In this tutorial, you'll learn how to build and deploy an MCP server using Dedalus that gives your agents the ability to generate PDF and .docx files in one line of code.
With the Dedalus SDK, your agent can:
- Draft a Markdown document.
- Call an MCP tool to render a PDF from Markdown.
- Return a download URL that people can open, print, or share.
GitHub repo: dedalus-labs/pdf-generator-mcp
How we built the Markdown-to-PDF MCP server
The server is implemented with the Dedalus MCP framework and exposed over streamable HTTP in stateless mode. It is published to the marketplace, so you can use this agent in one line of code.
On the server side, tools are implemented using the @tool decorator. The server discovers the tool's schema by inspecting the Python type hints and makes them accessible to the LLM behind your agent.
On the agent side, Dedalus is configured with mcp_servers=[marketplace_slug]. The LLM receives your server's schema and learns what tools are available and what arguments they need. When the model calls render_pdf, it already knows which variables (title, markdown, style) to provide for document generation.
This relationship combines the natural language and non-deterministic intelligence of LLMs with the power of repeatable and clearly defined workflows to create an agent that can do real work on your behalf.