MCP PDF
📄 MCP PDF
PDF 처리를 위한 FastMCP 서버
텍스트 추출, OCR, 표, 양식, 주석, 마크다운↔PDF 등을 위한 47개의 도구
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도구
콘텐츠 추출
도구 | 기능 |
| 대용량 파일을 위한 자동 청킹 기능을 사용하여 PDF 페이지에서 텍스트 추출 |
| 표를 JSON, CSV 또는 마크다운으로 추출 |
| 포함된 이미지 추출 |
| 페이지 필터링을 통해 모든 하이퍼링크 가져오기 |
| Tesseract를 사용하여 스캔된 문서 OCR 수행 |
| 벡터 그래픽을 SVG로 내보내기 (도식, 차트, 도면) |
형식 변환
도구 | 기능 |
| 구조를 유지하며 PDF를 마크다운으로 변환; 이미지 및 SVG 벡터를 디스크로 추출 |
| 자동 감지된 엔진을 사용하여 pandoc을 통해 |
markdown_to_pdf 요구 사항: pip install mcp-pdf[markdown] 및 pandoc 바이너리, 그리고 PATH에 최소 하나 이상의 PDF 엔진(xelatex, pdflatex, tectonic, weasyprint 또는 wkhtmltopdf)이 필요합니다. 도구는 사용 가능한 엔진을 자동 감지하여 가장 품질이 높은 것을 사용합니다. pdf_engine=을 전달하여 재정의하거나 extra_args=를 통해 원시 pandoc 옵션을 전달할 수 있습니다.
문서 분석
도구 | 기능 |
| 제목, 작성자, 생성 날짜, 페이지 수 등 가져오기 |
| 목차 및 책갈피 추출 |
| 열, 머리글, 바닥글 감지 |
| PDF에 OCR이 필요한지 확인 |
| 텍스트, 구조 또는 메타데이터별로 두 PDF 비교 |
| 손상 여부 및 최적화 기회 확인 |
| 암호화, 권한, 서명 보고 |
양식
도구 | 기능 |
| 양식 필드 이름 및 값 가져오기 |
| JSON에서 양식 필드 채우기 |
| 텍스트 필드, 체크박스, 드롭다운이 포함된 새 양식 생성 |
| 기존 PDF에 필드 추가 |
허가 양식 (좌표 기반)
스캔된 PDF나 대화형 필드가 없는 양식용입니다. (x, y) 좌표에 텍스트를 그립니다.
도구 | 기능 |
| 좌표에 그려서 모든 PDF 채우기 (스캔된 양식과 작동) |
| 유효성 검사 또는 UI 생성을 위한 필드 정의 가져오기 |
| 채우기 전 필드 스키마에 대해 데이터 확인 |
| 필드 경계를 보여주는 PDF 생성 (디버깅용) |
| "X 페이지 참조"와 함께 이미지/텍스트 페이지 삽입 |
요구 사항: pip install mcp-pdf[forms] (reportlab 종속성 추가)
문서 조립
도구 | 기능 |
| 책갈피를 유지하며 여러 PDF 결합 |
| 페이지 범위별로 분할 |
| 챕터/섹션 경계에서 분할 |
| 사용자 지정 순서로 페이지 재배치 |
주석
도구 | 기능 |
| 주석 추가 |
| 텍스트 영역 강조 표시 |
| 승인됨/초안/기밀 스탬프 추가 |
| 주석을 JSON으로 내보내기 |
대체(Fallback) 작동 방식
서버는 각 작업에 대해 여러 라이브러리를 시도합니다:
텍스트 추출:
PyMuPDF (가장 빠름)
pdfplumber (복잡한 레이아웃에 더 좋음)
pypdf (가장 호환성이 높음)
표 추출:
Camelot (정확도가 가장 높음, Ghostscript 필요)
pdfplumber (종속성 없음)
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 |
|
Camelot 표 |
|
Tabula 표 |
|
PDF를 이미지로 |
|
|
|
markdown_to_pdf를 위한 PDF 엔진 선택
Pandoc은 마크다운 → HTML 또는 LaTeX → PDF로 변환합니다. LaTeX 경로는 가장 세련된 출력을 생성하지만 TeX 설치가 필요합니다. 장단점:
엔진 | 디스크 크기 | 참고 |
| ~30 MB | 새 설치에 권장. 단일 정적 바이너리. 필요 시 LaTeX 패키지를 다운로드하므로 대규모 사전 설치가 필요 없습니다. |
| ~500 MB | 설치 후 최고의 출력. 이미 TeX를 실행 중인 경우 사용하세요. |
| ~200 MB | 자주 깨짐. 실제 문서에서 |
| ~40 MB | 순수 Python ( |
| ~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 weasyprintArch 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-staticmacOS (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선택적 추가 기능
기본 설치는 가볍게 유지됩니다. 무겁거나 특수한 종속성은 추가 기능 뒤에 숨겨져 있습니다:
추가 기능 | 추가 항목 | 설치 시기 |
|
| 양식 생성 도구 ( |
|
| 더 높은 정확도의 표 추출 (Java + Ghostscript 필요) |
|
|
|
| 위 모든 것 | 모든 기능을 원할 때 |
구성
선택적 환경 변수:
변수 | 목적 |
| 파일 출력을 위한 콜론으로 구분된 디렉토리 |
| 처리를 위한 임시 디렉토리 (기본값: |
| 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
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive PDF processing including text extraction, image extraction, and OCR capabilities for reading text within images across multiple languages.12MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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.2MIT
- AlicenseNot gradedqualityDmaintenanceProvides 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
- AlicenseNot gradedqualityDmaintenanceEnables AI applications to read and process PDF files with intelligent file search, text extraction, image processing, and optional OCR support for scanned documents.MIT
Related MCP Connectors
Turn any PDF into structured JSON via AI + OCR: invoices, bank statements, contracts.
PDF accessibility checks (veraPDF PDF/UA-1), auto-fix and Markdown conversion. EU-hosted.
Convert PDF bank statements into structured transactions, accounts, and balances.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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