> ## Documentation Index
> Fetch the complete documentation index at: https://markdown2pdf.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Context Protocol

> Easily use markdown2pdf.ai to convert markdown (.md) to high-quality and impactful PDF in your Model Context Protocol (MCP)-based agentic workflows using our MCP server. 

<iframe class="mint-w-full mint-aspect-video mint-rounded-xl" src="https://www.youtube.com/embed/XfvVHCr7Jdg?autoplay=1&mute=1&controls=0&modestbranding=1&rel=0" title="markdown2pdf MCP demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" />

# Getting started

<Icon icon="github" iconType="solid" size={20} /> [github.com/Serendipity-AI/markdown2pdf-mcp](https://github.com/Serendipity-AI/markdown2pdf-mcp)

## For Claude Desktop users

Get started using the pre-built markdown2pdf server in Claude for Desktop. You can find our [MCP server here](https://github.com/Serendipity-AI/markdown2pdf-mcp).

In this tutorial you will extend [Claude for Desktop](https://claude.ai/download) so that it can convert markdown to PDF using this service, prompting for payment when required. You can see how this looks below.

<img src="https://mintcdn.com/serendipityai/MPEqWBFcxH09rjQB/images/mcp-demo.png?fit=max&auto=format&n=MPEqWBFcxH09rjQB&q=85&s=e19bf756825ccee957784f0c3780f6cd" width="1300" height="2050" data-path="images/mcp-demo.png" />

Don’t worry — it will ask you for your permission before executing these actions!

### 1. Download Claude for Desktop

First, start by downloading Claude for Desktop, choosing either macOS or Windows. (Linux is not yet supported for Claude for Desktop.)

Then follow the installation instructions.

If you already have Claude for Desktop, make sure it’s on the latest version by clicking on the Claude menu on your computer and selecting “Check for Updates…”

<Accordion title="Why Claude for Desktop and not Claude.ai?">
  Because servers are locally run, MCP currently only supports desktop hosts. Remote hosts are in active development.
</Accordion>

### 2. Add the markdown2pdf server

To add this functionality, we will be installing a pre-built markdown2pdf server in Claude for Desktop.

Get started by opening up the Claude menu on your computer and select “Settings…” Please note that these are not the Claude Account Settings found in the app window itself.

This is what it should look like on a Mac:

<img src="https://mintcdn.com/serendipityai/MPEqWBFcxH09rjQB/images/quickstart-menu.png?fit=max&auto=format&n=MPEqWBFcxH09rjQB&q=85&s=afdbeaa5852b8113d995d14afb31831f" width="644" height="568" data-path="images/quickstart-menu.png" />

Click on “Developer” in the left-hand bar of the Settings pane, and then click on “Edit Config”:

<img src="https://mintcdn.com/serendipityai/MPEqWBFcxH09rjQB/images/quickstart-developer.png?fit=max&auto=format&n=MPEqWBFcxH09rjQB&q=85&s=06e9f6541a1267752ee48811c1c54798" width="1688" height="534" data-path="images/quickstart-developer.png" />

This will create a configuration file at:

macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
Windows: `%APPDATA%\Claude\claude_desktop_config.json`

if you don’t already have one, and will display the file in your file system. Open up the configuration file in any text editor. Replace the file contents with this:

<Tabs>
  <Tab title="MacOS/Linux">
    ```json theme={null}
    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@serendipityai/markdown2pdf-mcp"
          ]
        }
      }
    }
    ```
  </Tab>

  <Tab title="Windows">
    ```json theme={null}
    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@serendipityai/markdown2pdf-mcp"
          ]
        }
      }
    }
    ```
  </Tab>
</Tabs>

You will also need Node.js on your computer for this to run properly. To verify you have Node installed, open the command line on your computer.

On macOS, open the Terminal from your Applications folder
On Windows, press Windows + R, type “cmd”, and press Enter
Once in the command line, verify you have Node installed by entering in the following command:

```bash theme={null}
node --version
```

If you get an error saying “command not found” or “node is not recognized”, download Node from [nodejs.org](https://nodejs.org).

<Tip>
  How does the configuration file work?<br />

  This configuration file tells Claude for Desktop which MCP servers to start up every time you start the application. In this case, we have added one server called “markdown2pdf” that will use the Node npx command to install and run @modelcontextprotocol/markdown2pdf. This server, described here, will let you convert markdown to PDF.
</Tip>

<Warning>
  Command Privileges<br />

  Claude for Desktop will run the commands in the configuration file with the permissions of your user account, and access to your local files. Only add commands if you understand and trust the source.
</Warning>

### 3. Restart Claude

After updating your configuration file, you need to restart Claude for Desktop.

Upon restarting, you should see a settings icon in the bottom left corner of the input box:

<img src="https://mintcdn.com/serendipityai/MPEqWBFcxH09rjQB/images/quickstart-settings.png?fit=max&auto=format&n=MPEqWBFcxH09rjQB&q=85&s=58d1f281daa5957acd9332dae5a3d819" width="1480" height="922" data-path="images/quickstart-settings.png" />

After clicking on the settings icon, you should see the tools that come with the markdown2pdf server.

### 4. Try it out!

You can now talk to Claude and ask it to convert any markdown content in to PDF format. It should know when to call the relevant tools and facilitate any payments required. As needed, Claude will call the relevant tools and seek your approval before taking an action.
