PDF Utilities MCP
Allows AI assistants like GitHub Copilot to read, create, merge, split, and edit PDF files through natural language commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PDF Utilities MCP Read report.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PDF Utilities MCP
A VS Code extension that provides comprehensive PDF manipulation tools for GitHub Copilot Chat via Model Context Protocol (MCP).
Overview
This project combines an MCP server with a VS Code extension to enable AI assistants like GitHub Copilot to work with PDF files through natural language commands. Users can read, create, merge, split, and edit PDFs directly from their chat interface.
Related MCP server: PDF MCP Server
Architecture
pdf-utilities-mcp/
├── src/ # MCP Server implementation
│ ├── index.ts # Server entry point and tool registration
│ └── pdf-tools.ts # PDF manipulation utilities
├── extension/ # VS Code Extension
│ ├── src/
│ │ ├── extension.ts # Extension activation and MCP integration
│ │ └── types.ts # TypeScript type definitions
│ ├── resources/
│ │ └── instructions/ # Copilot Chat instruction files
│ └── mcp-server/ # Built MCP server (copied from ../dist)
└── dist/ # Compiled MCP server outputFeatures
📖 Read PDFs: Extract text content with optional page range selection
📊 Get Info: Retrieve metadata (pages, title, author, size, etc.)
✍️ Create PDFs: Generate new PDFs from text with formatting options
🔗 Merge: Combine multiple PDF files into one
✂️ Split: Extract specific pages or ranges
📝 Update Metadata: Modify title, author, subject, keywords
📄 Extract Pages: Save individual pages as separate files
Installation
For Users
Install from VS Code Marketplace:
Open VS Code
Search for "PDF Utilities" in Extensions
Click Install
For Developers
# Clone the repository
git clone https://github.com/GleidsonFerSanP/pdf-utilities-mcp.git
cd pdf-utilities-mcp
# Install MCP server dependencies
npm install
# Build MCP server
npm run build
# Install extension dependencies
cd extension
npm install
# Build extension
npm run compile
# Copy MCP server to extension
cd ..
npm run copy-to-extensionDevelopment
Project Structure
MCP Server ( src/ ):
Uses @modelcontextprotocol/sdk for standardized tool interface
Implements 7 PDF tools using pdf-lib and pdf-parse
Runs as Node.js process via stdio transport
VS Code Extension ( extension/ ):
Registers MCP server with VS Code's lm.registerMcpServerDefinitionProvider
Provides commands for configuration and server management
Includes chat instructions for optimal Copilot integration
Building
# Build MCP server
npm run build
# Build extension
cd extension
npm run compile
# Copy server to extension folder
cd ..
npm run copy-to-extensionTesting
# Test MCP server directly
node dist/index.js
# Package extension for testing
cd extension
npm run package # Creates .vsix file
# Install .vsix in VS Code for testing
# Extensions > ... > Install from VSIXDevelopment Workflow
Make changes to MCP server in
src/Run
npm run buildto compileRun
npm run copy-to-extensionto update extensionReload VS Code window to test changes
Check logs in Output panel > "PDF Utilities"
Publishing
Prerequisites
Create VS Code Publisher account at https://marketplace.visualstudio.com/
Generate Personal Access Token (PAT)
Update
extension/.envwith your PAT
Publish Steps
# Build everything
npm run build
cd extension
npm run compile
cd ..
npm run copy-to-extension
# Package extension
cd extension
npm run package
# Verify the .vsix file works
# Install it manually in VS Code and test
# Publish to marketplace
npm run publishVersion Management
Update version in both:
package.json(root)extension/package.json
Follow semantic versioning: MAJOR. MINOR. PATCH
Configuration
Extension Settings
pdfUtilities.autoStart: Auto-start MCP server (default: true)pdfUtilities.logLevel: Logging verbosity (default: info)pdfUtilities.maxPdfSize: Maximum file size in MB (default: 50)
MCP Server Configuration
The MCP server is configured via the extension and doesn't require separate configuration.
API Documentation
Tool: read_pdf
Extract text from PDF file.
Parameters:
filePath(string, required): Absolute path to PDFpageRange(string, optional): Pages to extract (e.g., "1-5", "1, 3, 5-10")
Returns:
{
text: string;
pages: number;
info: PDFInfo;
}Tool: get_pdf_info
Get PDF metadata and information.
Parameters:
filePath(string, required): Absolute path to PDF
Returns:
{
pages: number;
title?: string;
author?: string;
subject?: string;
creator?: string;
producer?: string;
creationDate?: Date;
modificationDate?: Date;
fileSize: number;
filePath: string;
}Tool: create_pdf
Create new PDF from text content.
Parameters:
content(string, required): Text contentoutputPath(string, required): Save locationoptions(object, optional): Formatting optionstitle,author,subject(string): MetadatafontSize(number): Text size (default: 12)pageSize(string): Page size (default: "A4")
Returns:
{
success: boolean;
path: string;
pages: number;
}Tool: merge_pdfs
Combine multiple PDFs.
Parameters:
filePaths(string[], required): PDFs to mergeoutputPath(string, required): Output location
Returns:
{
success: boolean;
path: string;
pages: number;
}Tool: split_pdf
Extract pages to new PDF.
Parameters:
filePath(string, required): Source PDFpageRange(string, required): Pages to extractoutputPath(string, required): Output location
Returns:
{
success: boolean;
path: string;
pages: number;
}Tool: update_pdf_metadata
Modify PDF metadata.
Parameters:
filePath(string, required): PDF to updatemetadata(object, required): Fields to updatetitle,author,subject,keywords(string)
outputPath(string, optional): Save location (defaults to overwrite)
Returns:
{
success: boolean;
path: string;
}Tool: extract_pages
Extract pages to separate files.
Parameters:
filePath(string, required): Source PDFpages(number[], required): Page numbers to extractoutputDir(string, required): Output directoryprefix(string, optional): Filename prefix (default: "page")
Returns:
{
success: boolean;
files: string[];
}Troubleshooting
MCP Server Not Starting
Check Output panel:
View > Output > Select "PDF Utilities"Look for initialization messages. If server fails:
Verify
mcp-server/index.jsexists in extension folderRun rebuild:
npm run build && npm run copy-to-extensionReload VS Code
Tools Not Available in Copilot
Ensure extension is activated (check Extensions panel)
Verify MCP API is available (requires VS Code 1.85+)
Check that Copilot Chat is enabled
Restart Copilot: Command Palette > "GitHub Copilot: Restart Language Server"
Build Errors
Common issues:
TypeScript errors: Run
npm installin both root and extension foldersMissing dependencies:
npm installin correct directoryPath issues: Use
npm run copy-to-extensionto sync files
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
Please follow existing code style and conventions.
License
MIT License - see LICENSE file for details.
Support
Credits
Built with Model Context Protocol
Icon design: Custom SVG
Note: This project requires GitHub Copilot Chat and VS Code 1.85+ with MCP support.
Available Tools
7 toolscreate_pdfB
Create a new PDF from text content with optional formatting and metadata.
Inputs: content (required), outputPath (required), options.
extract_pagesB
Extract specific pages from a PDF into separate PDF files.
Inputs: filePath (required), pages (required), outputDir (required), prefix.
get_pdf_infoB
Get metadata and information about a PDF file (pages, title, author, size, etc.).
Inputs: filePath (required).
merge_pdfsB
Merge multiple PDF files into a single PDF.
Inputs: filePaths (required), outputPath (required).
read_pdfA
Extract text content from a PDF file. Optionally specify page range (e.g., "1-5" or "1,3,5").
Inputs: filePath (required), pageRange.
split_pdfC
Extract specific pages from a PDF into a new file.
Inputs: filePath (required), pageRange (required), outputPath (required).
update_pdf_metadataB
Update metadata (title, author, subject, keywords) of a PDF file.
Inputs: filePath (required), metadata (required), outputPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are distinct, but extract_pages and split_pdf have overlapping functionality; both extract specific pages, differing only in output format (separate files vs. single file). This could confuse an agent.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., create_pdf, merge_pdfs, read_pdf), making them predictable and easy to learn.
With 7 tools, the server is well-scoped for a PDF utility; each tool serves a distinct core operation without being too few or too many.
Core operations (create, read, merge, split, metadata) are covered, but common features like content editing (delete/rotate pages) or format conversion are missing, and the extract/split tools seem redundant.
Maintenance
Related MCP Connectors
Merge, split, extract, rotate, reorder and stamp PDF pages from your AI chat, all offline.
Merge, split, extract, rotate, reorder and stamp PDF pages from your AI chat, all offline.
File tools for your AI chat: PDF tables to Excel, merge PDFs, images to PDF, fill PDF forms.
Split PDFs from your AI chat: extract page ranges, split by size or count. All data is local.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables PDF manipulation including text, images, annotations, form fields, page operations, and metadata through natural language.16MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered PDF manipulation through natural language commands, integrating with Claude to perform operations like merging, splitting, encrypting, optimizing, and analyzing PDFs.16-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform GitHub operations such as creating repositories, issues, pull requests, and more through natural language.-
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered IDEs to read PDF and DOCX files directly, supporting structured output in Markdown, JSON, or plain text.MIT