# bzsanti/oxidize-python [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/bzsanti/oxidize-python  
**GitHub Stars:** 6  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/bzsanti-oxidize-python

## Description
Rust-powered PDF toolkit: create, read, and analyze PDFs; extract text and entities for RAG; convert to Markdown; split, merge, rotate, and reorder pages; add content, annotations, and form fields; and encrypt documents. Ships in the oxidize-pdf PyPI package — run locally with uvx oxidize-mcp.

## Tools
Capabilities this server exposes over MCP:

- **read_pdf** — Read a single PDF's document-level metadata without parsing its content.

Returns a JSON object with: page_count, is_encrypted, version, title,
author, subject, keywords, and (when include_page_details=true) a `pages`
array of {index, width, height, rotation}. Read-only: never modifies the
file.

Use this to inspect what a PDF is before deciding how to process it. For
structural validation, corruption/PDF-A checks, or comparing two files use
analyze_pdf instead; for the actual text use extract_text. Encrypted files
without a password return {is_encrypted, locked, message} rather than
metadata.
- **extract_text** — Extract the raw, unformatted text of a PDF as a single string.

Returns JSON {text, page_count} (plus `page` when a specific page was
requested). Read-only.

Use this when you want the plain reading text. If you need Markdown
structure or chunking for LLM/RAG pipelines use convert_pdf; if you need
each text run with its on-page coordinates and font use extract_entities.
- **convert_pdf** — Convert a whole PDF into a text representation for downstream LLM use.

Returns JSON: {content, format} for 'markdown', or {chunks, format} for
'chunks'/'rag' (each chunk carries its index and page_numbers; rag chunks
add token_estimate and heading_context). Read-only.

Use this when you need structure or chunking. If you just want the raw
reading text use extract_text; for per-run coordinates use extract_entities.
- **analyze_pdf** — Inspect a PDF's structural health or conformance (does not read content).

Returns JSON keyed by the chosen check: validate → {valid, error_count,
warning_count}; corruption → {corrupted, corruption_type, severity,
found_pages, file_size, errors}; compliance → {level, is_valid,
error_count, warning_count, compliance_percentage}; compare →
{structurally_equivalent, content_equivalent, similarity_score,
difference_count}. Read-only.

Use this to verify a file is well-formed, archival-grade, or identical to
another. To read titles/author/page counts use read_pdf; for the text use
extract_text.
- **extract_entities** — Extract every text run of a PDF together with its layout geometry.

Returns JSON {path, entities, entity_count, page_count} where each entity is
{text, page (0-based), x, y, font_size, font_name}. Coordinates are in PDF
points with the origin at the bottom-left of the page. Read-only.

Use this for layout-aware tasks (table reconstruction, positional lookup,
locating a label on the page). If you only need the reading text without
coordinates, use extract_text; for Markdown or RAG chunks use convert_pdf.
- **manipulate_pdf** — Restructure the pages of existing PDF file(s) and write a new PDF.

Each operation writes to output_path (overwriting any existing file) and
returns JSON {status, operation}; on a missing required argument it returns
{error, code}. Per-operation requirements: merge→input_paths; rotate→degrees;
extract_pages→page_indices; overlay→overlay_path; split→output_path is a
directory. Page indices are 0-based.

Use this for page-level structure. To stamp notes/highlights use
annotate_pdf; to fill form fields use manage_forms; to encrypt use secure_pdf.
- **annotate_pdf** — Stamp a sticky note or highlight onto a page of an existing PDF.

Writes the annotated copy to output_path (overwriting any existing file) and
returns JSON {status, annotation_type}; out-of-range pages or coordinates
outside the page bounds return {error, code}. Coordinates are in PDF points
with the origin at the bottom-left.

Use this to mark up a document. To reorder/rotate/overlay whole pages use
manipulate_pdf; to author a new PDF use create_pdf.
- **manage_forms** — Create, fill, read or validate PDF form fields.

Returns JSON per operation: create→{status, fields_created}; fill→{status,
fields_filled}; read→{path, fields, page_count}; validate→{valid, fields}.
'create'/'fill' write output_path (overwriting); 'read'/'validate' are
read-only computations.

Honest limitations: 'fill' lays the values into a new overlay at computed
positions rather than mapping them onto the original AcroForm widgets;
'read' returns the page's text runs (not declared AcroForm field objects);
'validate' currently enforces only a non-empty (required) rule per value. For
page-structure edits use manipulate_pdf; to read prose use extract_text.
- **secure_pdf** — Encrypt a PDF, report its encryption status, or verify its signatures.

Returns JSON per operation: encrypt→{status, operation, page_count, note};
permissions→{path, is_encrypted, unlocked, permissions}; verify_signatures→
{path, signatures, signature_count}. 'permissions' and 'verify_signatures'
are read-only; 'encrypt' writes output_path (overwriting).

Caveat: 'encrypt' rebuilds the document from its text, preserving content and
layout but possibly dropping images, embedded fonts and vector graphics (the
current API has no in-place encryption). To encrypt a PDF you are authoring,
pass the passwords to save_pdf instead.
- **create_pdf** — Open an in-memory PDF building session; the first step of authoring a PDF.

Returns JSON {session_id, status, page_size}. No file is written here — this
only allocates a session (with one blank starting page) held in server
memory and subject to a TTL. Not idempotent: each call creates a new session.

Workflow: create_pdf → add_pdf_content (text / new pages, repeatable) →
save_pdf (writes the file and closes the session). To annotate or fill an
existing PDF instead of authoring one, use annotate_pdf or manage_forms.
- **add_pdf_content** — Append text or a new page to an open create_pdf session (step 2 of 3).

