Skip to main content
Glama

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 | bash

Installs 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/bin

Related 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-mcp

Cursor — ~/.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.app

  • Debian/Ubuntu: apt install libreoffice-writer libreoffice-calc python3-uno

  • Other 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

create_document(kind)

New writer/calc/impress/draw doc → doc_id

open_document(path)

Open a file → doc_id

list_documents() / document_info(doc_id)

Inspect open docs (modified, rev)

save_document(doc_id, path?, format?)

Save in place or to a path

export_document(doc_id, path, format?)

Export (pdf, docx, xlsx, csv, …)

close_document(doc_id, force?)

Close a doc (refuses on unsaved changes; force discards)

get_text(doc_id)

Read a Writer doc's text

insert_text(doc_id, text, paragraph_break?)

Append text

find_and_replace(doc_id, search, replace, regex?)

Replace text

page_setup(doc_id, margin?, top?, color?)

Page margins / background

add_paragraph(doc_id, text, size?, color?, bold?, align?, …)

Styled paragraph / heading

add_list(doc_id, items, ordered?)

Bulleted / numbered list

insert_table(doc_id, rows, header?, accent?)

Table (accent header row)

insert_image(doc_id, path, width_cm?)

Inline image

add_page_box(doc_id, x, y, w, h, text?, fill?, …)

Page-anchored band / callout

set_cells(doc_id, cells, sheet?)

Write Calc cells/formulas

read_cells(doc_id, range, sheet?)

Read a Calc range

add_slide(doc_id, layout?)

Append an Impress slide

set_slide_content(doc_id, index, title?, bullets?)

Set a slide's title/bullets

list_slides(doc_id) / delete_slide(doc_id, index)

Inspect / remove slides

read_slide(doc_id, index)

Read a slide's title, bullets, and text boxes

set_presentation_size(doc_id, preset)

Slide aspect (16:9 / 4:3)

set_slide_background(doc_id, slide, color, color2?)

Solid or gradient background

add_textbox(doc_id, slide, text, x, y, w, h, …)

Positioned, styled text

add_shape(doc_id, slide, x, y, w, h, shape, fill, …)

Rect/round/ellipse/line (+ text)

add_image(doc_id, slide, path, x, y, w, h)

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_document refuses to discard unsaved changes unless you pass force.

Acknowledgements

Built on the work of others:

Available Tools

31 tools
add_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

    B3.4/5.0

    Scored across 31 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count2/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers