Skip to main content
Glama

Doc MCP Server šŸ“„

Python License Stars MCP GitHub

A Model Context Protocol (MCP) server for document processing — PDF generation with Markdown rendering, text extraction, merging, and web-to-PDF conversion.

Built for AI agents. Works with Hermes Agent, Claude Code, Cursor, and any MCP-compatible client.

✨ Features

Tool

Description

markdown_to_pdf

Render Markdown → PDF with headings, lists, code blocks, HR

generate_pdf

Simple plain text → PDF with custom font size

url_to_pdf

Fetch a URL via Jina Reader and save as PDF

extract_pdf_text

Extract text from any PDF (file, URL, or base64)

pdf_metadata

Read PDF metadata (title, author, pages, size)

merge_pdfs

Merge multiple PDFs into a single document

convert_text

Text format conversion & cleanup (case, whitespace)

count_words

Word, character, line, paragraph & reading time stats

Related MCP server: mcp-doc-reader

šŸš€ Quick Start

Install

# From PyPI (coming soon)
pip install doc-mcp-server

# Or directly from GitHub
pip install git+https://github.com/ceeyang-ai/doc-mcp-server.git

Run

# Start as MCP server (stdio mode)
doc-mcp-server

šŸ”Œ Usage with AI Agents

Hermes Agent

Add to ~/.hermes/config.yaml:

mcp_servers:
  doc:
    command: "doc-mcp-server"

Restart → use mcp_doc_markdown_to_pdf, mcp_doc_extract_pdf_text, etc.

Claude Code / Cursor / Any MCP Client

Add to your MCP config:

{
  "mcpServers": {
    "doc": {
      "command": "doc-mcp-server"
    }
  }
}

šŸ“– Examples

Markdown → PDF

# Via MCP tool call
result = markdown_to_pdf(
    markdown="# My Report\n\n- Item 1\n- Item 2\n\n```python\nprint('hello')\n```",
    title="Report",
    filename="report.pdf"
)

Merge PDFs

result = merge_pdfs(
    sources=[
        "https://example.com/doc1.pdf",
        "/path/to/local/file.pdf",
    ]
)

URL → PDF

result = url_to_pdf(
    url="https://en.wikipedia.org/wiki/Markdown",
    filename="wiki-md.pdf"
)

šŸ›  Requirements

  • Python 3.10+

  • fpdf2 ≄ 2.8

  • PyMuPDF ≄ 1.24

  • mcp ≄ 1.0

šŸ“¦ Project Structure

doc-mcp-server/
ā”œā”€ā”€ doc_mcp_server/
│   └── __init__.py       # All tools + MarkdownPDF engine
ā”œā”€ā”€ pyproject.toml         # Build config (setuptools)
ā”œā”€ā”€ README.md
└── LICENSE (MIT)

šŸ‘Øā€šŸ’» Development

git clone https://github.com/ceeyang-ai/doc-mcp-server.git
cd doc-mcp-server
pip install -e .
python3 -c "from doc_mcp_server import markdown_to_pdf; print(markdown_to_pdf('# Hello', 'Test'))"

šŸ“„ License

MIT — free for personal and commercial use.

Available Tools

8 tools
convert_textD

Text format conversion and cleanup.

Inputs: text (required), to_lower, to_upper, strip_whitespace, +1 more. Returns: result

count_wordsA

Count words, characters, lines, and paragraphs.

Inputs: text (required). Returns: result

extract_pdf_textB

Extract text content from a PDF file.

Args: source: File path, URL, or base64 PDF content

Inputs: source (required). Returns: result

generate_pdfC

Generate a simple PDF from plain text content.

Inputs: content (required), title, filename, font_size. Returns: result

markdown_to_pdfC

Convert markdown text into a formatted PDF.

Supports: # headings, bold, - lists, 1. numbered lists, code blocks, --- horizontal rules, paragraphs.

Inputs: markdown (required), title, filename. Returns: result

merge_pdfsB

Merge multiple PDF files into a single PDF.

Args: sources: List of file paths, URLs, or base64 PDF contents

Inputs: sources (required). Returns: result

pdf_metadataC

Read metadata from a PDF file.

Inputs: source (required). Returns: result

url_to_pdfA

Fetch a web page URL and save its content as PDF.

Uses Jina AI reader to get clean markdown.

Inputs: url (required), filename. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: text conversion, word counting, PDF extraction, PDF generation (two variants), PDF merging, metadata reading, and URL-to-PDF conversion. No two tools have overlapping functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., convert_text, extract_pdf_text, merge_pdfs). The naming is predictable and easy to understand.

    Tool Count5/5

    With 8 tools covering text conversion, word counting, and various PDF operations (extraction, generation, merging, metadata, URL conversion), the count is well-scoped for a document processing server.

    Completeness4/5

    Missing some common operations like converting PDFs to other formats or editing PDF content, but the set is complete for core document tasks (create, read, merge, convert, and get metadata).

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Provides PDF.co API functionality through the Model Context Protocol, enabling AI assistants to perform various PDF processing tasks like conversion, editing, searching, and security operations.
      38
      38 PyPI
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Converts files (PDF, images, audio, DOCX, XLSX, PPTX) and web content (YouTube transcripts, Bing search, general pages) to Markdown via the Model Context Protocol.
      Apache 2.0