---
title: "Teaching LLMs to read PDFs: Convert PDF to HTML and Markdown with Claude Code and Nutrient DWS MCP Server"
canonical_url: "https://www.nutrient.io/blog/teaching-llms-to-read-pdfs/"
md_url: "https://www.nutrient.io/blog/teaching-llms-to-read-pdfs.md"
last_updated: "2026-08-21T16:37:23.500Z"
description: "Convert PDF to Markdown and HTML for LLMs and AI workflows using Claude Code and the Nutrient DWS MCP Server — restoring the structure that the PDF format strips away."
---

**TL;DR**

The [Nutrient DWS MCP Server](https://www.npmjs.com/package/@nutrient-sdk/dws-mcp-server) adds PDF conversion to HTML, Markdown, and PDF/UA, injecting structure where the PDF format strips it away — and making documents readable by LLMs and AI tools while improving accessibility.

My first tests [connecting Claude Code with Nutrient DWS MCP Server](https://www.nutrient.io/blog/nutrient-document-engine-mcp-server-release/) led me to create what might be the most interesting website known to mankind: the “US Tax Forms Browser” — every US citizen’s favorite tax forms, now beautifully rendered in HTML. But behind this tongue-in-cheek project lies something genuinely useful: Claude Code can now talk directly to powerful document processing tools, completely changing how we handle documents. No more API specifications locked up in the PDF format, no painful conversion scripts to extract key information for your application. Now it’s trivial and dynamic.

Read more: [Automating tax filing with AI: Claude Desktop meets Nutrient DWS Processor](https://www.nutrient.io/blog/automating-tax-filing-with-ai/)

## PDFs run the world, but that world is human-based

PDFs are everywhere in business and government. Tax forms, legal documents, reports, manuals — critical information trapped in a format designed for viewing, but not autonomously processing.

Here at Nutrient, we’ve been solving this problem for customers for years, and now we’re solving this problem for AI.

The challenges are real:

- **Web unfriendly** — PDFs don’t play well with responsive design.

- **AI hostile** — LLMs struggle with [the unstructured nature and formatting of PDFs](https://www.nutrient.io/blog/better-document-understanding-with-layout-analysis/).

- **Accessibility barriers** — Many PDFs fail basic accessibility standards.

- **Search limitations** — Content is locked away from modern search experiences.

- **Mobile pain** — PDF viewing on mobile devices is tricky, which takes us back to the responsive design issue.

## Bridging the gap between development and documents

The latest release of [Nutrient Document Web Services (DWS) MCP Server](https://www.npmjs.com/package/@nutrient-sdk/dws-mcp-server) introduces conversion capabilities that solve many of the unstructured issues mentioned above.

The new output formats unlock entirely new workflows:

1. **HTML conversion** — Transform PDFs into responsive web content.

2. **Markdown output** — Create LLM-friendly, structured text.

3. **PDF/UA generation** — Ensure accessibility compliance.

This next section will show how this works in practice with a real-world example using Claude Code and Nutrient DWS MCP Server.

**Featured Content**

**Ready to try document processing at scale?**

Get started with Nutrient DWS Processor API today and receive 50 free credits monthly! Perfect for watermark-free document processing targeting many use cases.

[Start Free Trial](https://dashboard.nutrient.io/sign_up/?product=processor)

## Building a tax forms browser: From PDFs to a web app

I was frustrated by the experience of browsing US tax forms. The challenge? All the official forms exist only as PDFs — requiring downloads and creating a poor experience on mobile devices and for LLMs that need to process the content.

Here’s how the new DWS MCP Server capabilities helped solve that in 20 minutes.

### Step 1 — Project setup with Claude Code

To set up DWS MCP Server with Claude Code, you’ll first need an API key from [nutrient.io](https://dashboard.nutrient.io/sign_up/?product=processor). Then, add the server to your project:

```bash

# Add DWS MCP Server to your Claude Code project.

claude mcp add dws-mcp-server -e NUTRIENT_DWS_API_KEY=<your-dws-api-key> -- npx -y @nutrient-sdk/dws-mcp-server --sandbox <your-project-dir>

```

Once configured, the MCP servers become available in Claude Code (`/mcp` command):

```bash

# MCP servers now available in Claude Code

1. dws-mcp-server         ✓ connected

```

Now Nutrient DWS MCP Server can access any file within your project directory and send it off for processing.

### Step 2 — Mass PDF-to-HTML conversion

With a folder full of tax form PDFs organized by category, converting them to HTML became trivial by simply asking Claude:

```bash

Please convert all the tax forms in the `irs-forms` directory to HTML.

```

Previously, I would’ve had to find a program or library to convert all these documents, and then write a script to do so. Now I just ask Claude Code to do it. And this isn’t just limited to forms; this could be documentation Claude Code needs access to, business logic that’s locked up in documents, and yes, it can OCR screenshots with code snippets!

You’ll see Claude Code making MCP calls to the DWS MCP Server for each file. And like magic, HTML appears:

```bash

⏺ dws-mcp-server:document_processor (MCP)(instructions:
                                         {"parts":[{"file":"irs-forms/schedules/f1040s2.pdf"
                                         }],"output":{"type":"html","layout":"reflow"}},
                                         outputPath:
                                         "converted-forms/schedules/f1040s2.html")
  ⎿ File processed successfully using build API and saved to:.../u
    s-tax-forms/converted-forms/schedules/f1040s2.html

```![Form as PDF](@/assets/images/blog/2025/teaching-llms-to-read-pdfs/form-as-pdf.png)

### Step 3 — Building the web interface

With HTML files ready to go, the final step was surprisingly straightforward. One more request to Claude Code:

```bash

Please can you take each converted HTML file and serve these as part of a small web application to allow users to better browse US tax forms. The landing page should display all the forms available in the applicable categories.

```

The result? A clean, organized interface where tax forms load instantly — forms organized by category, responsive design that actually responds, and navigation that makes sense. Twenty minutes from PDF folder to working web app.![Tax Form App Landing Page](@/assets/images/blog/2025/teaching-llms-to-read-pdfs/tax-form-app-landing-page.png)

## The real power: Markdown for AI workflows

HTML solved this simple PDF viewing problem, but what about AI? LLMs struggle with PDFs — they can’t parse the structure, miss crucial formatting, and often hallucinate content. That’s where converting a PDF to Markdown comes in: Markdown gives a model clean, structured text it can actually reason over. (For a no-code path, the [PDF-to-Markdown skill](https://www.nutrient.io/ai/skills/pdf-to-markdown/) runs the same conversion on demand.)

Say your company has years of technical documentation trapped in PDFs. API specs, architecture decisions, compliance documents — all locked away from your AI tools. With DWS MCP Server and Claude Code, you can drop those documents into your project and unlock that knowledge in a single command:

```bash

Please can you convert the PDFs in the `docs` directory to Markdown.

```

Suddenly, Claude Code (and any AI developer tool) can read your documentation as easily as your source code. No more copying and pasting from PDF viewers or other clients. No more OCR errors. Just clean, structured text that LLMs understand. Your specification documents become queryable. Your architectural decisions become searchable. Your business logic becomes accessible.

## Beyond developers: Universal document access

While I’ve focused on the developer experience here, the implications go far beyond coding workflows. The Model Context Protocol isn’t limited to Claude Code — it’s a universal standard. That means these same document processing capabilities work in Claude Desktop and any application that’s MCP compatible.

Your customer support team can convert product manuals. Legal departments can review and digitally sign contracts. And HR can extract resume information for additional processing. All it takes is natural language and DWS MCP Server.

For a deeper dive into all the capabilities — including advanced features like PDF merging, splitting, and watermarking — check out the [original release blog post](https://www.nutrient.io/blog/nutrient-dws-mcp-release/), where you’ll find a comprehensive video walkthrough.

Feeding that structured output into a question-answering system? See [how to build a chat-with-PDF app](https://www.nutrient.io/blog/chat-with-pdf.md) and [multimodal RAG](https://www.nutrient.io/blog/multimodal-rag.md).

## Ready to unlock the full potential of your PDFs?

Start using Nutrient DWS MCP Server to convert documents into HTML and Markdown — and give your LLMs the structured data they need. Whether you’re building AI apps, improving accessibility, or just tired of wrestling with PDFs, it’s time to upgrade your workflow. [Get your API key and start building](https://dashboard.nutrient.io/sign_up/?product=processor).
---

## Related pages

- [The business case for accessibility: Five ways it drives enterprise value](/blog/5-ways-accessibility-drives-enterprise-value.md)
- [Accessibility Untangled Why It Matters Guide](/blog/accessibility-untangled-why-it-matters-guide.md)
- [Advanced Techniques For React Native Ui Components](/blog/advanced-techniques-for-react-native-ui-components.md)
- [`vector_store` holds your indexed documents (see the multimodal RAG post](/blog/agentic-rag.md)
- [Ai Document Automation Extraction To Action](/blog/ai-document-automation-extraction-to-action.md)
- [Ai Legal Assistant Document Authoring](/blog/ai-legal-assistant-document-authoring.md)
- [Amazon Textract Alternatives](/blog/amazon-textract-alternatives.md)
- [Start (clears any prior buffer), navigate the document, then stop into a file.](/blog/android-faster-pdf-rendering.md)
- [Android Pdf Out Of Memory Handling](/blog/android-pdf-out-of-memory-handling.md)
- [Angular File Viewer Pdf Image Office Files](/blog/angular-file-viewer-pdf-image-office-files.md)
- [Auto Tagging And Document Accessibility In Dotnet Sdk](/blog/auto-tagging-and-document-accessibility-in-dotnet-sdk.md)
- [Best Document Ai Platforms](/blog/best-document-ai-platforms.md)
- [Best Document Viewers](/blog/best-document-viewers.md)
- [Build Vs Buy Document Extraction](/blog/build-vs-buy-document-extraction.md)
- [The CEO’s AI playbook: Why decision architecture beats model selection](/blog/ceo-ai-playbook-decision-architecture.md)
- [1. Extract and chunk the PDF.](/blog/chat-with-pdf.md)
- [Complete Guide To Pdfjs](/blog/complete-guide-to-pdfjs.md)
- [Construction Document Data Extraction](/blog/construction-document-data-extraction.md)
- [Convert One Drive Files To Pdf In Sharepoint](/blog/convert-one-drive-files-to-pdf-in-sharepoint.md)
- [Create And Edit Pdfs In Flutter](/blog/create-and-edit-pdfs-in-flutter.md)
- [Create Pdfs With React](/blog/create-pdfs-with-react.md)
- [Creating A Document Scanner With Ocr In Python](/blog/creating-a-document-scanner-with-ocr-in-python.md)
- [Creating And Filling Pdf Forms Programmatically In Javascript](/blog/creating-and-filling-pdf-forms-programmatically-in-javascript.md)
- [The CTO’s AI playbook: Why accountability architecture beats orchestration](/blog/cto-ai-playbook-accountability-architecture.md)
- [Digital Signatures](/blog/digital-signatures.md)
- [Digital Workflow Automation](/blog/digital-workflow-automation.md)
- [Document Ai Vs Ocr](/blog/document-ai-vs-ocr.md)
- [Document Extraction Confidence Scores](/blog/document-extraction-confidence-scores.md)
- [Document Viewer](/blog/document-viewer.md)
- [Document Watermarking](/blog/document-watermarking.md)
- [Emerging threats: Your logging system may be an agentic threat vector](/blog/emerging-threats-your-logging-system.md)
- [Extract Patient Data On Premises](/blog/extract-patient-data-on-premises.md)
- [app.py](/blog/extract-text-from-pdf-using-python.md)
- [Fillable Pdf](/blog/fillable-pdf.md)
- [How To Add Digital Signature To Pdf Using React](/blog/how-to-add-digital-signature-to-pdf-using-react.md)
- [How To Build A Dotnet Maui Pdf Viewer](/blog/how-to-build-a-dotnet-maui-pdf-viewer.md)
- [How To Build A Flutter Pdf Viewer](/blog/how-to-build-a-flutter-pdf-viewer.md)
- [or](/blog/how-to-build-a-javascript-pdf-viewer-with-pdfjs.md)
- [How To Build A Javascript Pdf Viewer](/blog/how-to-build-a-javascript-pdf-viewer.md)
- [or](/blog/how-to-build-a-nextjs-pdf-viewer.md)
- [How To Build A Powerpoint Viewer Using Javascript](/blog/how-to-build-a-powerpoint-viewer-using-javascript.md)
- [Using Yarn](/blog/how-to-build-a-react-excel-viewer.md)
- [How To Build A React Native Pdf Viewer](/blog/how-to-build-a-react-native-pdf-viewer.md)
- [How To Build A React Powerpoint Viewer](/blog/how-to-build-a-react-powerpoint-viewer.md)
- [How To Build A Reactjs File Viewer](/blog/how-to-build-a-reactjs-file-viewer.md)
- [or](/blog/how-to-build-a-reactjs-pdf-viewer-with-react-pdf.md)
- [or](/blog/how-to-build-a-reactjs-pdf-viewer.md)
- [How To Build A Reactjs Viewer With Pdfjs](/blog/how-to-build-a-reactjs-viewer-with-pdfjs.md)
- [How To Build A Vuejs Pdf Viewer With Pdfjs](/blog/how-to-build-a-vuejs-pdf-viewer-with-pdfjs.md)
- [How To Build A Vuejs Pdf Viewer](/blog/how-to-build-a-vuejs-pdf-viewer.md)
- [How To Build An Android Pdf Viewer](/blog/how-to-build-an-android-pdf-viewer.md)
- [How To Build An Angular Pdf Viewer With Ng2 Pdf Viewer](/blog/how-to-build-an-angular-pdf-viewer-with-ng2-pdf-viewer.md)
- [How To Build An Angular Pdf Viewer With Pdfjs](/blog/how-to-build-an-angular-pdf-viewer-with-pdfjs.md)
- [How To Convert Docx To Pdf Using Javascript](/blog/how-to-convert-docx-to-pdf-using-javascript.md)
- [How To Convert Docx To Pdf Using Python](/blog/how-to-convert-docx-to-pdf-using-python.md)
- [How To Convert Html To Pdf Using Html2pdf](/blog/how-to-convert-html-to-pdf-using-html2pdf.md)
- [or](/blog/how-to-convert-html-to-pdf-using-react.md)
- [How To Convert Html To Pdf Using Wkhtmltopdf And Csharp](/blog/how-to-convert-html-to-pdf-using-wkhtmltopdf-and-csharp.md)
- [or](/blog/how-to-convert-html-to-pdf-using-wkhtmltopdf-and-python.md)
- [How To Convert Word To Pdf In Nodejs](/blog/how-to-convert-word-to-pdf-in-nodejs.md)
- [or](/blog/how-to-create-a-react-js-signature-pad.md)
- [How To Create Pdfs With React To Pdf](/blog/how-to-create-pdfs-with-react-to-pdf.md)
- [How To Edit Pdfs Using Ios Pdf Library](/blog/how-to-edit-pdfs-using-ios-pdf-library.md)
- [How To Embed A Pdf Viewer In Your Website](/blog/how-to-embed-a-pdf-viewer-in-your-website.md)
- [How To Extract Tables From Pdf And Images](/blog/how-to-extract-tables-from-pdf-and-images.md)
- [How To Generate Pdf From Html With Nodejs](/blog/how-to-generate-pdf-from-html-with-nodejs.md)
- [base_url tells WeasyPrint where to resolve relative asset paths](/blog/how-to-generate-pdf-reports-from-html-in-python.md)
- [How To Merge Pdfs Using Javascript](/blog/how-to-merge-pdfs-using-javascript.md)
- [How To Ocr Pdfs In Linux](/blog/how-to-ocr-pdfs-in-linux.md)
- [How To Print Pdf In Csharp](/blog/how-to-print-pdf-in-csharp.md)
- [Open an image.](/blog/how-to-use-tesseract-ocr-in-python.md)
- [From an HTML string.](/blog/html-in-pdf-format.md)
- [Html To Pdf In Javascript](/blog/html-to-pdf-in-javascript.md)
- [Javascript Pdf Editors](/blog/javascript-pdf-editors.md)
- [Javascript Pdf Libraries](/blog/javascript-pdf-libraries.md)
- [Langextract Vs Llamaindex Extraction Comparison](/blog/langextract-vs-llamaindex-extraction-comparison.md)
- [Linearized Pdf](/blog/linearized-pdf.md)
- [or](/blog/merge-pdfs.md)
- [Swift Package Manager](/blog/mobile-pdf-sdk.md)
- [`elements` come from your document parser — each has a type and content.](/blog/multimodal-rag.md)
- [Nutrient Flutter 6 Bindings Api](/blog/nutrient-flutter-6-bindings-api.md)
- [Nutrient Vs Conga Composer](/blog/nutrient-vs-conga-composer.md)
- [Online Document Viewer](/blog/online-document-viewer.md)
- [Open Pdf In Your Web App](/blog/open-pdf-in-your-web-app.md)
- [Building WCAG 2.2, Section 508, and PDF/UA-compliant PDFs with an SDK](/blog/pdf-accessibility.md)
- [Extract data from PDF files: A developer guide to structured data from PDFs and scans](/blog/pdf-data-extraction-developer-guide.md)
- [Pdf Extraction Benchmark Opendataloader Bench](/blog/pdf-extraction-benchmark-opendataloader-bench.md)
- [Pdf Extraction Document Case Studies](/blog/pdf-extraction-document-case-studies.md)
- [Pdf Page Labels](/blog/pdf-page-labels.md)
- [Pdf Sdk Compliance Security Checklist](/blog/pdf-sdk-compliance-security-checklist.md)
- [Pdf Sdk Performance Benchmark](/blog/pdf-sdk-performance-benchmark.md)
- [Pdf Ua Compliance Guide](/blog/pdf-ua-compliance-guide.md)
- [Pdfjs Accessibility Structtree Printing](/blog/pdfjs-accessibility-structtree-printing.md)
- [Pdfjs Advanced Loading Streaming Workers](/blog/pdfjs-advanced-loading-streaming-workers.md)
- [Pdfjs Annotation Editor Layer](/blog/pdfjs-annotation-editor-layer.md)
- [Pdfjs Area Annotations Canvas Capture](/blog/pdfjs-area-annotations-canvas-capture.md)
- [Pdfjs Coordinate Systems Pdf To Screen](/blog/pdfjs-coordinate-systems-pdf-to-screen.md)
- [Pdfjs Document Outline Bookmarks Metadata](/blog/pdfjs-document-outline-bookmarks-metadata.md)
- [Pdfjs Eventbus Guide](/blog/pdfjs-eventbus-guide.md)
- [macOS](/blog/pdfjs-file-format-conversion-to-pdf.md)
- [macOS](/blog/pdfjs-generating-pdf-thumbnails-pdf2pic.md)
- [Pdfjs Limitations Commercial Upgrade](/blog/pdfjs-limitations-commercial-upgrade.md)
- [Pdfjs Native Annotation Layer Forms](/blog/pdfjs-native-annotation-layer-forms.md)
- [Pdfjs Navigation Zoom Rotation](/blog/pdfjs-navigation-zoom-rotation.md)
- [Pdfjs Pdf Page Manipulation Pdf Lib](/blog/pdfjs-pdf-page-manipulation-pdf-lib.md)
- [Pdfjs React Viewer Setup](/blog/pdfjs-react-viewer-setup.md)
- [Pdfjs Rendering Overlays React Portals](/blog/pdfjs-rendering-overlays-react-portals.md)
- [Pdfjs Server Side Text Extraction](/blog/pdfjs-server-side-text-extraction.md)
- [Pdfjs Sticky Note Annotations](/blog/pdfjs-sticky-note-annotations.md)
- [Pdfjs Text Highlight Annotations](/blog/pdfjs-text-highlight-annotations.md)
- [Pdfjs Text Search Pdffindcontroller](/blog/pdfjs-text-search-pdffindcontroller.md)
- [Pdfjs Thumbnail Sidebar](/blog/pdfjs-thumbnail-sidebar.md)
- [Process Flows](/blog/process-flows.md)
- [React Native Pdf Annotation](/blog/react-native-pdf-annotation.md)
- [Using Yarn](/blog/react-pdf-editor.md)
- [React Pdf Loading States Errors Passwords](/blog/react-pdf-loading-states-errors-passwords.md)
- [React Pdf Setup Basic Rendering](/blog/react-pdf-setup-basic-rendering.md)
- [or](/blog/sample-blog-updated.md)
- [Sdk Product Updates Q2 2026](/blog/sdk-product-updates-q2-2026.md)
- [Open an image file.](/blog/tesseract-python-guide.md)
- [Define the HTML part of the document.](/blog/top-10-ways-to-generate-pdfs-in-python.md)
- [Top 5 Javascript Pdf Viewers](/blog/top-5-javascript-pdf-viewers.md)
- [or](/blog/top-js-pdf-libraries.md)
- [Convert an HTML file to PDF.](/blog/top-ten-ways-to-convert-html-to-pdf.md)
- [Vector Pdf](/blog/vector-pdf.md)
- [Wcag2 Accessibility Requirements Documents](/blog/wcag2-accessibility-requirements-documents.md)
- [Web Sdk Is Now Headless](/blog/web-sdk-is-now-headless.md)
- [What Are Annotations](/blog/what-are-annotations.md)
- [What Is A Vpat](/blog/what-is-a-vpat.md)
- [What Is Document Processing](/blog/what-is-document-processing.md)
- [What Is Intelligent Document Processing](/blog/what-is-intelligent-document-processing.md)
- [What Is Pdf Ua](/blog/what-is-pdf-ua.md)
- [Why Pdfium Is A Trusted Platform For Pdf Rendering](/blog/why-pdfium-is-a-trusted-platform-for-pdf-rendering.md)
- [Why Your Ai Agent Hallucinates Pdf Table Data](/blog/why-your-ai-agent-hallucinates-pdf-table-data.md)

