Logo de ComPDF MCP

ComPDF MCP

Organização
ComPDFKit

A lightweight MCP (Model Context Protocol) server for integrating ComPDF AI with Claude Desktop, enabling AI-powered intelligent document processing and data extraction from PDFs via natural language.

Publicado porComPDFKit
Repositóriocompdf-mcp
IdiomaPython
Forks
8
Estrelas
97
Ferramentas disponíveis
0
Tipo de transportestdio, streamable-http
Categorias
LicençaApache-2.0
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    ComPDF MCP disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    97 estrelas e 8 forks no repositório vinculado.

compdf-github-banner 1 English | 繁體中文 | 日本語 | 简体中文

ComPDF MCP

ComPDF MCP is built for MCP clients and AI agent platforms. It provides PDF/image parsing and data extraction, PDF conversion, PDF editing, and image conversion capabilities. It helps users process raw documents first, then pass lighter, cleaner, and more structured results into AI, reducing token usage, lowering AI costs, and improving overall processing efficiency.

  • If you find ComPDF MCP useful, please consider giving us a ⭐ Star on GitHub. It helps us grow and improve.
  • Got questions or ideas? Join the conversation in our Discussions.

Why Choose ComPDF MCP

The core reason users choose ComPDF MCP is not simply to let AI work with PDFs. It is to process complex, lengthy, and noisy source documents into inputs that are easier for models to understand before handing them off to AI for analysis, summarization, Q&A, or automation.

Raw PDFs, scanned files, and image files are often larger, noisier, and less stable in structure. By using ComPDF MCP for conversion, extraction, and page-level processing first, then sending the results into AI, users can:

  • Reduce AI token usage
  • Lower AI costs
  • Shorten response time
  • Improve the quality of structured outputs
  • Avoid wasting model budget on noisy raw files
  • Handle both PDF and image processing through one MCP service
  • Fit document-heavy workflows and multi-platform agent scenarios

This approach is especially valuable when processing reports, contracts, invoices, tables, scanned files, and similar documents in bulk. In these cases, a "process documents first, then call AI" workflow is usually more cost-efficient and better suited for downstream automation than sending original files directly to the model.

Capabilities

ComPDF MCP focuses on three major capability groups: document conversion, PDF operations, and intelligent parsing and data extraction.

1. PDF and Image Conversion

CapabilityDescription
PDF to WordConvert PDF files into editable Word documents while preserving the original layout, text, images, and formatting as much as possible.
PDF to ExcelConvert PDF files into Excel workbooks with support for tables, numbers, and structured business data.
PDF to SlideConvert PDF pages into editable PowerPoint slides while preserving the original layout and visual structure as much as possible.
PDF to HTMLConvert PDF files into HTML for web display and content reuse while retaining text, images, tables, and layout.
PDF to RTFConvert PDF files into RTF documents with support for text and image content.
PDF to ImageConvert PDF pages into PNG or JPG images with configurable resolution and DPI.
PDF to CSVExtract tables from PDF files and export them as CSV, either table by table or as merged output.
PDF to TXTExtract text from PDF or scanned PDF files and save it as plain text.
PDF to JSONExtract text, tables, and images from PDF files and save them as structured JSON.
PDF to MarkdownConvert PDF files into Markdown for easier reuse in knowledge bases, developer docs, blog systems, and AI workflows.
PDF to Searchable PDFRun OCR on scanned PDFs and output searchable PDFs with selectable, copyable, and highlightable text for retrieval, archiving, and downstream processing.
PDF to OFDConvert PDF files into OFD files for OFD archiving, document circulation, and localized office scenarios.
Word to PDFConvert Word documents into PDF while preserving layout, fonts, images, and page structure as much as possible for sharing, archiving, and printing.
PNG to PDFConvert PNG images into PDF for easier packaging, sharing, printing, and archiving of screenshots, design files, or supporting image materials.
RTF to PDFConvert RTF documents into PDF while preserving core text styling and layout for consistent cross-device viewing and formal output.
Excel to PDFConvert Excel workbooks or spreadsheets into PDF for report sharing, printing, archiving, and preventing accidental formula edits.
TXT to PDFConvert plain TXT files into PDF, making logs, notes, and text instructions easier to organize as fixed-layout documents.
CSV to PDFConvert CSV table data into PDF for snapshot sharing, review, printing, and business archiving.
Slide to PDFConvert PowerPoint presentations into PDF for presentation distribution, cross-device viewing, and formal record keeping.
HTML to PDFConvert HTML pages or content fragments into PDF for webpage preservation, report export, email archiving, and printable output.
Image to WordConvert JPG, JPEG, PNG, and BMP image files into editable Word documents.
Image to ExcelConvert image files into Excel workbooks with support for tables, text, and numeric content.
Image to PPTConvert image files into editable PowerPoint slides while preserving visible layout and content structure as much as possible.
Image to PDFConvert JPG, JPEG, PNG, BMP, and similar image files into PDF for consolidating, sharing, printing, and archiving one or multiple images.
Image to HTMLConvert image files into HTML while preserving text, layout, tables, and major visual elements as much as possible.
Image to RTFConvert image files into RTF documents with support for extracted text and images.
Image to CSVExtract tables from image files and export them as CSV.
Image to TXTExtract text from image files and save it as plain text.
Image to JSONExtract text, tables, and images from image files and save them as structured JSON.

2. PDF Editing, Protection, and Comparison

CapabilityDescription
Merge PDF FilesCombine multiple PDF files into a single PDF document.
Split PDF FilesSplit one PDF file into multiple smaller PDF files.
Rotate PDF PagesRotate selected PDF pages by 90, 180, or 270 degrees.
Delete PDF PagesRemove one or more pages from a PDF file.
Insert PDF PagesInsert pages from another PDF into an existing PDF.
Extract PDF PagesExtract selected pages or page ranges and save them as a new file.
Convert PDF StandardConvert a PDF conformance or archival standard.
Add WatermarkAdd text or image watermarks to PDF files for branding or usage control.
Remove WatermarkRemove text or image watermarks from supported PDF files.
Compress PDFReduce PDF file size for easier storage, upload, and sharing.
Encrypt PDFProtect PDF files with AES encryption and permission controls.
Decrypt PDFRemove passwords from authorized PDF files for internal processing or reuse.
Compare PDFsCompare the content differences between two PDF files.

3. Intelligent Parsing and Data Extraction

CapabilityDescription
Intelligent Document ParsingParse PDFs and images into structured document output for agents, automation workflows, and downstream systems.
Intelligent Data Extraction from PDFs and ImagesExtract valuable business data such as text, tables, and content fields from PDFs and images.

Technical Architecture

This project is an MCP Streamable HTTP service built with Python, FastMCP, and Starlette. Tool parameter schemas are generated from the bundled official OpenAPI parameter snapshot, and the service rejects unknown parameters.

Clients can access every tool through the aggregate endpoint:

text
http://127.0.0.1:8000/mcp

If you only need part of ComPDF MCP, use the module endpoints below:

ModuleMCP EndpointBusiness ToolsRepresentative Tools
PDF and Image Conversion/mcp/conversion/mcp28pdf_to_word, pdf_to_markdown, image_to_json, word_to_pdf, and more
Intelligent Parsing and Data Extraction/mcp/ai/mcp2document_parse, document_extract
PDF Editing, Protection, and Comparison/mcp/pdf/mcp13merge_pdf, add_watermark, encrypt_pdf, compare_pdf, and more
All capabilities/mcp44All tools above

All business tools use a shared file-input shape. Keys in options must use the camelCase parameter names from the ComPDF API documentation. Only htmlFile, templateFile, dataFile, imageFile, and iccFile may be uploaded through special_files.

json
{
  "files": [
    {
      "filename": "report.pdf",
      "content_base64": "JVBERi0xLjc...",
      "content_type": "application/pdf"
    }
  ],
  "options": {
    "pageRanges": "1-3,6",
    "enableOcr": 1
  },
  "special_files": {
    "imageFile": {
      "filename": "watermark.png",
      "content_base64": "iVBORw0..."
    }
  }
}

The decoded size of an individual Base64 file is limited to 100 MB. Synchronous tool responses include the ComPDF result, the relevant official documentation URL, and a statement that download URLs expire after 24 hours.

Quick Start

1. Install and Run the Service

Prerequisite: Python 3.10+. From the repository root, create a virtual environment and install the package in editable mode.

Windows:

powershell
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e .
Copy-Item .env.example .env
compdf-streaming-mcp

Linux / macOS:

bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env
compdf-streaming-mcp

The service listens on 0.0.0.0:8000 by default. Use these endpoints to check its status:

  • GET /healthz: service status and mounted MCP routes.
  • GET /readyz: readiness status without calling the upstream ComPDF API.
  • GET /metrics: request counters in Prometheus text format.

2. Configure the Service

Copy .env.example to .env, then adjust settings for the deployment environment. The server does not store or configure a user's ComPDF API key. Each MCP request supplies that user's key through the X-ComPDF-API-Key header. You can sign up for ComPDF Portal and copy your free API key from the location shown below.

b0a118c5-b3f5-4bc7-bae7-3d0adfc634b2

