ilovepdf-mcp

ilovepdf-mcp

An MCP server that integrates the iLovePDF API to enable PDF manipulation tasks such as merging, splitting, compressing, and converting directly from AI conversations.

Category
访问服务器

README

iLovePDF MCP Server

An MCP (Model Context Protocol) server that exposes iLovePDF API operations as tools for LLM clients like Claude. Process PDFs directly from your AI conversations - merge, split, compress, convert, and more.

Features

  • 22 PDF tools covering all major PDF operations
  • Supports both local files and URLs as input
  • Customizable output with user-specified directories and filenames
  • Operation chaining for complex workflows
  • Full TypeScript support with type definitions

Available Tools

Core Operations

Tool Description
merge-pdfs Merge multiple PDF files into one
split-pdf Split PDF by page ranges, fixed intervals, or remove pages
compress-pdf Reduce PDF file size (low/recommended/extreme)
rotate-pdf Rotate pages by 90, 180, or 270 degrees
protect-pdf Add password protection
unlock-pdf Remove password protection
repair-pdf Repair damaged PDFs

Conversion Operations

Tool Description
pdf-to-jpg Convert PDF pages to JPG images
images-to-pdf Convert images to PDF
html-to-pdf Convert webpages to PDF
office-to-pdf Convert Word, Excel, PowerPoint to PDF
convert-to-pdfa Convert to PDF/A archive format
validate-pdfa Validate PDF/A compliance

Enhancement Operations

Tool Description
add-watermark Add text or image watermarks
add-page-numbers Add page numbers with custom formatting
extract-text Extract text content from PDF
ocr-pdf OCR scanned PDFs (100+ languages)
edit-pdf Add text or images to specific positions

Signature Operations

Tool Description
sign-pdf Create digital signature requests
get-signature-status Check signature request status
void-signature Cancel pending signature requests

Utility Operations

Tool Description
chain-operations Chain multiple operations together
list-tasks List recent API tasks
get-remaining-files Check API quota

Installation

Prerequisites

Install from npm

npm install -g ilovepdf-mcp

Install from source

git clone https://github.com/yourusername/ilovepdf-mcp.git
cd ilovepdf-mcp
npm install
npm run build

Configuration

Environment Variables

Create a .env file in your project root:

ILOVEPDF_PUBLIC_KEY=your_public_key_here
ILOVEPDF_SECRET_KEY=your_secret_key_here
DEFAULT_OUTPUT_DIR=./output

Or set environment variables directly in your shell.

Claude Desktop Integration

Add to your claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json

Option 1: Using .env file (recommended)

If you've set up your .env file with API keys, you only need:

{
  "mcpServers": {
    "ilovepdf": {
      "command": "node",
      "args": ["/path/to/ilovepdf-mcp/dist/index.js"]
    }
  }
}

Option 2: Keys in config only

If you prefer not to use a .env file:

{
  "mcpServers": {
    "ilovepdf": {
      "command": "node",
      "args": ["/path/to/ilovepdf-mcp/dist/index.js"],
      "env": {
        "ILOVEPDF_PUBLIC_KEY": "your_public_key",
        "ILOVEPDF_SECRET_KEY": "your_secret_key",
        "DEFAULT_OUTPUT_DIR": "/path/to/output"
      }
    }
  }
}

If installed globally via npm:

{
  "mcpServers": {
    "ilovepdf": {
      "command": "ilovepdf-mcp"
    }
  }
}

Usage Examples

Once configured, you can use natural language in Claude to process PDFs:

Merge PDFs

"Merge these three PDF files: report1.pdf, report2.pdf, and appendix.pdf"

Compress PDF

"Compress my large-document.pdf using extreme compression"

Convert to Images

"Convert this PDF to JPG images at 300 DPI"

Add Watermark

"Add a 'CONFIDENTIAL' watermark to all pages of contract.pdf"

Chain Operations

"Compress then merge these PDFs: file1.pdf, file2.pdf, file3.pdf"

OCR

"Make this scanned PDF searchable using English and Spanish OCR"

Development

# Install dependencies
npm install

# Build
npm run build

# Run in development mode
npm run dev

# Clean build artifacts
npm run clean

API Reference

Common Parameters

Most tools accept these common parameters:

Parameter Type Description
file / files string / string[] Input file path(s) or URL(s)
outputDir string? Output directory (default: ./output)
outputFilename string? Custom output filename

Response Format

All tools return a consistent JSON response:

{
  "success": true,
  "message": "Operation completed successfully",
  "outputPath": "/path/to/output.pdf",
  "details": {
    "originalSize": "5.2 MB",
    "outputSize": "1.3 MB"
  }
}

On error:

{
  "success": false,
  "error": "Error message describing what went wrong"
}

Troubleshooting

"Missing iLovePDF API credentials"

Ensure ILOVEPDF_PUBLIC_KEY and ILOVEPDF_SECRET_KEY are set in your environment or .env file.

"File not found"

  • Check the file path is correct and accessible
  • For URLs, ensure they are publicly accessible

"API quota exceeded"

Use get-remaining-files to check your quota. Upgrade your iLovePDF plan if needed.

License

MIT

Credits

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选