Command line and AI agents

MarkupRight can work without its window. Scripts and scheduled jobs use the markupright command, and AI assistants use the same capabilities through the MCP connector: hundreds of tools for reading, marking up and measuring PDFs.

Expert·12 minute read

Command line
markupright (on Windows terminals, markupright-cli)
AI assistants
MarkupRight ▸ Preferences ▸ Admin ▸ MCP
You'll need
A licence or the trial. Viewer mode refuses batch jobs and the connector.

Where the program is

The command-line program is the MarkupRight app itself:

Installed withProgram
macOS (the .dmg)/Applications/MarkupRight.app/Contents/MacOS/markupright
Windows (setup.exe, for one user)%LOCALAPPDATA%\MarkupRight\markupright.exe, with markupright-cli.exe beside it
Windows (MSI, for the whole computer)C:\Program Files\MarkupRight\markupright.exe, with markupright-cli.exe beside it
Why Windows has markupright-cli

On Windows, markupright.exe is a windowed program, so opening it from the Start menu or a PDF doesn't leave a console window behind it. The flip side is that Command Prompt and PowerShell neither show its output nor wait for it. In a terminal, type markupright-cli instead: it runs the same commands, shows their output, returns their exit code and stops them when you press Ctrl+C. AI assistants can start markupright.exe directly, because they read its output through pipes.

Commands

CommandWhat it does
markupright <files>Opens the window with the files in tabs. Images and text files open as new PDFs, and a web address opens in a WebTab.
markupright --combine <files>Opens the Stapler to combine the files into one PDF.
markupright --convert <files>Opens the Stapler to convert each file to its own PDF.
markupright --versionPrints the installed version, for example MarkupRight 1.0.1.
markupright --selftestChecks that the PDF engine works without opening a window, and prints self-test passed.
markupright batch <feature> …Runs a Batch menu job over a list of files. More below.
markupright mcpServes MarkupRight's tools to an AI assistant. More below.
markupright --check-update [--channel stable|beta]Says whether a newer version is published. It never downloads.
markupright --activate <key> [--name <computer>]Activates a licence key on this computer.
markupright --deactivateFrees this computer's seat.
markupright --license-file <path> [--machine]Installs a licence file; --machine installs it for every user (needs administrator rights).
markupright --license-statusPrints the licence state as one line of JSON, for inventory scripts.

Exit codes

CodeMeaning
0Done (for batch jobs: every file was done).
1Something failed (for batch jobs: at least one file).
2Usage error, or the MCP connector is turned off.
3Refused: MarkupRight is in viewer mode.
4The licence server refused the request.
5The network couldn't be reached.
# macOS: check an installation from Terminal
/Applications/MarkupRight.app/Contents/MacOS/markupright --version
/Applications/MarkupRight.app/Contents/MacOS/markupright --selftest
# Windows: the same checks from PowerShell
& "$env:LOCALAPPDATA\MarkupRight\markupright-cli.exe" --version
& "$env:LOCALAPPDATA\MarkupRight\markupright-cli.exe" --license-status

Batch jobs from the command line

Every job on the Batch menu can run from a script, for example overnight on a server. You give it a file list (a .bcx file, the same kind the Batch dialogs save with Save…) and the job's options.

<?xml version="1.0" encoding="UTF-8"?>
<markupright-batch version="1">
  <file path="A-101 Level 1 Floor Plan.pdf" pages="all"/>
  <file path="A-102 Level 2 Floor Plan.pdf" pages="1"/>
</markupright-batch>

The pages of each file are all, current, even, odd, landscape, portrait, or page numbers such as 1,3,5. Then:

# Stamp the top right corner of every listed page
markupright batch stamp --bcx issue.bcx --stamp "Approved.pdf" --anchor top_right

# Make scanned pages searchable
markupright batch ocr --bcx scans.bcx --language en

# Protect every file with a saved security preset (passwords only from the environment)
export ISSUE_MASTER_PW='…'
markupright batch security --bcx issue.bcx --preset "Issue for Construction" --master-password-env ISSUE_MASTER_PW

# Slip-sheet a new issue into the current set, carrying the markups over
markupright batch slip-sheet --bcx paired.bcx --replace --copy-markups
FeatureOptions
rotate--degrees 90|180|270|-90
split--pages <n> or --size-mb <mb> or --bookmarks; --out <folder>
headers, remove-headers--template <file> (a template saved by the Header and Footer dialog)
security, remove-security--preset <name>, --presets <file>, --open-password-env <VAR>, --master-password-env <VAR>
sign-seal--id <p12> --password-env <VAR> with --field <name> or --rect x0,y0,x1,y1; --certify no-changes|form-fill|comments, --reason, --date-rect, --timestamp <url>
ocr--language <code>
reduce, repairnone (files are rewritten in place)
flatten--no-recovery to flatten permanently
link--config <batch link xml>
slip-sheet--replace, --copy-markups, --unflatten-before, --flatten-after, --superseded, --keep-links, --extract-unmatched <folder> (a paired list)
compare, overlay--out <folder> (a paired list)
stamp--stamp <file>, --opacity, --scale, --anchor top_left…bottom_right, --x, --y, --rotation, --blend, --lock
page-setup--media '[w,h]', --crop '{"top":n,…}'
summary--summary <job.json> (a Markup Summary job)
print--printer <name> or --folder <folder>, --copies <n>