dotenv
COMPDF_API_BASE_URL=https://api-server.compdf.com/server
COMPDF_API_TIMEOUT_SECONDS=180
MCP_HOST=0.0.0.0
MCP_PORT=8000
MCP_ALLOWED_HOSTS=localhost,localhost:*,127.0.0.1,127.0.0.1:*,mcp.example.com
MCP_RATE_LIMIT_PER_MINUTE=120

For mainland China accounts, use COMPDF_API_BASE_URL=https://api-server.compdf.cn/server. In production, add the reverse-proxy domain to MCP_ALLOWED_HOSTS; include a non-default port or use mcp.example.com:* when appropriate.

3. Configure an MCP Client

The examples below use the unified MCP URL http://127.0.0.1:8000/mcp. For a remote deployment, replace it with the public HTTPS address, for example https://your-domain.example/mcp.

First obtain a personal ComPDF API key (sign up to get your free API key). For clients that use environment variables, set it on the client machine first:

powershell
$env:COMPDF_API_KEY = "your-own-compdf-api-key"

Codex

Add the remote MCP service to ~/.codex/config.toml:

toml
[mcp_servers.compdf]
url = "http://127.0.0.1:8000/mcp"
env_http_headers = { "X-ComPDF-API-Key" = "COMPDF_API_KEY" }
tool_timeout_sec = 180

Claude (Claude Code)

Add the following MCP server to the user-level configuration file ~/.claude.json. COMPDF_API_KEY must be available in the terminal session used to start Claude Code:

json
{
  "mcpServers": {
    "compdf": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "X-ComPDF-API-Key": "${COMPDF_API_KEY}"
      }
    }
  }
}

If ~/.claude.json already has configuration, merge compdf into the existing mcpServers object instead of overwriting the file.

GitHub Copilot (VS Code)

Run MCP: Open User Configuration from the VS Code Command Palette, or create .vscode/mcp.json in the workspace, then add the following configuration. VS Code prompts for the API key in a password field on first use:

json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "compdf-api-key",
      "description": "ComPDF API Key",
      "password": true
    }
  ],
  "servers": {
    "compdf": {
      "type": "http",
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "X-ComPDF-API-Key": "${input:compdf-api-key}"
      }
    }
  }
}

Cursor

Open Cursor Settings > Tools & MCP, select New MCP Server, or edit ~/.cursor/mcp.json, then add:

json
{
  "mcpServers": {
    "compdf": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "X-ComPDF-API-Key": "your-own-compdf-api-key"
      }
    }
  }
}

This Cursor configuration stores the key in a local configuration file. Do not commit ~/.cursor/mcp.json or a project-level configuration file that contains the key.

All clients must send X-ComPDF-API-Key with every MCP request. Do not pass the key as a tool argument, URL parameter, or chat message.

4. Asynchronous and Presigned Uploads

In addition to the 44 synchronous business tools, each module provides list_operations and these task tools:

  • start_async_operation: invokes the matching /v2/processAsync/... endpoint for long-running or multi-file work.
  • get_task_status: queries task status from /v2/task/taskInfo.
  • create_presigned_upload, upload_presigned_file, and start_presigned_operation: create a presigned task, upload the file, and start the task in sequence.

Presigned uploads support only operations with one standard file. Use asynchronous mode for PDF merging, comparison, page inserting, and more. The presigned URL remains only in the creating module server's memory and is never exposed as a tool argument or response field.

Deployment and Operations

Build and run the service with Docker Compose:

powershell
docker compose up --build

In production, expose the aggregate endpoint as https://your-domain.example/mcp behind an HTTPS reverse proxy, and configure MCP_ENV=production, MCP_PUBLIC_URL, MCP_OAUTH_ISSUER_URL, and MCP_STATIC_TOKENS_JSON. When enabled, clients must also send Authorization: Bearer <token>; this service token is separate from each user's ComPDF API key. See DEPLOYMENT.md for image transfer, HTTPS proxy, update, and rollback instructions.

License and Free Access

ComPDF MCP can be used for free, without purchasing or contacting sales.

  • Sign up to get your free API key and configure it b0a118c5-b3f5-4bc7-bae7-3d0adfc634b2

  • Suitable for individual trials, feature validation, and workflow testing

  • If you need higher API assets, enterprise deployment, or commercial cooperation, please contact the sales

This lowers the barrier to adoption and makes it easier to test real AI document workflows before deciding whether to move into deeper business use.

Use Cases and Example Prompts

Upload a PDF, image, or other source file. Enter a task instruction such as extracting tables, converting formats, merging PDFs, or adding watermarks. The agent calls the corresponding ComPDF Server tool and returns the result. If deeper analysis is needed, pass the processed output to AI afterward.