Mutates the in-memory session; nothing is written to disk until save_pdf.
Returns JSON {status, session_id, page_count} on success, or {error, code}
if the session is missing/inactive or required text fields are absent.
Coordinates use PDF points with the origin at the bottom-left of the page.

Call repeatedly to build up pages, then call save_pdf. This only works on a
session from create_pdf — to add notes/highlights to an existing PDF file
use annotate_pdf instead.
- **save_pdf** — Render an open create_pdf session to a PDF file (step 3 of 3, terminal).

Builds a Document from the session's accumulated pages, writes it to
output_path (overwriting any existing file), then deletes the session — so
the session_id is no longer usable afterwards. Returns JSON {status, path,
page_count}, or {error, code} if the session is missing.

Only finalizes sessions created via create_pdf/add_pdf_content. To encrypt an
already-saved PDF use secure_pdf; to add annotations use annotate_pdf.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "oxidize-python": {
    "command": "uvx",
    "args": ["--from","oxidize-pdf[mcp]","oxidize-mcp"],
    "env": {
      "OXIDIZE_WORKSPACE": "",
      "OXIDIZE_ALLOWED_PATHS": "",
      "OXIDIZE_MAX_FILE_SIZE_MB": "",
      "OXIDIZE_MAX_PAGES": "",
      "OXIDIZE_MAX_OUTPUT_BYTES": "",
      "OXIDIZE_MAX_SESSIONS": "",
      "OXIDIZE_MAX_SESSION_BYTES": "",
      "OXIDIZE_SESSION_TIMEOUT": ""
    }
  }
}
```

**Requires environment variables:** `OXIDIZE_WORKSPACE`, `OXIDIZE_ALLOWED_PATHS`, `OXIDIZE_MAX_FILE_SIZE_MB`, `OXIDIZE_MAX_PAGES`, `OXIDIZE_MAX_OUTPUT_BYTES`, `OXIDIZE_MAX_SESSIONS`, `OXIDIZE_MAX_SESSION_BYTES`, `OXIDIZE_SESSION_TIMEOUT` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What bzsanti/oxidize-python MCP server does

bzsanti/oxidize-python exposes the PDF functionality of the `oxidize-pdf` package through Model Context Protocol. It is designed for agents that need to work with local PDF files, including document inspection, text extraction, content generation, page operations, form processing, and security checks.

The package is implemented with a Rust core and provides Python bindings without C dependencies, Java, or subprocess calls. The MCP installation is optional: the base package provides the PDF library, while the `mcp` extra adds the server dependencies.

## How it works

Start the server with `oxidize-mcp`. It communicates with MCP clients over standard input and output, and its tools operate on files within a configured workspace. The server also provides resources containing session data, capabilities, and version information, along with prompts for workflows such as summarization, data extraction, and form filling.

PDF creation and editing use stateful sessions. Agents can create a document, add pages or other content, and save the resulting file. Session limits, expiration, and response-size caps help bound resource use. Oversized input files and documents with too many pages are rejected before extraction work begins.

The server does not provide a hosted HTTP endpoint. It can be launched locally by Claude Desktop, VS Code with GitHub Copilot agent mode, or an application using the OpenAI Agents SDK's stdio MCP support.

## Setup and configuration

Install the MCP extra with:

```bash
pip install "oxidize-pdf[mcp]"
oxidize-mcp
```

Python 3.10 or newer is required. Supported platforms include Linux on x86_64 or aarch64, macOS on Intel or Apple Silicon, and Windows on x86_64. The server can also be started as a Python module with `python -m oxidize_pdf.mcp.server` or programmatically through `oxidize_pdf.mcp.server.run`.

Set `OXIDIZE_WORKSPACE` to choose the sandbox root. By default, it uses `~/Documents/oxidize-mcp`; file paths must resolve inside that directory unless additional locations are listed in `OXIDIZE_ALLOWED_PATHS`. Other environment variables control file-size, page-count, response, session, and session-timeout limits:

- `OXIDIZE_MAX_FILE_SIZE_MB`
- `OXIDIZE_MAX_PAGES`
- `OXIDIZE_MAX_OUTPUT_BYTES`
- `OXIDIZE_MAX_SESSIONS`
- `OXIDIZE_MAX_SESSION_BYTES`
- `OXIDIZE_SESSION_TIMEOUT`

## Tools and capabilities

The 12 MCP tools cover the following operations:

- `read_pdf` reads page count, PDF version, encryption status, title, and author.
- `extract_text` returns text from every page or a selected page.
- `convert_pdf` produces Markdown, chunks, or a RAG-oriented representation.
- `create_pdf` starts a PDF with optional metadata, while `save_pdf` writes a session to disk and can encrypt the output.
- `add_content` adds pages, text, and graphics.
- `annotate_pdf` adds text annotations and highlights.
- `manipulate_pdf` splits, merges, rotates, extracts, reverses, or overlays pages.
- `manage_forms` creates, fills, reads, and validates form fields.
- `secure_pdf` encrypts documents, checks permissions, and verifies signatures.
- `extract_entities` returns structured entities from pages.
- `analyze_pdf` validates structure, detects corruption, and checks PDF/A compliance.

## Limitations and notes

The server is local and stdio-based, so agents need access to the machine where it runs. ChatGPT web requires a remote connection; no ChatGPT plugin is published for this package. Workspace restrictions apply to file paths, and resource caps can cause a tool call to return a `RESOURCE_LIMIT` error. Older installations may need upgrading if `tools/list` returns no tools; Windows users should install and start the server from the same Python environment.

_Full upstream README: https://allmcps.com/mcp/bzsanti-oxidize-python/readme_

