Repository avatar
Other Tools
v0.2.0
active

xournalpp-mcp

io.github.Eugeniouo/xournalpp-mcp

Create editable handwritten Xournal++ notes, diagrams and notebooks. Windows pilot.

Documentation

Xournal++ MCP

CI Windows pilot MIT

An open-source Model Context Protocol (MCP) server for Xournal++, the handwritten note-taking and PDF annotation app. Create editable .xopp notebooks, read handwritten pages, and add native pen strokes, text, diagrams, or full pages from an AI chat. Designed for local MCP clients such as Codex and Claude Desktop (Windows x64 pilot).

Unlike a generated screenshot, native notes remain editable in Xournal++: select individual strokes, change layers, and undo applied drawings. Use it for lecture notes, annotated diagrams, mathematics, and creative sketchbooks.

Install on Windows · Download v0.2.0 · Reproduce the examples

Editable example

Editable Energy notes with handwritten headings, mint accents, and cell diagrams

The page has 1,230 native pen strokes across five named layers. The lettering traces a photographed reference, so close zoom reveals the contours recovered from the photo. Open the .xopp example · More examples and prompts

Studio del grembo

An anatomical study after Leonardo da Vinci with a curled fetus, sepia hatching and mirrored Italian notes

Install on Windows

Install Xournal++ 1.3.8 for Windows x64 using the EXE installer. The server runs locally over STDIO, so use a desktop client on the same PC.

The v0.2.0 downloads support searching, reading, creating notebooks and drawing on an open page. Build from this branch to insert full pages.

Codex in the ChatGPT desktop app

Install Node.js 22.13 or newer. Download xournalpp-mcp-0.2.0-win-x64.zip from the release assets and extract it to a folder you can keep.

Ask Codex to set it up. Use this prompt in a local Windows Codex session with terminal access and permission to install files and update MCP settings.

Set up Xournal++ MCP on this Windows PC using this README. Use the v0.2.0 Windows ZIP and its examples folder. Check for Xournal++ and Node.js, register the server, and verify that Codex can list its tools. Tell me which app steps are left.

If you want to edit open pages, also ask Codex to copy the Lua plugin. Enable it in Xournal++ and restart the editor.

Set it up yourself. If the codex command is available, run the following in PowerShell from the extracted folder.

$server = (Resolve-Path '.\dist\cli.js').Path
$notebooks = (Resolve-Path '.\examples').Path
$editor = 'C:\Program Files\Xournal++\bin\xournalpp-wrapper.exe'
codex mcp add xournalpp -- (Get-Command node.exe).Source $server --root $notebooks --xournal $editor
codex mcp get xournalpp

If you installed Xournal++ elsewhere, set $editor to the wrapper in its bin folder. To use your own notebooks, give --root the absolute path to an existing folder. Repeat --root for each additional folder you want the assistant to access.

You can also configure the server in Settings → MCP servers → Add server. Name it xournalpp, choose STDIO and set the command to the path shown by (Get-Command node.exe).Source. Enter the absolute path to dist\cli.js, --root, your notebook folder, --xournal, and the full path to xournalpp-wrapper.exe as five separate arguments in that order. Save and select Restart. If you used the CLI, restart the desktop app to load the shared configuration. Codex MCP guide

Claude Desktop

Download xournalpp-mcp-0.2.0-win-x64.mcpb from the release assets. In Settings → Desktop app, select Manage next to Extensions, then choose Advanced settings → Install Extension and select the .mcpb. When prompted, choose your notebook folder and xournalpp-wrapper.exe from the Xournal++ bin folder. Desktop extensions can use Claude Desktop's built-in Node.js runtime. For a sample notebook or the live editing plugin, extract the Windows ZIP as well. Claude Desktop extension guide

For manual setup with claude_desktop_config.json, extract the Windows ZIP, use the full path to your Node.js 22.13+ executable as command, and use the same five args as in the Codex setup. Restart Claude Desktop after editing the file.

Check the connection

In Codex, type /mcp to check the connection. In Claude Desktop, open + → Connectors from the chat box. If you chose examples as your notebook folder, ask either client to “Find circuits.xopp and show me page 1.” This checks both notebook access and rendering through Xournal++.

Edit open pages

Install the Lua plugin if you want to share an open page or apply edits in Xournal++. In PowerShell, run .\install-plugin.ps1 from the extracted ZIP folder. You can also copy plugin\XournalppMcp into %LOCALAPPDATA%\xournalpp\plugins. In Xournal++, open Plugin → Plugin Manager, enable XournalppMcp, and restart the editor. Xournal++ plugin guide

Build from source for full-page insertion

With Node.js 22.13 or newer installed, run the following from the repository checkout in PowerShell.

npm.cmd ci
npm.cmd run build
.\scripts\install-plugin.ps1

In Xournal++ enable the plugin if needed and restart the editor. Use the client setup above with dist\cli.js and your notebook folder from the checkout. For Claude Desktop, use the manual JSON setup with those paths. Restart the client after updating its settings.

Work from chat

TaskHow it works
Create a notebookcreate_notebook saves a new .xopp with editable text, strokes, filled polygons and named layers. It reports a conflict if a different file already uses the name.
Find and read notesSearch filenames or typed note text. Read page images to interpret handwriting and PDF backgrounds.
Edit an open pageChoose Plugin → Xournal++ MCP: Share current page. Ask the assistant for a drawing, then choose Apply drawing in Xournal++ to confirm the named page and layer. Use the editor's Undo to remove the inserted batches.
Insert a full pageShare a page in the target notebook. Ask for a new page or import a vector example with prepare_insert_page. Review the PNG, then choose Plugin → Xournal++ MCP: Insert prepared page and confirm. The page goes immediately after the shared page.

Try asking “Insert page 1 of energy.xopp after the page I shared.” The source notebook must be inside a configured root. Preparing a preview also works with an untitled notebook. To apply it, save the notebook, share it again, and request the draft for the new capture.

Page insertion supports 24 content layers, 6,000 elements and 200,000 stroke points within a 4 MiB draft. Imported pages support plain solid paper, solid pen strokes with fills or pressure data, and positioned text. The editor adds a bottom layer for the paper color. Page and layer changes have separate native Undo steps.

The pilot reads standard gzip .xopp files. The assistant receives the pages it requests. Its model provider can process those pages in the cloud when your client uses a cloud model.

Verification

SurfaceVerification
Xournal++ 1.3.8 on Windows x64Native page previews, capture of unsaved ink, editable live drawing, Undo and stale-page rejection. The Energy preview was exported by the editor.
CodexTool discovery verified through the local app server.
Claude DesktopThe Windows MCPB manifest and the server extracted from the bundle are tested. Interactive verification remains open.
macOS and LinuxServer tests run in CI. The installable pilot targets Windows x64.

See verification notes for the editor test and known redraw behavior.

Troubleshooting

  • Search missed a handwritten word. Search covers filenames and typed text. Open a page image for handwriting.
  • Text is available but the preview fails. Check the executable path and linked PDF or image. Configure its folder as an allowed root if you want to include that background.
  • A drawing expired or the page changed. Share the intended page again, then ask for a new preview.
  • Write tools are missing in Codex. Check the server with codex mcp get xournalpp. From the project checkout, build it and run node scripts/check-codex-tools.mjs to inspect a fresh Codex app-server catalog. If the tools are present there, check client tool filters or workspace policy and reconnect the MCP server in a fresh session. The tools are correctly advertised as writes. Codex MCP settings
  • The server asks for a newer editor plugin. Update the Lua plugin, restart Xournal++, and share again. Existing plugin versions can still apply drawing drafts.

Development

From a checkout of this repository:

npm ci
npm run check
npm test

Architecture · Contributing · MIT license

An independent project for the official Xournal++ editor.

MCPB
https://github.com/Eugeniouo/xournalpp-mcp/releases/download/v0.2.0/xournalpp-mcp-0.2.0-win-x64.mcpb
Install Command
# mcpb: https://github.com/Eugeniouo/xournalpp-mcp/releases/download/v0.2.0/xournalpp-mcp-0.2.0-win-x64.mcpb