Example scenarios:

  • In Claude, Cursor, Cline, and similar MCP clients, users upload reports, manuals, or proposal PDFs, convert them to Markdown or Word first, and then ask AI for summaries, knowledge Q&A, or content restructuring
  • In MCP workflows for invoices, statements, scanned tables, and image attachments, users extract tables and structured data first, then move into finance review, data entry, or automated routing
  • When organizing contracts, bids, quotations, or archived files in agent workflows, users first merge, split, watermark, and convert PDFs, then hand them off to AI for organization, naming, or outbound preparation
  • In multi-step automation workflows, users first turn PDF or image files into lightweight CSV, JSON, or TXT outputs, then let downstream agents handle field normalization, approval flows, knowledge base ingestion, or script orchestration

Example prompts:

  • Convert this PDF into Word and preserve the layout as much as possible.
  • Extract all tables from this PDF and export them as CSV.
  • Convert this image into JSON and return structured content.
  • Merge these PDFs, add a watermark, and return the final file.
  • Convert this report into Markdown first, then summarize the key points.

Instalação

TypingMind
{
  "mcpServers": {
    "compdf-mcp": {
      "command": "compdf-streaming-mcp",
      "args": []
    }
  }
}

Use o MCP de ComPDF MCP com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar ComPDF MCP, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. É possível executar o MCP localmente no seu dispositivo ou se conectar à URL de um servidor MCP remoto.

Opção 1: use o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione ComPDF MCP como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de ComPDF MCP.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "compdf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de ComPDF MCP, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de ComPDF MCP.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar ComPDF MCP para me ajudar nesta tarefa?
ComPDF MCP
Claro. Já li.
Veja o que encontrei usando ComPDF MCP.

Opção 2: Adicione a URL de um servidor MCP

Use esta opção quando ComPDF MCP já estiver hospedado remotamente ou quando sua equipe quiser um conector compartilhado que vários usuários possam acessar.

1

Abra Conectores MCP

No TypingMind, vá até Plugins, abra Conectores MCP e selecione Adicionar URL.

  1. Abra o TypingMind no navegador.
  2. Acesse Plugins.
  3. Abra Conectores MCP.
  4. Clique em Adicionar URL.
Formulário do TypingMind para adicionar a URL de um servidor MCP personalizado
2

Cole a URL do servidor

Insira a URL do servidor MCP fornecida pelo provedor no campo URL do servidor. Adicione um nome para a conexão, uma descrição, um ícone, cabeçalhos HTTP personalizados ou configurações do cliente OAuth se o servidor exigir.

  1. Cole a URL do servidor MCP fornecida pelo provedor no campo URL do servidor.
  2. Digite um nome para a conexão de ComPDF MCP.
  3. Adicione uma descrição e um ícone para facilitar a identificação.
  4. Adicione cabeçalhos HTTP personalizados ou dados do cliente OAuth se o servidor exigir autenticação.
3

Crie a conexão

Clique em Criar conexão, volte à lista de Plugins e confirme que a nova conexão MCP está ativa.

  1. Clique em Criar conexão.
  2. Volte à lista de conectores MCP.
  3. Confirme que a conexão de ComPDF MCP aparece como ativa.
  4. Atualize a lista de plugins se a conexão não aparecer imediatamente.
4

Troque de modelo sem reconectar

Inicie um chat com seu modelo preferido, ative as ferramentas de ComPDF MCP em Plugins e mude para outro modelo sempre que necessário. A conexão MCP continua disponível no espaço de trabalho do TypingMind.

  1. Inicie um novo chat no TypingMind.
  2. Selecione o modelo de IA que deseja usar.
  3. Ative as ferramentas de ComPDF MCP em Plugins.
  4. Peça ao modelo para usar a ferramenta quando necessário.
  5. Mude para outro modelo de IA e reutilize a mesma conexão MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar ComPDF MCP para me ajudar nesta tarefa?
ComPDF MCP
Claro. Já li.
Veja o que encontrei usando ComPDF MCP.

Perguntas frequentes

Para que serve o servidor MCP ComPDF MCP?

ComPDF MCP é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP ComPDF MCP com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar ComPDF MCP com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP ComPDF MCP com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com ComPDF MCP conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP ComPDF MCP ao TypingMind?

É possível conectar ComPDF MCP ao TypingMind com o conector MCP local ou adicionando a URL de um servidor MCP remoto. Use o conector local quando o servidor precisar acessar arquivos, apps ou recursos privados no seu dispositivo, e use uma URL de servidor quando o servidor MCP estiver hospedado remotamente.

Quais ferramentas o MCP ComPDF MCP oferece no TypingMind?

ComPDF MCP disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP ComPDF MCP?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se ComPDF MCP exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