document-image-extractor-mcp
A Model Context Protocol (MCP) server that provides tools for extracting images from PDF and Word documents.
README
Document Image Extractor MCP Server
A Model Context Protocol (MCP) server that provides tools for extracting images from PDF and Word documents. This server exposes document image extraction capabilities to AI assistants and other MCP clients.
Features
- PDF Image Extraction: Extract embedded images from PDF files with size filtering
- Word Document Processing: Extract images from .docx files
- Document Analysis: Get metadata and image counts without extraction
- Format Validation: Check document compatibility before processing
- Flexible Output: Configurable output directories and file naming
- ZIP Archive Creation: Automatically create ZIP files containing original document and extracted images
Available Tools
extract_document_images
Extract all images from a PDF or Word document, save them as separate files, and create a ZIP archive containing both the original document and extracted images.
Parameters:
document_path(required): Path to the document file (.pdf or .docx)output_dir(optional): Directory to save extracted imagesmin_image_size(optional): Minimum image dimension for PDF extraction (default: 10)
Returns: List of extracted image files with paths, metadata, and ZIP archive location
get_document_info
Get information about a document without extracting images.
Parameters:
document_path(required): Path to the document file
Returns: Document metadata including page count, file size, and image count
validate_document
Check if a document file is valid and supported for image extraction.
Parameters:
document_path(required): Path to the document file
Returns: Validation status and file information
list_supported_formats
List all supported document formats for image extraction.
Returns: Information about supported file types and their capabilities
Installation
- Clone this repository:
git clone <repository-url>
cd document-image-extractor-mcp
- Install dependencies using uv:
uv sync
Configuration
Claude Desktop
Add the server to your Claude Desktop configuration:
MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"document-image-extractor": {
"command": "uv",
"args": [
"--directory",
"/mnt/b/Users/cjdua/Github/document-image-extractor-mcp",
"run",
"document-image-extractor-mcp"
]
}
}
}
Replace the path with the actual location of this directory on your system.
Usage
Running the Server
The MCP server communicates over stdio. You can run it directly:
uv run document-image-extractor-mcp
Example Usage
Once connected to an MCP client, you can use the tools like this:
Extract images from a PDF:
{
"tool": "extract_document_images",
"arguments": {
"document_path": "/path/to/document.pdf",
"output_dir": "/path/to/output",
"min_image_size": 50
}
}
Get document information:
{
"tool": "get_document_info",
"arguments": {
"document_path": "/path/to/document.docx"
}
}
Validate a document:
{
"tool": "validate_document",
"arguments": {
"document_path": "/path/to/document.pdf"
}
}
Supported Formats
- PDF (.pdf): Extracts raster images embedded in pages
- Word Documents (.docx): Extracts images from the document's media archive
Dependencies
mcp>=1.11.0: Model Context Protocol frameworkPyMuPDF>=1.23.0: PDF processing libraryPillow>=9.0.0: Image processing library
Development
Building and Publishing
To prepare the package for distribution:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
- Publish to PyPI:
uv publish
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /mnt/b/Users/cjdua/Github/document-image-extractor-mcp run document-image-extractor-mcp
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
License
This project is part of the Leet_Vibe repository and follows the same licensing terms.
Related Projects
This MCP server is based on the document-image-extractor package, which provides the core extraction functionality in a standalone Python package format.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。