libre-mcp
Provides tools for controlling LibreOffice (Writer and Calc) via the UNO automation API, enabling document creation, editing, saving, and export.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@libre-mcp create a new Writer document and add the text 'Hello, world!'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
libre-mcp
A stdio MCP server for controlling LibreOffice (Writer, Calc & Impress) from Claude Code and other MCP clients — create and edit documents, spreadsheets, and presentations; run formulas; and export to PDF, DOCX, XLSX, PPTX, and more. macOS and Linux.
Full docs: libre-mcp.krondor.org
Install
curl -fsSL https://raw.githubusercontent.com/krondor-corp/libre-mcp/main/install.sh | bashInstalls a prebuilt, self-contained binary to ~/.local/bin (no Python needed on
the host). Update in place with libre-mcp update.
From a source checkout instead (needs uv):
make install # build + install the binary to ~/.local/binRelated MCP server: lo-mcp
Connect it to your coding tool
libre-mcp is a stdio MCP server, so any MCP-capable client can run it. Make
sure libre-mcp is on your PATH (or use its absolute path).
Claude Code
claude mcp add libre -- libre-mcpCursor — ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
{
"mcpServers": {
"libre": { "command": "libre-mcp" }
}
}Claude Desktop — Settings → Developer → Edit Config (claude_desktop_config.json):
{
"mcpServers": {
"libre": { "command": "libre-mcp" }
}
}VS Code (GitHub Copilot) — .vscode/mcp.json, or code --add-mcp '{"name":"libre","command":"libre-mcp"}':
{
"servers": {
"libre": { "type": "stdio", "command": "libre-mcp" }
}
}Windsurf — ~/.codeium/windsurf/mcp_config.json: same mcpServers shape as Cursor.
Restart the client (or reload its MCP config) and libre's tools appear.
Requirements
LibreOffice must be installed:
macOS:
/Applications/LibreOffice.appDebian/Ubuntu:
apt install libreoffice-writer libreoffice-calc python3-unoOther Linux (TDF/opt builds): bundle their own Python — nothing extra.
Paths are auto-discovered; override with LIBRE_MCP_SOFFICE_PATH /
LIBRE_MCP_PYTHON_PATH if LibreOffice lives somewhere unusual.
Usage
Ask your MCP client to work with documents, spreadsheets, or presentations. The
typical flow is create/open → edit → export (e.g. build a deck and save it as
.pptx); documents stay open (referenced by doc_id) until closed.
Tool | Purpose |
| New writer/calc/impress/draw doc → |
| Open a file → |
| Inspect open docs ( |
| Save in place or to a path |
| Export (pdf, docx, xlsx, csv, …) |
| Close a doc (refuses on unsaved changes; |
| Read a Writer doc's text |
| Append text |
| Replace text |
| Page margins / background |
| Styled paragraph / heading |
| Bulleted / numbered list |
| Table (accent header row) |
| Inline image |
| Page-anchored band / callout |
| Write Calc cells/formulas |
| Read a Calc range |
| Append an Impress slide |
| Set a slide's title/bullets |
| Inspect / remove slides |
| Read a slide's title, bullets, and text boxes |
| Slide aspect (16:9 / 4:3) |
| Solid or gradient background |
| Positioned, styled text |
| Rect/round/ellipse/line (+ text) |
| Place an image on a slide |
Slide graphics (and Writer page boxes) position by percent (0-100) and take hex colors — enough to build themed, graphic-rich decks and branded documents (letterheads, reports, one-pagers). Full arguments: the tool reference.
Live editing & concurrency
The server drives one headless/visible LibreOffice in an isolated profile — its own process, separate from your everyday LibreOffice. That has two consequences worth knowing:
To watch edits live, edit the window the server opens (live mode,
show: true) — it shares the server's document model, so you and the agent see each other's changes instantly. Opening the same file in your own LibreOffice gives you a separate in-memory copy; the two processes can't see each other's unsaved edits (local LibreOffice has no real-time co-editing — that's a cloud/Collabora feature). The only bridge between two instances is the file on disk: save in one, reopen in the other.The agent won't clobber your in-flight edits. Every document carries a revision counter bumped on any change (agent or human); a tool that would edit a document you changed since the agent last looked is refused with a conflict warning until the agent re-reads it. Likewise
close_documentrefuses to discard unsaved changes unless you passforce.
Links
Acknowledgements
Built on the work of others:
LibreOffice and The Document Foundation — the office suite and its UNO / PyUNO automation API that does all the real work.
Model Context Protocol and the Python MCP SDK.
PyInstaller, uv, and git-cliff for packaging and releases.
confit — the model for this project's release and docs setup.
Available Tools
31 toolsadd_imageC
Place an image from an absolute path. x/y/w/h are percent of the slide.
Inputs: h (required), w (required), x (required), y (required), +3 more.
add_listC
Append a bulleted (or numbered, if ordered=true) list — one string per item.
Inputs: items (required), doc_id (required), size, color, +1 more.
add_page_boxA
Place a page-anchored box (a colored band, header, or pull-quote
callout). x/y/w/h are percent (0-100) of the PAGE; fill is the box color
(hex, or null for transparent); optional text is styled with
color/size/bold/align. Great for letterheads and report headers.
Inputs: h (required), w (required), x (required), y (required), +9 more.
add_paragraphA
Append a styled paragraph to a Writer doc (the workhorse — use a large
bold size for headings). size is points; color is hex; align is
left|center|right|justify; space_before/after are cm. style optionally
applies a named paragraph style (e.g. "Heading 1").
Inputs: text (required), doc_id (required), bold, font, +7 more.
add_shapeA
Draw a shape: shape is rect|round|ellipse|line. x/y/w/h are percent of
the slide. fill is hex (or null for none); pass fill2 for a gradient at
angle. line/line_width add a border (1/100 mm). Optional centered
text with its own color/size/bold. corner (1/100 mm) rounds "round"
rects.
Inputs: h (required), w (required), x (required), y (required), +13 more.
add_sheetA
Add a worksheet by name (appended, or at index). Returns {name, count}.
Inputs: name (required), doc_id (required), index.
add_slideA
Append a slide to an Impress presentation. Returns {index, count}.
A new presentation already has one slide at index 0. layout is an Impress autolayout id (default 1 = title + content).
Inputs: doc_id (required), layout.
add_textboxB
Place a styled text box. x/y/w/h are percent (0-100) of the slide;
size is in points; color is hex; align is left|center|right; valign is
top|center|bottom. Use newlines in text for multiple lines.
Inputs: h (required), w (required), x (required), y (required), +10 more.
close_documentA
Close an open document.
Refuses with a warning if the document has unsaved changes (so in-flight
work — yours or a human's, in a live window — isn't silently discarded);
save_document first, or pass force=true to close and discard.
Inputs: doc_id (required), force.
create_documentA
Create a new empty LibreOffice document.
kind: one of "writer", "calc", "impress", "draw". Returns {doc_id, kind};
pass doc_id to subsequent tools.
show: in live mode, whether to open it in a visible window so edits are
watchable. Defaults to the server's live setting; pass false to build it
off-screen, true to pop it up. (No effect on a headless server.)
Inputs: kind, show.
delete_slideA
Delete a slide by 0-based index. Returns {count}.
Inputs: index (required), doc_id (required).
document_infoC
Get {kind, url, modified} for an open document.
Inputs: doc_id (required).
export_documentA
Export a document to an absolute path in the given format.
format examples: pdf, docx, odt, xlsx, ods, csv, html, txt. Inferred from
the path extension if omitted.
Inputs: path (required), doc_id (required), format.
find_and_replaceA
Replace all occurrences of search with replace. Returns {count}.
Set regex=true to treat search as a regular expression.
Inputs: doc_id (required), search (required), replace (required), regex.
get_textB
Return the full plain text of a Writer document as {text}.
Inputs: doc_id (required).
insert_imageB
Insert an image inline from an absolute path, scaled to width_cm (aspect preserved).
Inputs: path (required), doc_id (required), width_cm.
insert_tableC
Insert a table from a 2D list of rows. With header=true the first row gets the accent background + white bold text.
Inputs: rows (required), doc_id (required), size, color, +2 more.
insert_textB
Append text at the end of a Writer document.
Set paragraph_break to start a new paragraph before inserting.
Inputs: text (required), doc_id (required), paragraph_break.
list_documentsA
List currently open documents as {documents: [{doc_id, kind, url}]}.
Inputs: no named parameters.
list_slidesA
List slides as {slides: [{index, title}], count}.
Inputs: doc_id (required).
open_documentA
Open an existing document from an absolute filesystem path.
Returns {doc_id, kind, path}. `show` (live mode) opens it in a visible
window (true) or edits it off-screen (false); defaults to the server's
live setting.
Inputs: path (required), show.
page_setupA
Set page margins (cm) and/or page background color (hex) for a Writer
doc. margin sets left/right/bottom; top overrides the top margin
(raise it to clear a header band).
Inputs: doc_id (required), top, color, margin.
read_cellsA
Read a cell range (e.g. "A1:C10") as {values: [[...]]}.
Each row is a list; numeric cells come back as numbers, text as strings.
Set formula=true to read the underlying formula strings instead of
evaluated values (e.g. "=A1*2") — useful for inspecting an existing model.
sheet selects the sheet by name or 0-based index (defaults to first).
Inputs: range (required), doc_id (required), sheet, formula.
read_slideA
Read a slide's text content by 0-based index.
Returns {index, title, bullets, text}: `title` is the title placeholder,
`bullets` the body placeholder split into lines, and `text` every
non-empty string on the slide in z-order — including graphics-built text
boxes and shape labels (add_textbox/add_shape), which the placeholders
don't capture.
Inputs: index (required), doc_id (required).
save_documentA
Save a document.
With no path, saves in place (the document must already have a location). With an absolute path, saves a copy; format is inferred from the extension if omitted (e.g. odt, pdf, docx, ods, xlsx, csv, html).
Inputs: doc_id (required), path, format.
set_cellsA
Write cells in a Calc document. Returns {written}.
cells is a list of {cell, value?|formula?} entries, e.g.
[{"cell": "A1", "value": 21}, {"cell": "A2", "formula": "=A1*2"}]
A "value" that is a number is written numerically; otherwise as text. A
"formula" (starting with =) is evaluated by Calc. sheet selects the
target sheet by name or 0-based index (defaults to the first sheet).
Inputs: cells (required), doc_id (required), sheet.
set_column_widthB
Set the width (cm) of a column or column span, e.g. "A" or "A:E".
Inputs: doc_id (required), columns (required), width_cm (required), sheet.
set_presentation_sizeA
Set the slide aspect ratio for the whole deck: "16:9" (default) or "4:3".
Call this once on a new presentation before laying out slides.
Inputs: doc_id (required), preset.
set_slide_backgroundA
Fill a slide's background. Call this FIRST on a slide (it stacks at the
back). Pass color2 for a linear gradient from color→color2 at angle
degrees. Colors are hex like "#1a1a1a".
Inputs: color (required), slide (required), doc_id (required), angle, +1 more.
set_slide_contentB
Set a slide's title and/or bullet body by 0-based slide index.
bullets is a list of strings, one per bullet line.
Inputs: index (required), doc_id (required), title, bullets.
style_cellsA
Format a cell range (e.g. "A1:E1"). bold/italic, text color, cell
fill, size (pt), font, align (left|center|right), and
number_format (a Calc format code, e.g. "$#,##0", "0.0%",
"$#,##0;RED"). Only the args you pass are applied.
Inputs: range (required), doc_id (required), bold, fill, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 31 tools
Most tools target a specific document type and action, but a few pairs (insert_image/add_image, save_document/export_document, add_textbox/add_shape) have overlapping potential. Descriptions usually clarify the target document/context, so an agent can mostly disambiguate.
The vast majority follow a clear snake_case verb_noun pattern (add_slide, set_cells, read_cells, close_document). Minor deviations like page_setup and document_info break the pattern but are not jarring.
31 tools is above the 25-tool threshold and will be heavy for an agent to scan. The broad Writer/Calc/Impress coverage justifies some size, but several add/insert and save/export tools could be consolidated.
The server covers document lifecycle (create/open/save/export/close) plus generation and reading for Writer, Calc, and Impress. Gaps like Writer text editing/deletion, Calc row/column manipulation, and slide reordering exist but are workable-around for typical document-building tasks.
Maintenance
Related MCP Connectors
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
Document conversion MCP server: PDF to Markdown, image OCR, spreadsheet parsing.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables spreadsheet operations on LibreOffice Calc workbooks through UNO, including reading, writing, formatting, and hyperlink management.1MIT
- AlicenseAqualityDmaintenanceA stdio MCP server for LibreOffice Writer that enables creating, editing, and exporting Writer documents via natural language commands.151MIT
- AlicenseAqualityDmaintenanceMCP server for rendering, parsing, converting, and editing Office documents (Excel, PowerPoint, Word) from a structured JSON spec, using LibreOffice WASM for conversion and preview.51ISC
- AlicenseNot gradedqualityCmaintenanceMCP server enabling AI to control WPS Office (Writer/Calc/Impress) for document creation, editing, export, and live typing.MIT