Connect an AI agent to your PDFs with MCP
Version 4.5.0 adds a Model Context Protocol server to PDF Metadata Editor. It lets an AI client read, edit, clear, rename, import and export PDF metadata through a small set of tools instead of you clicking through the app.
The server is local. It runs on your machine and speaks newline-delimited JSON-RPC over stdin/stdout, so no PDF is uploaded anywhere and no extra service is involved. There are two ways to run it:
- Desktop app — the server is included in v4.5.0 and newer. Nothing else to install.
- npm package —
pdf-metadata-editor-mcpruns on any machine with Node.js 18 or newer, whether or not the desktop app is installed.
What the server can do
- Read metadata from one PDF, several PDFs, or a whole directory tree.
- Set or clear metadata fields in batch, with optional templates and an output directory.
- Rename files from their metadata.
- Export metadata to JSON, YAML or CSV, and import it back from the same formats or from file names.
- Check the current license, activate one, or release it before moving the app to another computer.
pdf_list_fields, pdf_read_metadata and pdf_license work without a license.
The batch editing, renaming, import and export tools may require a Pro or batch
license. A per-file failure does not abort a batch: every tool returns a summary
plus one result per file.
Option 1: the desktop app you already installed
This requires PDF Metadata Editor v4.5.0 or newer. The MCP server is part of the normal installation, so there is no npm install and no separate download.
Let your agent set it up
Ask your agent to set it up
Paste this into Claude, Cursor, OpenCode, VS Code or any other agent that can edit configuration files. It will add the server, verify the connection and show you the result.
Set up the PDF Metadata Editor MCP server for my AI client. I have the PDF Metadata Editor desktop app (v4.5.0 or newer) installed. 1. Run `pmedit-cli --help-mcp` to get the exact launcher command for this installation. If that command is not available, ask me to open the app and use Help → MCP, then paste the output. 2. Add an MCP server named `pdf-metadata-editor` to my client's configuration. Use the printed launcher followed by `--mcp`. 3. Restart the client and verify the connection by calling the `pdf_list_fields` tool. 4. Show me the exact configuration you wrote and where the file is. Do not modify any PDFs while testing. If a tool reports that a license is required, or if you need to activate or release a license, stop and ask me first.
Manual setup
- Update the app to v4.5.0 or newer from the download page.
- Open the app and choose Help → MCP. The Configuration tab shows the
exact launcher detected for your installation; the Options tab explains
the flags. Use Copy to copy the configuration. From a terminal, the same
guide is available with
pmedit-cli --help-mcp. - Add the server to your client using the samples below. Use the command from the dialog, not a guessed path.
- Restart the client, then ask the agent to call
pdf_list_fieldsto confirm the connection.
The launcher depends on how the app was installed. On Windows the command is
pmedit-cli.exe (use the full path if it is not on PATH). A macOS or Windows
installer puts both the GUI and pmedit-cli in the application directory, so
the full path is the reliable choice. Linux AppImage users can download the
AppImage as pmedit-cli or create a symlink next to it:
ln -s Pdf_Metadata_Editor-*.AppImage pmedit-cli
For a Flatpak installation the command is flatpak with the arguments
run me.broken_by.PdfMetadataEditor --mcp. Flatpak runs the app in a sandbox,
so grant it access to your PDFs with Flatseal if it cannot read them. If your
MCP client itself runs inside a sandbox, start the server through the host with
flatpak-spawn --host flatpak run me.broken_by.PdfMetadataEditor --mcp.
This is the mcpServers shape used by Claude Desktop, Cursor, Windsurf and Cline. Claude Desktop keeps it in claude_desktop_config.json; Cursor in ~/.cursor/mcp.json or .cursor/mcp.json in the project.
{
"mcpServers": {
"pdf-metadata-editor": {
"command": "pmedit-cli",
"args": [
"--mcp"
]
}
}
}The examples use pmedit-cli. Replace it with the exact launcher shown by Help → MCP: the full path on Windows and macOS, the AppImage path (or its pmedit-cli symlink) on Linux, or flatpak run me.broken_by.PdfMetadataEditor for a Flatpak install.
Option 2: the npm package (no desktop app)
The npm package wraps the same server and includes platform bundles for Linux x64, Linux arm64, macOS arm64, Windows x64 and Windows arm64. On other platforms it falls back to Java 17 or newer. You only need Node.js 18+.
Let your agent set it up
Ask your agent to set it up
Paste this into Claude, Cursor, OpenCode, VS Code or any other agent that can edit configuration files. It will add the server, verify the connection and show you the result.
Add the PDF Metadata Editor MCP server to my AI client. Use the npm package `pdf-metadata-editor-mcp`, which needs Node.js 18 or newer. 1. Check the runtime with `npx -y pdf-metadata-editor-mcp --doctor`. 2. Add a stdio MCP server named `pdf-metadata-editor` to my client's configuration, with the command `npx` and the arguments `-y` and `pdf-metadata-editor-mcp`. 3. Restart the client and verify the connection by calling the `pdf_list_fields` tool. 4. Show me the exact configuration you wrote and where the file is. Do not modify any PDFs while testing. If a tool reports that a license is required, or if you need to activate or release a license, stop and ask me first.
Manual setup
-
Check that the package starts and detects a runtime:
npx -y pdf-metadata-editor-mcp --doctor -
Add the server to your client using the samples below.
-
Restart the client, then ask the agent to call
pdf_list_fieldsto confirm the connection.
If you prefer a permanent command instead of npx, install it globally:
npm install -g pdf-metadata-editor-mcp
The package installs two equivalent commands, pdf-metadata-editor-mcp and
pmedit-mcp, and you can then use "command": "pdf-metadata-editor-mcp" with
no arguments in the client configuration.
This is the mcpServers shape used by Claude Desktop, Cursor, Windsurf and Cline. Claude Desktop keeps it in claude_desktop_config.json; Cursor in ~/.cursor/mcp.json or .cursor/mcp.json in the project.
{
"mcpServers": {
"pdf-metadata-editor": {
"command": "npx",
"args": [
"-y",
"pdf-metadata-editor-mcp"
]
}
}
}The examples run the package through npx, so nothing is installed globally.
License
Reading metadata and managing the license are free. Editing tools use the same Pro or batch license as the desktop app, and the server returns a clear message when one is needed.
The pdf_license tool takes an action of status, activate or release.
Activation expects the email address and license ID from your purchase email as
one comma-separated string ("name@example.com,ABC-123"). Activation contacts
the license server and binds the license to that computer; release it there
before moving it to another machine. Because the agent can see the value you
pass, only give it the license ID when you want it to activate a license, and
review any request to release or re-activate one.
Options
| Option | Desktop app | npm package |
|---|---|---|
--mcp | Starts the server. Required. | Not needed; the wrapper starts the server. |
--mcp-root DIR | Restrict file access to DIR. Defaults to the client's working directory. | Same. Defaults to the process working directory. |
--mcp-read-only | Disable tools that modify PDFs. pdf_license remains available. | Same. |
--mcp-batch-limit N | Maximum files or operations per batch. Default 100; 0 means unlimited. | Same. |
--help-mcp | Print the configuration guide and exit. | Not available. |
--doctor | Not available. | Print the selected runtime, JAR, root, batch limit and write mode. |
--mcp-root is a security boundary: paths cannot escape it, and symlink escapes
are rejected. Use it whenever the agent does not need access to your whole home
directory.
Tools
| Tool | Purpose | License |
|---|---|---|
pdf_list_fields | List valid metadata field IDs, types and writability. | Free |
pdf_read_metadata | Read metadata from one or more PDFs or directories. | Free |
pdf_set_metadata | Set metadata fields on every input PDF (CLI edit). | May require Pro |
pdf_clear_metadata | Clear metadata fields on every input PDF (CLI clear). | May require Pro |
pdf_rename | Rename every input PDF using a metadata template (CLI rename). | May require Pro |
pdf_export_json | Export metadata to JSON (CLI tojson). | May require Pro |
pdf_export_yaml | Export metadata to YAML (CLI toyaml). | May require Pro |
pdf_export_csv | Export metadata to CSV (CLI tocsv). | May require Pro |
pdf_import_from_filename | Set metadata extracted from PDF file names (CLI fromfilename). | May require Pro |
pdf_import_from_json | Import metadata from JSON (CLI fromjson). | May require Pro |
pdf_import_from_yaml | Import metadata from YAML (CLI fromyaml). | May require Pro |
pdf_import_from_csv | Import metadata from CSV (CLI fromcsv). | May require Pro |
pdf_license | Check, activate or release the license (CLI --showLicense, --license, --releaseLicense). | Free |
Every file tool takes a paths array containing files and/or directories. A
single file is paths: ["one.pdf"]; directories are searched recursively for
PDFs. Import tools use importPaths for the JSON, YAML or CSV files.
pdf_set_metadata, pdf_clear_metadata and pdf_rename accept an optional
outputDir; without it, set and clear update files in place and rename moves
files within their current directory. Metadata values can use {field.id}
templates expanded from each file's own metadata.
Security
- The server is limited to the current working directory by default. Narrow it
with
--mcp-root. - Paths cannot escape the root, and symlink escapes are rejected.
- Use
--mcp-read-onlywhen the agent only needs to inspect files. It blocks PDF modifications but not license management. - Import files can contain passwords; treat them as sensitive.
- The server is local and stdio-only. It does not open a network port.
Troubleshooting
The client cannot start the server
Run the server's own check first. With the npm package:
npx -y pdf-metadata-editor-mcp --doctor
With the desktop app, run pmedit-cli --help-mcp and compare the printed
launcher with the command in your client configuration. The most common problem
is a command that only exists inside a shell profile or an app bundle.
No platform bundle was found
The npm package falls back to a system Java installation. Install Java 17 or newer, or point the wrapper at one explicitly:
PDF_METADATA_EDITOR_JAVA=/path/to/java npx -y pdf-metadata-editor-mcp --doctor
For a custom build, set PDF_METADATA_EDITOR_JAR=/path/to/pdf-metadata-editor.jar.
The client freezes after adding the server
The server reserves stdout for MCP messages and writes diagnostics to stderr. Do not wrap the command in something that prints to stdout, and do not add a shell startup banner to the launcher.
Frequently asked questions
Can I use the editor with my agent?
Yes. The desktop app v4.5.0 and newer includes an MCP server, and the npm package provides the same server without the app. Either way, your agent can read, edit, rename, import and export PDF metadata through its normal chat interface.
Do I need the desktop app to use MCP?
No. The npm package runs on Windows, macOS and Linux with Node.js 18 or newer, and includes the same tools and platform bundles as the desktop app.
Does the MCP server upload my PDFs?
No. The server runs locally and talks to your client over stdin/stdout; it does not open a network port. Tool results — metadata values, file names and batch summaries — are returned to your AI client, so use a client whose data policy you trust.
Do I need a Pro license?
pdf_list_fields, pdf_read_metadata and pdf_license are free. Editing,
clearing, renaming, importing and exporting may require the same Pro or batch
license as the desktop app. The server tells the agent when one is needed.
Which clients work with it?
Any client that supports local stdio MCP servers. The configuration tabs above
cover Claude Desktop, Cursor, Windsurf, Cline, Claude Code, OpenCode, VS
Code/Copilot and Codex. Other clients usually work with the generic
mcpServers block.
Can I limit which files the agent can access?
Yes. The server is restricted to the directory your client starts in, and paths outside it are rejected, including symlink escapes. The Security section above explains the default and how to narrow it.
Related
- Command line tool — the same binary, for scripts and automation.
- Batch processing — what the batch tools do in the GUI.
- Download — desktop installers and the current version.
- Pro license — activating a license in the app.