Each file prints one line saying what happened. A mistake in the command prints the full list of features and options, with exit code 2.

Closed files are saved in place

Batch jobs change the listed files and save them where they are (split, compare and overlay write new files instead). Work on copies, or keep a backup, until you're happy with a job.

Connect an AI assistant (MCP)

The Model Context Protocol (MCP) is an open standard that lets an AI assistant, such as Claude, use tools on your computer. MarkupRight's MCP connector gives an assistant the same abilities you have in the app, as tools it can call: open a PDF, read its text, add markups, measure, compare, run batch jobs, build Sets and more. You ask in plain language ("cloud every room on A-101 that's under 100 sq ft") and the assistant does the steps.

The connector is off until someone turns it on.

To connect an AI assistant

  1. Choose MarkupRight ▸ Preferences, then Admin, then the MCP tab.
  2. Tick Enable the MCP connector and click Apply.
  3. Click Copy Configuration.

    The configuration for your installation is on the clipboard.

  4. Paste it into your assistant's MCP configuration. In Claude Desktop, for example, that's Settings ▸ Developer ▸ Edit Config, which opens claude_desktop_config.json.
  5. Restart the assistant.

    The assistant lists MarkupRight among its tools.

Preferences, Admin page, MCP tab: the Enable the MCP connector check box, the Copy Configuration button and the JSON to add to an AI assistant's configuration.
The MCP tab shows exactly what to paste, with the path of your installed copy.

The configuration looks like this. Adding --root confines the assistant to one folder's files, which we recommend:

{
  "mcpServers": {
    "markupright": {
      "command": "/Applications/MarkupRight.app/Contents/MacOS/markupright",
      "args": ["mcp", "--root", "/Users/priya/Projects/Harbor St Clinic"]
    }
  }
}

On Windows the command is the path of markupright.exe, written with doubled backslashes: "C:\\Users\\priya\\AppData\\Local\\MarkupRight\\markupright.exe".

What an assistant can and can't do

Things to ask

The tools at a glance

The connector offers about 335 tools, plus 25 Collab tools with a Team licence. The assistant reads their descriptions itself; this table helps you know what to ask for.

ToolsWhat they cover
doc_* (47)Open, inspect, save, combine, split, compare, overlay, export, protect, flatten and reduce documents.
page_* (19)Render, rotate, insert, extract, replace, number and set up pages.
markup_*, comment_*, group_*Add any markup type, restyle, move, align and group markups; comments and replies.
measure_* (19), viewport_*, fill_run, sketch_addScales and viewports, lengths, areas, counts and cutouts, totals and CSV export.
list_*, status_*, summary_*, legend_*Markups List rows and totals, statuses, Markup Summary reports and legends.
stamp_*, toolset_*, toolchest_*Create and place stamps; build, share and place Tool Chest tools.
batch_* (14)Any Batch job, Sign & Seal, compare, overlay, slip sheet and Batch Link.
set_* (14)Sets, tags, revisions, publishing and drawing logs.
text_*, ocr_*Extract and find text, recognise scanned pages, edit text.
security_*, redact_*, sign_*, id_*, pdfa_*Passwords and presets, redaction, digital IDs and signatures, PDF/A.
bookmark_*, layer_*, link_*, form_*, accessibility_*Bookmarks, layers, hyperlinks, form fields and accessibility tags.
collab_* (25)Collab servers, Projects (check out, check in, revisions) and Sessions.
command_list, command_run, render_previewRun any MarkupRight command by its id, and preview a page as an image.

For power users Expert

# Minimal MCP client: list the tools MarkupRight offers
import json, subprocess
p = subprocess.Popen(["markupright", "mcp"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
def rpc(i, method, params=None):
    p.stdin.write(json.dumps({"jsonrpc": "2.0", "id": i, "method": method, "params": params or {}}) + "\n")
    p.stdin.flush()
    return json.loads(p.stdout.readline())
rpc(1, "initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "demo", "version": "1"}})
p.stdin.write(json.dumps({"jsonrpc": "2.0", "method": "notifications/initialized"}) + "\n"); p.stdin.flush()
print(len(rpc(2, "tools/list")["result"]["tools"]), "tools")