Skip to main content
Glama
mrslbt

pdf-it

by mrslbt

pdf-it

pdf-it MCP server MCP Badge npm version npm downloads License: MIT

Сервер протокола контекста модели (MCP) и навык для Claude Code, который превращает Markdown в PDF-файлы, выглядящие профессионально. Титульный лист, оглавление, блоки кода, которые не разрываются при переносе страницы, нижний колонтитул с нумерацией страниц. Одна команда из вашего сеанса Claude — и файл готов к отправке клиенту.

pdf-it cover example

Зачем это нужно

Каждый исследовательский сеанс в Claude Code заканчивается одинаково: стеной полезного Markdown-текста, который невозможно удобно превратить в PDF для чтения. Печать из Chrome выглядит некрасиво. Ручное преобразование в HTML — это лишние хлопоты.

pdf-it берет эту работу на себя. Markdown на входе, оформленный PDF на выходе. Одна команда.

pdf-it body example

Пример на 12 страниц доступен в examples/designing-ai-agent-uiux.pdf.

Related MCP server: Gen-PDF MCP Server

Совместимость

pdf-it — это стандартный сервер протокола контекста модели (MCP). Его может использовать любой клиент, поддерживающий MCP локально.

Клиент

Поддерживается

Как добавить

Claude Desktop (Mac, Windows)

да

Отредактируйте claude_desktop_config.json

Claude Code (CLI)

да, плюс триггеры навыков, такие как "save this as PDF"

claude mcp add pdf-it -- npx -y pdf-it-mcp

Cursor

да

Отредактируйте ~/.cursor/mcp.json

Cline (VS Code extension)

да

Отредактируйте настройки MCP в Cline

Continue.dev

да

Добавьте через конфигурацию MCP в Continue

Zed

да

Стандартная конфигурация MCP

