Pdfport

io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 7, 2026

Extract text and metadata from local PDFs, and merge or split PDF files.

Overview

AI-generated overview

Local MCP server that reads text and metadata from PDF files and merges or splits them, working only on files on your machine.

What you can do
  • Extract the full text of a local PDF, page by page
  • Read document metadata such as title, author, subject, keywords, creator, producer and dates, plus page count
  • Report page count, per-page sizes in points, file size and PDF version
  • Merge several PDFs in order into one output file, keeping the first file's metadata
  • Split a PDF into one single-page file per page in an output directory
When to use it
Useful when an assistant needs to read or summarize local PDFs, check their metadata or structure, or combine and divide PDF files without uploading them anywhere. Best suited to simple, unencrypted PDFs produced by common generators.
Requirements
Runs as a local stdio process, started with npx from the npm package or from the container image; Node.js is needed for the npx route. No accounts, API keys, environment variables or headers are declared. Desktop only; no network access is used for processing.
Before you install
Merge and split write new files to paths you specify, so point them at directories you are comfortable changing. The engine is a limited pure-TypeScript implementation: encrypted files, object streams, compressed cross-reference streams, nested page trees and fonts needing a ToUnicode map are not supported, and form or annotation fidelity is lost on merge or split. Files outside that subset fail with an error rather than returning guessed text.

Installation

In SourceWeft

  1. Open Pdfport in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

pdfport

pdfport does the five PDF jobs that come up over and over: pull the text out of a file, read its document metadata, summarise it (pages, page sizes, file size, PDF version), merge several files into one, and split a file into one document per page. It works on local files only — nothing is uploaded anywhere.

The engine is a small, genuine PDF implementation written in pure TypeScript for this project. No PDF library is bundled and there are no runtime dependencies beyond the MCP SDK. The engine scans a document's indirect objects, follows the Catalog to its Pages tree, decodes plain and FlateDecode content streams, and recovers text from the standard text-showing operators. Merges renumber the source objects into one new object graph with a rebuilt page tree; splits emit one document per page the same way; both write a freshly computed cross-reference table.

Scope — what the engine does and does not handle

Supported: simple PDFs with a flat page tree (a Catalog whose Pages node lists Page objects directly — the shape common generators produce, and the shape pdfport's own merge/split write), uncompressed or FlateDecode streams, literal and hex strings in content and in the Info dictionary, and per-page MediaBox sizes (inherited from the Pages node when a page omits its own).

Not supported: encrypted files, object streams and compressed cross-reference streams (PDF 1.5+ compact files), nested page trees, embedded-font encodings that need a ToUnicode map to read, and form/annotation fidelity on merge or split. Files outside the subset fail with a plain error saying what was not found — pdfport never returns invented text or metadata.

Install

bash
npx @reneturcios/pdfport get-pdf-info ./report.pdf

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/pdfport

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
# Print the document's textpdfport extract-text ./report.pdf
# Print the Info-dictionary metadata (plus page count) as JSONpdfport get-metadata ./report.pdf
# Print page count, page sizes, file size and PDF version as JSONpdfport get-pdf-info ./report.pdf
# Merge inputs, in order, into one output filepdfport merge ./combined.pdf ./a.pdf ./b.pdf ./c.pdf
# Split into <name>-page-1.pdf, <name>-page-2.pdf, ... in a directorypdfport split ./report.pdf ./report-pages
# Start the MCP serverpdfport mcp
pdfport --version

Exit codes: 0 on success, 1 when a file is missing or a document cannot be processed (the error says which), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/pdfport mcp

MCP client configuration:

json
{  "mcpServers": {    "pdfport": {      "command": "npx",      "args": ["-y", "@reneturcios/pdfport", "mcp"]    }  }}

Tools

ToolInputWhat it returns
extract_textfile_path (string, required)The file's text: every page's shown text, pages joined with a newline.
get_metadatafile_path (string, required)The Info dictionary's title, author, subject, keywords, creator, producer and dates (only the fields the document carries), plus the page count.
get_pdf_infofile_path (string, required)Page count, each page's MediaBox size in points, the file size in bytes, and the PDF version from the header.
merge_pdfsinput_files (array of strings, required), output_file (string, required)Writes the merged document and reports the output path and total page count. The first input's metadata is kept.
split_pdffile_path (string, required), output_dir (string, required)Writes one single-page file per page into the directory and reports the created file paths and page count.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no networknpm run dev     # run the CLI from source via tsx

The test suite builds small PDFs from raw strings — plain and FlateDecode content streams — and drives the default engine end-to-end: extraction (including TJ arrays and literal-string escapes), metadata, info, merge and split are all asserted against the real implementation, then the file facade is exercised against real files in a temporary directory.

License

MIT — see LICENSE.

Source: README.md at commit 6856d03

Tools

5

extract_text

Extract text from a local PDF file

Parametersfile_pathrequired

get_metadata

Read a PDF file's document metadata (title, author, dates, page count)

Parametersfile_pathrequired

get_pdf_info

Get summary information about a PDF file: page count, page sizes, file size, PDF version

Parametersfile_pathrequired

merge_pdfs

Merge multiple PDF files into one output file

Parametersinput_filesrequiredoutput_filerequired

split_pdf

Split a PDF file into one file per page in an output directory

Parametersfile_pathrequiredoutput_dirrequired

Version history

1
  1. v0.1.0LatestOct 31, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts