@mcp-apps/pdf-tools-mcp-server v1.0.36
PDF Tools MCP Server
An MCP (Model Context Protocol) server that provides tools for PDF document processing, analysis, and manipulation.
Features
- PDF Document Processing: Securely processes PDF documents with various manipulation capabilities.
- Content Extraction: Extracts text, tables, images, and metadata from PDF documents.
- PDF Transformation: Provides tools for splitting, merging, and transforming PDF documents.
- Document Analysis Tools: Pre-built tools for common document analysis tasks like text extraction, table detection, etc.
- Analysis Prompts: Includes prompt templates for guiding AI assistants in performing common PDF analysis tasks.
Setup Instructions
Prerequisites
- VS Code (latest version recommended)
- Node.js 18.0 or higher
- npm 8.0 or higher
- PDF documents for processing and analysis
Local Development Setup
Clone the repository:
git clone https://github.com/your-repo/pdf-tools-mcp-server.git cd pdf-tools-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildRun the server:
npm startFor development with auto-reload:
npm run watchTo run tests:
npm run test:pdf
Using with GitHub Copilot in VS Code
Installation with GitHub Copilot UI
- Ensure you have the GitHub Copilot extension installed in VS Code
- If not, open VS Code Extensions view (Ctrl+Shift+X)
- Search for "GitHub Copilot"
- Click "Install"
- Open VS Code and the GitHub Copilot Chat panel
- Use the keyboard shortcut (Ctrl+Shift+I) or
- Click on the Copilot Chat icon in the activity bar
Select "Agent Mode" in the Copilot Chat panel.
Click on the "Tools" icon and select Add More Tools.
Click Add MCP Server tool.
Choose Command (stdio) as the tool type.
Type the following command to install and run the PDF Tools MCP server:
npx @mcp-apps/pdf-tools-mcp-serverFollow the prompts to select PDF files for processing.
Once set up, Copilot will be able to assist with PDF document analysis and processing tasks.
Available Tools
PDF Extraction and Analysis
extractText- Extracts text content from PDF documents- Parameters:
filePath: Path to the PDF filepageNumbers(optional): Specific pages to extract text from
- Parameters:
extractTables- Extracts tables from PDF documents- Parameters:
filePath: Path to the PDF filepageNumbers(optional): Specific pages to extract tables from
- Parameters:
getMetadata- Gets detailed metadata for a specified PDF document- Parameters:
filePath: Path to the PDF file
- Parameters:
analyzeDocument- Performs various document analyses- Parameters:
filePath: Path to the PDF fileanalysisType: Type of analysis (structure,content,images, orclassification)
- Parameters:
PDF Editing
edit_pdf- Edits a PDF document using various operationsCommon Parameters:
sourceFilePath: Path to the source PDF fileoutputFilePath: Path where the edited PDF should be savedoperation: The editing operation to performparams: Operation-specific parameters
Available Operations:
addText: Add text to a PDF page
- Parameters:
text: Text to addpageNumber: Page to add text to (1-based)x,y: Coordinates for text placementfontSize(optional): Font size, default is 12color(optional): RGB color values between 0-1, default is black
- Parameters:
addPage: Add a new blank page
- Parameters:
size(optional): Page size (A4,Letter, orLegal), default isA4afterPageIndex(optional): Index after which to insert the page, default is at the end
- Parameters:
removePage: Remove pages from the document
- Parameters:
pageIndices: Array of page indices to remove (0-based)
- Parameters:
rotatePage: Rotate pages in the document
- Parameters:
pageIndices: Array of page indices to rotate (0-based)rotation: Rotation angle (90, 180, or 270 degrees)
- Parameters:
mergeDocuments: Merge multiple PDFs into one
- Parameters:
filePaths: Array of paths to PDF files to merge
- Parameters:
splitDocument: Extract pages into a new document
- Parameters:
pageIndices: Array of page indices to extract (0-based)outputFilePath: Path where the new document should be saved
- Parameters:
Example Usage
Here are examples of using the PDF Tools MCP Server tools with GitHub Copilot:
Extract Text from a PDF
Extract text from sample.pdfGet PDF Metadata
What's the metadata of my report.pdf file?Add Text to a PDF
Add the text "CONFIDENTIAL" to the top of each page in document.pdfMerge Multiple PDFs
Merge chapter1.pdf, chapter2.pdf, and chapter3.pdf into a single documentSplit a PDF
Extract pages 5-10 from my-document.pdf into a new fileSecurity Considerations
- This server processes PDF documents safely with appropriate checks
- Contains basic security measures to prevent destructive operations
- Restricts access to system resources when processing documents
- Consider additional security measures depending on your specific requirements
License
ISC
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago