Extract structured JSON from PDFs via CLI, Python API, or MCP server.
Project description
pdf-agent-kit
pdf-agent-kit is a local adapter package for the pdf-agent-kit cloud API.
- MCP entrypoint:
pdf-agent-kit(stdio, one tool:extract_pdf_to_json) - CLI entrypoint:
pdf-edit - Python import:
from pdf_agent_kit import extract
The package is thin by design: it reads a local PDF file, attaches PDF_EDITOR_API_KEY, and forwards to the cloud API.
Quickstart For Agents
from pdf_agent_kit import extract
result = extract("/absolute/path/to/file.pdf", pages="1-3")
Install
pip install pdf-agent-kit
or:
uvx pdf-agent-kit
Python Compatibility
- CLI (
pdf-edit) works on Python3.9+. - MCP server (
pdf-agent-kit) requires Python3.10+becausefastmcpis only installed on 3.10+. - If your agent is pinned to older Python, use
pdf-editdirectly or useuvx pdf-agent-kitfor MCP runtime.
Environment
export PDF_EDITOR_API_KEY="sk_live_..."
You can also persist the key locally (avoids exporting every session):
pdf-edit setup --save-api-key
If missing, commands fail with:
PDF_EDITOR_API_KEY not set. Get your key at https://pdfagentkit.com/dashboard
MCP Tool
Tool name: extract_pdf_to_json
Parameters:
file_path(required)pages(optional, defaultall)filename(optional override)
Returns API JSON: metadata + per-page text + usage stats.
CLI
pdf-edit extract /path/to/file.pdf
pdf-edit extract /path/to/file.pdf --pages "1-5"
pdf-edit extract /path/to/file.pdf -o /path/to/output.json
pdf-edit status
pdf-edit setup --save-api-key
CLI contract:
- success JSON goes to stdout
- errors go to stderr
- exit code
0success,1user error,2server/network error extractprints a concise usage summary to stderr (pages + remaining credits)
Setup
pdf-edit setup:
- Reads
PDF_EDITOR_API_KEY(or prompts once if missing) - Verifies key with
/v1/account/status - Patches MCP config for:
- Claude Desktop
- Cursor
- VS Code
- Tries to add Claude Code integration via
claude mcp add-json - Optionally saves API key to
~/.pdf-agent-kit/config.jsonwith--save-api-key
Injected server entry:
{
"mcpServers": {
"pdf-agent-kit": {
"command": "uvx",
"args": ["pdf-agent-kit"],
"env": {
"PDF_EDITOR_API_KEY": "sk_live_..."
}
}
}
}
Development
pip install -e .[dev]
pytest -q
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_agent_kit-0.1.2.tar.gz.
File metadata
- Download URL: pdf_agent_kit-0.1.2.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4de45a799023e28b4b0c3099699de2cccaf3b448f326c0cf8044e24db8b6b1eb
|
|
| MD5 |
49670c31c74fea2262e8d42fdd3c0fe4
|
|
| BLAKE2b-256 |
8a00c42c01635b8fc92fec48e406e3e88629a3359573e17ab1473f5010810600
|
File details
Details for the file pdf_agent_kit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pdf_agent_kit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60032e9c765694f90af7a1960bf4dd522e63da272659c407fbbb68e239df1fea
|
|
| MD5 |
270aa556261b5a5137c226ea4a68d7aa
|
|
| BLAKE2b-256 |
72d3f69785f577c8c20ff91ee338bd062648f7f4af23b8382bc34bba737328ff
|