Skip to main content

Document Loader MCP Server

Model Context Protocol (MCP) server for document parsing and content extraction

This MCP server provides tools to parse and extract content from various document formats including PDF, Word documents, Excel spreadsheets, PowerPoint presentations, and images.

Features

  • PDF Text Extraction: Extract text content from PDF files using pdfplumber
  • Word Document Processing: Convert DOCX/DOC files to markdown using markitdown
  • Excel Spreadsheet Reading: Parse XLSX/XLS files and convert to markdown
  • PowerPoint Presentation Processing: Extract content from PPTX/PPT files
  • Image Loading: Load and display various image formats (PNG, JPG, GIF, BMP, TIFF, WEBP)
  • Slide Image Extraction: Extract individual slides/pages as PNG images from PPTX, PPT, or PDF files using LibreOffice and poppler

Prerequisites

Installation Requirements

  1. Install uv from Astral or the GitHub README
  2. Install Python 3.10 or newer using uv python install 3.10 (or a more recent version)

Optional: Slide Image Extraction

The extract_slides_as_images tool requires external system packages:

  • LibreOffice (for PPTX/PPT → PDF conversion):
  • poppler-utils (for PDF → image rendering):
    • Ubuntu/Debian: sudo apt install poppler-utils
    • macOS: brew install poppler
    • Windows: Download from GitHub and add to PATH

Installation

Kiro Cursor VS Code
Add to Kiro Install MCP Server Install on VS Code

Configure the MCP server in your MCP client configuration:

{
  "mcpServers": {
    "awslabs.document-loader-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.document-loader-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

For Kiro MCP configuration, see the Kiro IDE documentation or the Kiro CLI documentation for details.

For global configuration, edit ~/.kiro/settings/mcp.json. For project-specific configuration, edit .kiro/settings/mcp.json in your project directory.

Available Tools

  • read_document: Extract content from various document formats by specifying file_path and file_type ('pdf', 'docx', 'doc', 'xlsx', 'xls', 'pptx', 'ppt')
  • read_image: Load image files for LLM viewing and analysis
  • extract_slides_as_images: Extract slides/pages as individual PNG images from PPTX, PPT, or PDF files. Requires LibreOffice (for PPTX/PPT) and poppler-utils (for PDF-to-image rendering)

Environment Variables

  • FASTMCP_LOG_LEVEL: Set logging level (ERROR, INFO, DEBUG)
  • MAX_FILE_SIZE_MB: Maximum allowed file size in megabytes (default: 50). Must be a positive integer.
  • DOCUMENT_BASE_DIR: Base directory that constrains all file access (read_document, read_image, and both the input and output paths of extract_slides_as_images). Every resolved path must be inside this directory or the request is denied. Defaults to the current working directory. Set it explicitly (e.g. /var/app/documents) to define your sandbox. The sandbox is always enforced — there is no automatic bypass, including under CI (CI, GITHUB_ACTIONS) or test (PYTEST_CURRENT_TEST) environments.

Development

Setup

# Clone the repository
git clone https://github.com/awslabs/mcp.git
cd mcp/src/document-loader-mcp-server

# Install dependencies
uv sync

# Install in development mode
uv pip install -e .

Testing

# Run tests
uv run pytest

# Run with coverage
uv run pytest --cov=awslabs.document_loader_mcp_server

The test suite includes:

  • Server functionality validation
  • Document parsing tests with generated sample files
  • Error handling verification

Sample Documents

The test suite automatically generates sample documents for testing:

  • PDF with multi-page content
  • DOCX with formatted text and lists
  • XLSX with multiple sheets and data
  • PPTX with slides and content
  • Various image formats

Docker

You can also run this server in a Docker container:

docker build -t document-loader-mcp-server .
docker run -p 8000:8000 document-loader-mcp-server

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Support

For issues and questions, please use the GitHub issue tracker.

Release files for awslabs.document-loader-mcp-server 1.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awslabs.document-loader-mcp-server 1.0.23
File Size Uploaded
awslabs_document_loader_mcp_server-1.0.23.tar.gz 199.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awslabs.document-loader-mcp-server 1.0.23
File Interpreter ABI Platform
awslabs_document_loader_mcp_server-1.0.23-py3-none-any.whl Python 3 none any Details

Total release size: 215.9 kB

Release files / awslabs_document_loader_mcp_server-1.0.23.tar.gz

Download URL awslabs_document_loader_mcp_server-1.0.23.tar.gz
Size 199.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3a005e2aff68c0f542236aca7829eb173cb1a8b227ee34ffa58e4eeedaeac06b
BLAKE2b-256 checksum
How to use checksums
057384cc44a6488fffae4cb629362fed39120a7d4140297b4e57461cfad8ba37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / awslabs_document_loader_mcp_server-1.0.23-py3-none-any.whl

Download URL awslabs_document_loader_mcp_server-1.0.23-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10f6f3f4cc4b810de6c05b456d8d20fb9e572bd2c4377e4753a15af06be52686
BLAKE2b-256 checksum
How to use checksums
d82a1c4819db40d879c36df74d16745e664ad8123c677d1d8d903704da68e2e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.23 This release

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.17

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page