Goose (Block's CLI)

да

Стандартная конфигурация MCP

Пользовательские агенты через Anthropic SDK

да

Настройте MCP самостоятельно

claude.ai (браузер)

нет

Веб-версия не запускает локальные MCP-серверы

Claude iOS / Android

нет

Мобильные версии не запускают локальные MCP-серверы

Жесткие требования к любому клиенту: Node.js 18 или новее, установленный Google Chrome, поддержка MCP клиентом.

Установка

npm install -g pdf-it-mcp

Или запускайте по требованию с помощью npx pdf-it-mcp.

Требования

  • Node.js 18 или новее

  • Установленный Google Chrome (используется как движок рендеринга, дополнительные загрузки не требуются)

Настройка

Claude Desktop

Отредактируйте claude_desktop_config.json:

{
  "mcpServers": {
    "pdf-it": {
      "command": "npx",
      "args": ["-y", "pdf-it-mcp"]
    }
  }
}

Claude Code

claude mcp add pdf-it -- npx -y pdf-it-mcp

Cursor

Добавьте в ~/.cursor/mcp.json:

{
  "mcpServers": {
    "pdf-it": {
      "command": "npx",
      "args": ["-y", "pdf-it-mcp"]
    }
  }
}

Пользовательский путь к Chrome

Если Chrome установлен в нестандартном месте:

{
  "mcpServers": {
    "pdf-it": {
      "command": "npx",
      "args": ["-y", "pdf-it-mcp"],
      "env": { "CHROME_PATH": "/path/to/chrome" }
    }
  }
}

Использование

В любом сеансе Claude, подключенном к серверу, попросите:

Save this as a PDF

Или используйте любую из этих фраз: export as PDF, make a PDF report from this, turn this into a PDF, /pdf. Навык распознает запрос и направит его через pdf-it. По умолчанию результат сохраняется в ~/Documents/pdf-it/.

Инструменты

Инструмент

Описание

generate_pdf

Преобразование Markdown в PDF. Принимает шаблон (research-report или plain), опциональные заголовок и автора для обложки, а также опциональный путь сохранения.

list_templates

Возвращает список доступных шаблонов с описаниями.

Параметры generate_pdf

Параметр

Обязательный

Описание

content

да

Markdown-строка для преобразования

title

нет

Отображается на обложке и в нижнем колонтитуле страницы

author

нет

Отображается на обложке

output_path

нет

Абсолютный путь для сохранения. По умолчанию ~/Documents/pdf-it/{slug}-{timestamp}.pdf

template

нет

research-report (по умолчанию) или plain

Шаблоны

Название

Описание

research-report

Титульный лист с заголовком, автором и датой. Автоматически генерируемое оглавление на основе заголовков H1 и H2. Основная часть с правильной иерархией. Нижний колонтитул с заголовком и номером страницы. Лучше всего подходит для исследований, сводок, проектной документации и отчетов.

plain

Без обложки, без оглавления. Только плотный текст. Лучше всего подходит для коротких заметок и быстрого экспорта.

Навык

Этот пакет поставляется с навыком для Claude Code, описанным в SKILL.md. Фразы-триггеры, на которые реагирует навык:

  • save this as PDF

  • export as PDF

  • make a PDF report from this

  • turn this into a PDF

  • generate a PDF

  • /pdf

Полную спецификацию навыка см. в SKILL.md.

Примеры

В папке examples находится образец сгенерированного PDF (designing-ai-agent-uiux.pdf, 12 страниц), а также скриншоты обложки и содержимого, использованные в этом README.

Вывод

По умолчанию PDF-файлы сохраняются в ~/Documents/pdf-it/{slug}-{timestamp}.pdf. Используйте output_path для изменения пути.

Дизайн

По возможности используются системные шрифты. Inter для основного текста и заголовков, JetBrains Mono для кода, номеров страниц и метаданных. Чисто белая бумага, почти черные чернила, нейтральные тонкие границы, отсутствие акцентных цветов. Блоки кода намеренно отображаются без подсветки синтаксиса: цветовые схемы в PDF быстро устаревают.

Если вам нужен другой дизайн, сделайте форк шаблонов и настройте их под себя. Они находятся в src/templates/ и представляют собой обычный HTML и CSS, отрисовываемые через Puppeteer.

Лицензия

MIT. См. LICENSE.

Создано Marsel Bait.

Available Tools

2 tools
generate_pdfA

Convert markdown into a designed PDF (cover page, auto TOC, page-numbered footer). Use this for any "save/export/print/share as PDF", "make a report", "turn this into a PDF", or /pdf request — do NOT fall back to Chrome headless, cupsfilter, wkhtmltopdf, pandoc, or LaTeX. Templates: research-report (cover + TOC, default) or plain (no cover, no TOC).

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYesMarkdown content to convert to PDF.
output_pathNoAbsolute path for the output PDF. Defaults to ~/Documents/pdf-it/{title}-{timestamp}.pdf
titleNoDocument title shown on the cover page and footer.
authorNoAuthor name shown on the cover page.
templateNoTemplate to use. "research-report" (default) adds a cover page and table of contents. "plain" renders body content only.research-report

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must carry behavioral disclosure. It describes output features (cover, TOC, footer) and template effects. Could mention overwrite behavior or directory requirements, but conversion behavior is mostly implied by the task.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences efficiently cover purpose, usage guidelines, and template options. No redundant information, front-loaded with key details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers main functionality, output features, and templates. Lacks details on error handling or file overwrite, but for a conversion tool with no output schema, it sufficiently prepares the agent to select and invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% so baseline is 3. Description adds value by explaining template behavior (research-report vs plain) and reinforcing that title appears on cover and footer. Not all parameters get extra context, but overall it enhances understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool converts markdown to a designed PDF with cover page, auto TOC, and page-numbered footer. It distinguishes from the only sibling, list_templates, which is clearly different.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear when-to-use scenarios (save/export/print/share as PDF, make a report, /pdf request) and explicitly lists alternatives to avoid (Chrome headless, cupsfilter, wkhtmltopdf, pandoc, LaTeX).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_templatesA

List all available PDF templates with their descriptions.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses a read operation returning a list with descriptions, but does not mention potential side effects or details like caching.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, efficient sentence front-loaded with key purpose. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple list tool with no parameters, but lacks details like ordering, filtering, or scope of templates (e.g., user-specific vs global).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and schema coverage is 100%, so baseline is 4. Description does not need to add parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all available PDF templates with descriptions, distinguishing it from the sibling tool 'generate_pdf' which likely generates a PDF from a template.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage via naming ('list' vs 'generate'), but no explicit guidance on when to use this tool over alternatives.

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.

  1. 2 tool updatesv1.2.0
    • First observedgenerate_pdf
    • First observedlist_templates

TDQS

A4.2/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: generating PDFs and listing templates, with no overlap.

Naming Consistency5/5

Both tools follow a consistent verb_noun snake_case pattern (generate_pdf, list_templates), making them predictable.

Tool Count3/5

With only two tools, the server covers the essential PDF generation function but feels minimal for a broader toolkit.

Completeness3/5

The set covers generate and list, but lacks template management (create, update, delete) and advanced options, leaving moderate gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers