Skip to main content
Glama

📄 MCP PDF

PDF 처리를 위한 FastMCP 서버

텍스트 추출, OCR, 표, 양식, 주석, 마크다운↔PDF 등을 위한 47개의 도구

Python 3.11+ FastMCP License: MIT PyPI

MCP Office Tools과 함께 사용하면 좋습니다.


기능

MCP PDF는 여러 라이브러리를 사용하여 자동 대체(fallback) 방식으로 PDF에서 콘텐츠를 추출합니다. 한 가지 방법이 실패하면 다른 방법을 시도합니다.

핵심 기능:

  • 텍스트 추출: PyMuPDF, pdfplumber 또는 pypdf 사용 (자동 대체)

  • 표 추출: Camelot, pdfplumber 또는 Tabula 사용 (자동 대체)

  • OCR: Tesseract를 통한 스캔 문서 인식

  • 양식 처리: PDF 양식 추출, 작성 및 생성

  • 문서 조립: 페이지 병합, 분할, 순서 변경

  • 주석: 스티커 메모, 강조 표시, 스탬프

  • 벡터 그래픽: 도식 및 기술 도면을 위한 SVG 추출

  • 형식 변환: PDF ↔ 마크다운 (PDF→MD는 PyMuPDF, MD→PDF는 pandoc 사용)


Related MCP server: PDF MCP Flow

빠른 시작

# Run from PyPI (one-shot, no permanent install)
uvx mcp-pdf

# Add to Claude Code — note the `--` separator before uvx
claude mcp add pdf-tools -- uvx mcp-pdf

# Include the markdown_to_pdf tool (requires pandoc on host)
claude mcp add pdf-tools -- uvx --from "mcp-pdf[markdown]" mcp-pdf

uvx는 도구 설치를 적극적으로 캐싱합니다. 새 릴리스로 업그레이드한 후에는 uvx --refresh mcp-pdf를 사용하여 새로 고침을 강제할 수 있습니다(추가 기능을 사용하는 경우 uvx --refresh --from "mcp-pdf[markdown]" mcp-pdf).

git clone https://github.com/rsp2k/mcp-pdf
cd mcp-pdf
uv sync

# System dependencies (Ubuntu/Debian)
sudo apt-get install tesseract-ocr tesseract-ocr-eng poppler-utils ghostscript

# For markdown_to_pdf — pick one PDF-engine route:
sudo apt-get install pandoc tectonic                                          # recommended (small)
# or:  sudo apt-get install pandoc texlive-xetex texlive-latex-extra          # full TeX
# or:  sudo apt-get install pandoc && pip install weasyprint                  # skip TeX

# Verify
uv run python examples/verify_installation.py

도구

콘텐츠 추출

도구

기능

extract_text

대용량 파일을 위한 자동 청킹 기능을 사용하여 PDF 페이지에서 텍스트 추출

extract_tables

표를 JSON, CSV 또는 마크다운으로 추출

extract_images

포함된 이미지 추출

extract_links

페이지 필터링을 통해 모든 하이퍼링크 가져오기

ocr_pdf

Tesseract를 사용하여 스캔된 문서 OCR 수행

extract_vector_graphics

벡터 그래픽을 SVG로 내보내기 (도식, 차트, 도면)

형식 변환

도구

기능

pdf_to_markdown

구조를 유지하며 PDF를 마크다운으로 변환; 이미지 및 SVG 벡터를 디스크로 추출

markdown_to_pdf

자동 감지된 엔진을 사용하여 pandoc을 통해 .md 파일(또는 인라인 텍스트)을 PDF로 변환

markdown_to_pdf 요구 사항: pip install mcp-pdf[markdown] 및 pandoc 바이너리, 그리고 PATH에 최소 하나 이상의 PDF 엔진(xelatex, pdflatex, tectonic, weasyprint 또는 wkhtmltopdf)이 필요합니다. 도구는 사용 가능한 엔진을 자동 감지하여 가장 품질이 높은 것을 사용합니다. pdf_engine=을 전달하여 재정의하거나 extra_args=를 통해 원시 pandoc 옵션을 전달할 수 있습니다.

문서 분석

도구

기능

extract_metadata

제목, 작성자, 생성 날짜, 페이지 수 등 가져오기

get_document_structure

목차 및 책갈피 추출

analyze_layout

열, 머리글, 바닥글 감지

is_scanned_pdf

PDF에 OCR이 필요한지 확인

compare_pdfs

텍스트, 구조 또는 메타데이터별로 두 PDF 비교

analyze_pdf_health

손상 여부 및 최적화 기회 확인

analyze_pdf_security

암호화, 권한, 서명 보고

양식

도구

기능

extract_form_data

양식 필드 이름 및 값 가져오기

fill_form_pdf

JSON에서 양식 필드 채우기

create_form_pdf

텍스트 필드, 체크박스, 드롭다운이 포함된 새 양식 생성

add_form_fields

기존 PDF에 필드 추가

허가 양식 (좌표 기반)

스캔된 PDF나 대화형 필드가 없는 양식용입니다. (x, y) 좌표에 텍스트를 그립니다.

도구

기능

fill_permit_form

좌표에 그려서 모든 PDF 채우기 (스캔된 양식과 작동)

get_field_schema

유효성 검사 또는 UI 생성을 위한 필드 정의 가져오기

validate_permit_form_data

채우기 전 필드 스키마에 대해 데이터 확인

preview_field_positions

필드 경계를 보여주는 PDF 생성 (디버깅용)

insert_attachment_pages

"X 페이지 참조"와 함께 이미지/텍스트 페이지 삽입

요구 사항: pip install mcp-pdf[forms] (reportlab 종속성 추가)

문서 조립

도구

기능

merge_pdfs

책갈피를 유지하며 여러 PDF 결합

split_pdf_by_pages

페이지 범위별로 분할

split_pdf_by_bookmarks

챕터/섹션 경계에서 분할

reorder_pdf_pages

사용자 지정 순서로 페이지 재배치

주석

도구

기능

add_sticky_notes

주석 추가

add_highlights

텍스트 영역 강조 표시

add_stamps

승인됨/초안/기밀 스탬프 추가

extract_all_annotations

주석을 JSON으로 내보내기


대체(Fallback) 작동 방식

서버는 각 작업에 대해 여러 라이브러리를 시도합니다:

텍스트 추출:

  1. PyMuPDF (가장 빠름)

  2. pdfplumber (복잡한 레이아웃에 더 좋음)

  3. pypdf (가장 호환성이 높음)

표 추출:

  1. Camelot (정확도가 가장 높음, Ghostscript 필요)

  2. pdfplumber (종속성 없음)

  3. Tabula (Java 필요)

PDF가 한 라이브러리에서 실패하면 다음 라이브러리가 자동으로 시도됩니다.


토큰 관리

대용량 PDF는 MCP 응답 제한을 초과할 수 있습니다. 서버는 이를 다음과 같이 처리합니다:

  • 자동 청킹: 대용량 문서를 페이지 그룹으로 분할

  • 표 행 제한: 거대한 표가 응답을 넘치게 하는 것을 방지

  • 요약 모드: 전체 내용 없이 구조만 반환

# Get first 10 pages
result = await extract_text("huge.pdf", pages="1-10")

# Limit table rows
tables = await extract_tables("data.pdf", max_rows_per_table=50)

# Structure only
tables = await extract_tables("data.pdf", summary_only=True)

URL 처리

PDF는 HTTPS URL에서 직접 가져올 수 있습니다:

result = await extract_text("https://example.com/report.pdf")

파일은 후속 작업을 위해 로컬에 캐시됩니다.


시스템 종속성

일부 기능은 시스템 패키지가 필요합니다:

기능

종속성

OCR

tesseract-ocr

Camelot 표

ghostscript

Tabula 표

default-jre-headless

PDF를 이미지로

poppler-utils

markdown_to_pdf

pandoc + 다음 중 하나: tectonic, texlive-xetex (+ texlive-latex-extra), weasyprint, wkhtmltopdf

markdown_to_pdf를 위한 PDF 엔진 선택

Pandoc은 마크다운 → HTML 또는 LaTeX → PDF로 변환합니다. LaTeX 경로는 가장 세련된 출력을 생성하지만 TeX 설치가 필요합니다. 장단점:

엔진

디스크 크기

참고

tectonic

~30 MB

새 설치에 권장. 단일 정적 바이너리. 필요 시 LaTeX 패키지를 다운로드하므로 대규모 사전 설치가 필요 없습니다.

xelatex + texlive-latex-extra

~500 MB

설치 후 최고의 출력. 이미 TeX를 실행 중인 경우 사용하세요. -extra 패키지가 중요합니다: pandoc의 기본 템플릿은 lastpage, xcolor, framed, fancyhdr 등이 필요하며, 이들은 texlive-xetex가 아닌 여기에 포함되어 있습니다.

xelatex 단독 (texlive-xetex만)

~200 MB

자주 깨짐. 실제 문서에서 ! LaTeX Error: File 'X.sty' not found 오류가 발생할 수 있습니다.

weasyprint

~40 MB

순수 Python (pip install weasyprint) + cairo/pango 시스템 라이브러리. HTML/CSS 경로 — LaTeX 없음. 간단한 문서에는 좋지만 수학, 각주, 인용에는 약합니다.

wkhtmltopdf

~40 MB

구형 HTML-to-PDF 도구. 적절하지만 유지 관리가 덜 활발합니다.

Ubuntu/Debian:

sudo apt-get install tesseract-ocr tesseract-ocr-eng poppler-utils ghostscript default-jre-headless

# For markdown_to_pdf — pick one engine route:

# Option A — tectonic (smallest, downloads packages on demand)
sudo apt-get install pandoc
# tectonic isn't in apt — install via cargo or download static binary:
#   https://tectonic-typesetting.github.io/en-US/install.html

# Option B — full TeX (best quality, large download)
sudo apt-get install pandoc texlive-xetex texlive-latex-extra texlive-fonts-extra

# Option C — weasyprint (skip TeX entirely)
sudo apt-get install pandoc
pip install weasyprint

Arch Linux:

sudo pacman -S tesseract tesseract-data-eng poppler ghostscript jre-openjdk-headless

# For markdown_to_pdf — pick one engine route:

# Option A — tectonic (recommended for new installs, in official repo)
sudo pacman -S pandoc tectonic

# Option B — full TeX (best output, ~500 MB)
sudo pacman -S pandoc texlive-xetex texlive-latexextra texlive-fontsextra

# Option C — weasyprint (skip TeX)
sudo pacman -S pandoc
pip install weasyprint   # or: uv pip install weasyprint

# Option D — wkhtmltopdf (from AUR)
yay -S wkhtmltopdf-static

macOS (Homebrew):

brew install tesseract poppler ghostscript

# For markdown_to_pdf — pick one engine route:

# Option A — tectonic (recommended)
brew install pandoc tectonic

# Option B — full TeX (mactex-no-gui includes the latex-extra equivalent)
brew install pandoc
brew install --cask mactex-no-gui

# Option C — weasyprint
brew install pandoc weasyprint

선택적 추가 기능

기본 설치는 가볍게 유지됩니다. 무겁거나 특수한 종속성은 추가 기능 뒤에 숨겨져 있습니다:

추가 기능

추가 항목

설치 시기

mcp-pdf[forms]

reportlab

양식 생성 도구 (create_form_pdf, 허가 양식)

mcp-pdf[tables]

camelot-py, tabula-py

더 높은 정확도의 표 추출 (Java + Ghostscript 필요)

mcp-pdf[markdown]

pypandoc

markdown_to_pdf 도구 (pandoc 바이너리 필요)

mcp-pdf[all]

위 모든 것

모든 기능을 원할 때


구성

선택적 환경 변수:

변수

목적

MCP_PDF_ALLOWED_PATHS

파일 출력을 위한 콜론으로 구분된 디렉토리

PDF_TEMP_DIR

처리를 위한 임시 디렉토리 (기본값: /tmp/mcp-pdf-processing)

TESSDATA_PREFIX

Tesseract 언어 데이터 위치


개발

# Run tests
uv run pytest

# With coverage
uv run pytest --cov=mcp_pdf

# Format
uv run black src/ tests/

# Lint
uv run ruff check src/ tests/

라이선스

MIT

A
license - permissive license
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI-driven PDF document processing including PDF to Markdown conversion, intelligent text and table extraction, image extraction, format conversion between PDF/Word/Markdown, batch processing, and fuzzy search - optimized for LLM context and RAG workflows.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides intelligent OCR and PDF processing capabilities that automatically detect whether PDFs contain digital text or scanned images and apply appropriate extraction methods. Supports text extraction, OCR processing, structure analysis, and batch operations.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI applications to read and process PDF files with intelligent file search, text extraction, image processing, and optional OCR support for scanned documents.
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/rsp2k/mcp-pdf'

If you have feedback or need assistance with the MCP directory API, please join our Discord server