MD-PDF MCP Server
Provides tools for converting Markdown content and files into PDF documents with customizable formatting, as well as converting PDF files back into Markdown format.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MD-PDF MCP ServerConvert report.md to a PDF named report.pdf using medium size settings"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MD-PDF MCP Server
A Model Context Protocol (MCP) server for converting between Markdown and PDF formats.
System Requirements
Tested on:
macOS 14.3.0 (Darwin 23.3.0, ARM64)
Python 3.13.0
uv 0.7.13
pandoc 3.6.2
Related MCP server: PDF2MD MCP Server
Features
Convert Markdown content/files to PDF with size options (small, medium, large)
Convert PDF files to Markdown format
Extract text from specific PDF pages
Retrieve PDF metadata
MCP Tools
convert_markdown_to_pdf(markdown_content, output_filename, size, pdf_engine)convert_markdown_file_to_pdf(markdown_file_path, output_filename, size, pdf_engine)convert_pdf_to_markdown(pdf_file_path, output_filename)extract_text_from_pdf(pdf_file_path, page_numbers)get_pdf_info(pdf_file_path)
Installation
# Install dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh
brew install pandoc weasyprint
# Setup project
uv syncRunning the Server
uv run python main.pyMCP Integration
Claude Desktop
{
"mcpServers": {
"md-pdf": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/md-pdf",
"run",
"main.py"
]
}
}
}Cursor
Configure MCP in Cursor settings
{
"servers": {
"md-pdf": {
"command": "uv",
"args": ["run", "main.py"],
"cwd": "/absolute/path/to/md-pdf"
}
}
}Size Options
s: 8pt font, 0.35in margins (compact)m: 9pt font, 0.5in margins (standard)l: 11pt font, 1in margins (detailed)
Project Structure
md-pdf/
├── data/ # Test files
├── tools/ # MCP tool definitions
├── utils/ # Conversion utilities
├── main.py # Server entry point
└── server.py # MCP server instanceAvailable Tools
5 toolsconvert_markdown_file_to_pdfA
Convert a Markdown file to PDF with customizable formatting options.
Args: working_dir: Absolute path to the working directory for file operations markdown_file_path: Path to the markdown file relative to working_dir output_filename: Name of the output PDF file relative to working_dir (if not provided, uses same name as input with .pdf extension) size: Output size - 's' (small/compact), 'm' (medium), 'l' (large/detailed) (default: l) pdf_engine: PDF engine to use - weasyprint or pdflatex (default: weasyprint)
Returns: A message indicating success or failure of the conversion
| Name | Required | Description | Default |
|---|---|---|---|
| working_dir | Yes | ||
| markdown_file_path | Yes | ||
| output_filename | No | ||
| size | No | l | |
| pdf_engine | No | weasyprint |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While it states the tool performs a conversion and mentions customizable formatting, it doesn't disclose critical behavioral aspects like whether the operation modifies source files, what happens on failure, performance characteristics, or authentication requirements. The return statement only mentions success/failure messages without detailing error handling or output specifics.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement followed by organized parameter explanations. While efficient, the 'Returns' section could be more specific about message content. Some redundancy exists between the title-like first sentence and the detailed parameter descriptions, but overall it's appropriately sized for a 5-parameter tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a file conversion tool with 5 parameters, no annotations, and no output schema, the description provides adequate parameter semantics but lacks behavioral context about file system interactions, error conditions, and output handling. The absence of annotations means the description should cover more operational aspects, but it focuses primarily on parameter explanations rather than complete behavioral transparency.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description compensates well by explaining all 5 parameters in the Args section. It clarifies working_dir as 'absolute path for file operations', markdown_file_path as 'relative to working_dir', output_filename's default behavior, size options with meanings ('s'=small/compact, etc.), and pdf_engine choices. This adds substantial value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Convert' and specifies the resource 'Markdown file to PDF', distinguishing it from sibling tools like convert_pdf_to_markdown (reverse operation) and extract_text_from_pdf/get_pdf_info (different PDF operations). The mention of 'customizable formatting options' further clarifies the tool's capabilities beyond basic conversion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage through the stated purpose but doesn't explicitly guide when to use this tool versus alternatives like convert_markdown_to_pdf (which appears similar but might have different parameterization). No explicit when-not-to-use guidance or prerequisite information is provided, leaving some ambiguity about tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
convert_markdown_to_pdfA
Convert Markdown content to PDF with customizable formatting options.
Args: working_dir: Absolute path to the working directory for file operations markdown_content: The markdown content to convert to PDF output_filename: Name of the output PDF file relative to working_dir (default: output.pdf) size: Output size - 's' (small/compact), 'm' (medium), 'l' (large/detailed) (default: l) pdf_engine: PDF engine to use - weasyprint or pdflatex (default: weasyprint)
Returns: A message indicating success or failure of the conversion
| Name | Required | Description | Default |
|---|---|---|---|
| working_dir | Yes | ||
| markdown_content | Yes | ||
| output_filename | No | output.pdf | |
| size | No | l | |
| pdf_engine | No | weasyprint |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool performs a conversion and returns a success/failure message, but doesn't describe what 'failure' might entail (e.g., invalid input, file system errors), performance characteristics, or side effects like file creation in the working directory. The description is functional but lacks operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear purpose statement followed by organized parameter documentation. Every sentence adds value, though the 'Args:' and 'Returns:' sections could be more integrated with the main description. The information is front-loaded with the core functionality stated first.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, no annotations, and no output schema, the description provides adequate parameter documentation but lacks details about behavioral aspects. The return value description ('A message indicating success or failure') is minimal. Given the complexity and absence of structured metadata, the description should ideally include more about error conditions or output format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by providing clear explanations for all 5 parameters. Each parameter gets specific context: 'working_dir' as 'Absolute path to the working directory for file operations', 'markdown_content' as 'The markdown content to convert', and detailed explanations for optional parameters including default values and valid options for 'size' and 'pdf_engine'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Convert Markdown content to PDF') and distinguishes it from sibling tools like 'convert_markdown_file_to_pdf' (which takes a file input rather than content) and 'convert_pdf_to_markdown' (which does the reverse operation). The mention of 'customizable formatting options' further clarifies the tool's capabilities.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context through parameter explanations (e.g., 'working_dir' for file operations), but doesn't explicitly state when to use this tool versus alternatives like 'convert_markdown_file_to_pdf'. It mentions 'customizable formatting options' which hints at use cases, but lacks clear guidance on tool selection among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
convert_pdf_to_markdownB
Convert a PDF file to Markdown format.
Args: pdf_file_path: Path to the PDF file to convert output_filename: Name of the output Markdown file (if not provided, uses same name as input with .md extension)
Returns: A message indicating success or failure of the conversion
| Name | Required | Description | Default |
|---|---|---|---|
| pdf_file_path | Yes | ||
| output_filename | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool performs a conversion and returns a success/failure message, but lacks details on critical behaviors like error handling, file system interactions (e.g., overwriting files), performance characteristics, or format fidelity. This is inadequate for a mutation tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (file conversion with 2 parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic operation and parameters but lacks details on output format, error cases, or integration with sibling tools, leaving gaps for an AI agent to infer behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant value beyond the input schema, which has 0% description coverage. It explains that 'pdf_file_path' is the 'Path to the PDF file to convert' and 'output_filename' defaults to the input name with .md extension if not provided. This clarifies parameter purposes and default behavior, though it doesn't cover format constraints or examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose as 'Convert a PDF file to Markdown format' with a specific verb ('Convert') and resource ('PDF file'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'extract_text_from_pdf' or 'convert_markdown_file_to_pdf', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'extract_text_from_pdf' (which might extract raw text without Markdown formatting) or 'convert_markdown_file_to_pdf' (the reverse operation). It mentions basic parameter usage but lacks context about appropriate scenarios or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extract_text_from_pdfA
Extract text content from a PDF file without conversion to Markdown.
Args: working_dir: Absolute path to the working directory for file operations pdf_file_path: Path to the PDF file relative to working_dir page_numbers: Page numbers to extract - "all" for all pages, or comma-separated numbers like "1,3,5" or "1-5"
Returns: The extracted text content from the PDF
| Name | Required | Description | Default |
|---|---|---|---|
| working_dir | Yes | ||
| pdf_file_path | Yes | ||
| page_numbers | No | all |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool does (extracts text) and what it doesn't do (no Markdown conversion), but lacks information about error conditions, performance characteristics, or file format limitations. It provides basic behavioral context but misses important operational details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (purpose statement, Args, Returns) and efficiently communicates essential information. The single-sentence purpose statement is front-loaded, though the parameter documentation section is somewhat lengthy but necessary given the schema coverage gap.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-parameter tool with no annotations and no output schema, the description provides good parameter documentation and clear purpose, but lacks information about return format details, error handling, or performance considerations. It's adequate for basic usage but incomplete for robust agent operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully compensates by providing detailed parameter documentation in the Args section. Each parameter is clearly explained with examples for 'page_numbers', including format specifications like 'all', comma-separated numbers, and ranges. This adds substantial value beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'extract' and resource 'text content from a PDF file', distinguishing it from sibling tools like 'convert_pdf_to_markdown' by specifying 'without conversion to Markdown'. This provides specific differentiation from similar tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly suggests usage context by contrasting with conversion tools ('without conversion to Markdown'), but doesn't explicitly state when to use this tool versus alternatives like 'get_pdf_info' or 'convert_pdf_to_markdown'. It provides clear purpose but lacks explicit when/when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_pdf_infoC
Get information about a PDF file (number of pages, metadata, etc.).
Args: working_dir: Absolute path to the working directory for file operations pdf_file_path: Path to the PDF file relative to working_dir
Returns: Information about the PDF file
| Name | Required | Description | Default |
|---|---|---|---|
| working_dir | Yes | ||
| pdf_file_path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits such as error handling (e.g., what happens if the file doesn't exist), performance characteristics, or any side effects. The description is functional but lacks depth for safe and effective use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately sized and front-loaded, with the core purpose stated first, followed by parameter and return sections. Each sentence adds value, but the 'Returns' section is vague ('Information about the PDF file') and could be more specific without sacrificing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (a file operation tool with 2 parameters), no annotations, and no output schema, the description is incomplete. It covers the basics but lacks details on return values (beyond a vague statement), error conditions, or integration with sibling tools. This leaves gaps for effective tool selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds value by explaining the parameters in the 'Args' section: 'working_dir' as the absolute path for file operations and 'pdf_file_path' as the relative path. However, it doesn't elaborate on formats, constraints, or examples, leaving some ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get information about a PDF file (number of pages, metadata, etc.)'. It specifies the verb ('Get information') and resource ('PDF file'), with examples of what information is retrieved. However, it doesn't explicitly differentiate from sibling tools like 'extract_text_from_pdf', which might be a related but distinct operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'extract_text_from_pdf' or clarify scenarios where this tool is preferred (e.g., for metadata vs. content extraction). Usage is implied by the purpose but lacks explicit context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.1.0- First observed
convert_markdown_file_to_pdf - First observed
convert_markdown_to_pdf - First observed
convert_pdf_to_markdown - First observed
extract_text_from_pdf - First observed
get_pdf_info
TDQS
There is significant overlap between convert_markdown_file_to_pdf and convert_markdown_to_pdf, which differ only in input type (file vs. content) and could easily be confused. The other three tools have distinct purposes (PDF to Markdown conversion, text extraction, and metadata retrieval), but the two Markdown-to-PDF tools create ambiguity.
All tool names follow a consistent verb_noun pattern with clear, descriptive actions (convert, extract, get) and objects (markdown_file_to_pdf, pdf_to_markdown, text_from_pdf, pdf_info). The naming is uniform and predictable throughout the set.
With 5 tools, this server is well-scoped for its PDF/Markdown conversion domain. The count is appropriate, covering key operations without being overly sparse or bloated, and each tool appears to serve a distinct functional role in the workflow.
The toolset provides solid coverage for PDF and Markdown interactions, including conversion in both directions, text extraction, and metadata retrieval. A minor gap exists in lacking tools for editing or manipulating PDFs/Markdown files beyond conversion, but core workflows are well-supported.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
Generate PDF, Word (.docx) and PowerPoint (.pptx) documents from Markdown over MCP.
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that exports PDF documents to markdown format optimized for LLM processing.11BSD 3-Clause
- AlicenseAqualityDmaintenanceAn MCP server that converts PDF files to Markdown format using AI sampling capabilities, supporting both local files and URLs with incremental conversion features.11MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that converts Markdown text to DOCX format using an external conversion service. It supports custom templates, multi-language output, and provides flexible file handling for both local and cloud-based deployments.7MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for reading, writing, and manipulating PDF files, including text extraction, metadata retrieval, and merging or splitting documents. It also enables users to create PDFs from plain text and convert specific pages or entire documents into images.53ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kareemaly/md-pdf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server