Skip to main content
Glama
Xournal++ MCP

Xournal++ MCP

by Eugeniouo
README.md
# Xournal++ MCP

[![CI](https://github.com/Eugeniouo/xournalpp-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Eugeniouo/xournalpp-mcp/actions/workflows/ci.yml)
[![Windows pilot](https://img.shields.io/github/v/release/Eugeniouo/xournalpp-mcp?include_prereleases&label=pilot)](https://github.com/Eugeniouo/xournalpp-mcp/releases)
[![MIT](https://img.shields.io/badge/license-MIT-163c68)](LICENSE)

Create editable notebooks, read handwritten pages and apply drawings in the official [Xournal++](https://github.com/xournalpp/xournalpp) editor from an AI chat.

[Download the Windows ZIP or Claude Desktop bundle](https://github.com/Eugeniouo/xournalpp-mcp/releases/tag/v0.2.0) · [Install](#install-on-windows) · [Reproduce the examples](examples/README.md)

## Editable examples

| Constrained extrema · multivariable calculus | Leaf anatomy · botany |
| --- | --- |
| [![Contour plot for a constrained optimization problem](docs/images/lagrange-multipliers-1.png)](docs/images/lagrange-multipliers-1.png) | [![Layered cross-section of a leaf, with a vascular bundle and stomatal pore](docs/images/leaf-anatomy-1.png)](docs/images/leaf-anatomy-1.png) |
| [Download .xopp](https://raw.githubusercontent.com/Eugeniouo/xournalpp-mcp/main/examples/lagrange-multipliers.xopp) · [Page 2 preview](docs/images/lagrange-multipliers-2.png) | [Download .xopp](https://raw.githubusercontent.com/Eugeniouo/xournalpp-mcp/main/examples/leaf-anatomy.xopp) · [Page 2 preview](docs/images/leaf-anatomy-2.png) |

Each notebook has two pages. The gallery script sends reproducible requests to the MCP server and exports every page through Xournal++. In the downloaded files, text and figures are native Xournal++ elements on named layers. [Source and sample prompts](examples/README.md)

## Install on Windows

1. Install [Xournal++ 1.3.8](https://github.com/xournalpp/xournalpp/releases/tag/v1.3.8) and [Node.js 22.13 or newer](https://nodejs.org/en/download). Extract the Windows ZIP from the release.
2. To edit an open page, run `install-plugin.ps1` from the extracted folder, or copy `plugin/XournalppMcp` into `%LOCALAPPDATA%\xournalpp\plugins`. Enable **XournalppMcp** under **Plugin → Plugin Manager** and restart Xournal++.
3. Connect the server in your desktop client. Choose an absolute notebook folder. You can use the extracted `examples` folder to start.

### Codex in the ChatGPT desktop app

In **Settings → MCP servers**, add a **stdio** server. Use `node` as its command and pass these arguments separately.

```text
C:\Tools\xournalpp-mcp\dist\cli.js
--root
C:\Users\you\Documents\Notebooks
--xournal
C:\Program Files\Xournal++\bin\xournalpp-wrapper.exe
```

Use the installed Xournal++ wrapper path on your machine. Repeat `--root` to allow another folder. The same arguments work in the [Codex MCP configuration file](https://learn.chatgpt.com/docs/extend/mcp?surface=cli).

### Claude Desktop

Install the Windows `.mcpb` under **Settings → Desktop app → Extensions → Advanced settings → Install Extension**. Select the notebook folder and Xournal++ executable when prompted. The optional Lua plugin for live edits comes in the ZIP. [Claude Desktop extension guide](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop)

If your workspace uses a local MCP JSON configuration, set the command to your installed Node.js executable and use the same argument array as the Codex example.

## Work from chat

| Task | How it works |
| --- | --- |
| Create a notebook | `create_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 notes | Search filenames or typed note text. Read page images to interpret handwriting and PDF backgrounds. |
| Edit an open page | Choose **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. |

Try searching the example folder for **Kirchhoff** and ask the assistant to show page 1. For a new notebook, ask for a two-page explanation with a labeled figure and an explicit filename.

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

| Surface | Verification |
| --- | --- |
| Xournal++ 1.3.8 on Windows x64 | Native page previews, capture of unsaved ink, editable live drawing, Undo and stale-page rejection. The gallery notebooks were created over MCP and all four pages rendered in Xournal++. |
| Codex | Tool discovery verified through the local app server. |
| Claude Desktop | The Windows MCPB manifest and the server extracted from the bundle are tested. Interactive verification remains open. |
| macOS and Linux | Server tests run in CI. The installable pilot targets Windows x64. |

See [verification notes](docs/verification.md) 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.

## Development

From a checkout of this repository:

```powershell
npm ci
npm run check
npm test
```

[Architecture](docs/architecture.md) · [Contributing](CONTRIBUTING.md) · [MIT license](LICENSE)

An independent project for the official Xournal++ editor.

TDQS

A3.7/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have clearly distinct purposes within the notebook and drawing workflow. The only mild overlap is between read_page and read_shared_page, but their descriptions clarify saved-page reading versus current shared-page capture with unsaved strokes.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: get_drawing_status, search_notebooks, read_page, create_notebook, open_notebook, read_shared_page, prepare_drawing. No mixed casing or inconsistent verb styles are present.

Tool Count5/5

Seven tools is well-scoped for the server's purpose. Each tool covers a distinct part of the Xournal++ notebook lifecycle: search, read, create, open, shared capture, drawing preparation, and status checking.

Completeness4/5

The surface covers core workflows: finding and reading notebooks, creating and opening notebooks, reading shared pages, preparing drawings, and checking drawing status. Minor gaps remain, such as deleting or renaming notebooks and directly updating existing saved notebook content outside the shared-page drawing flow.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues