OSS · OPEN SOURCE · 2026
LibreOffice-MCP
LibreOffice .oxt extension, MCPB bundle, and 210+ tool MCP server for AI agents
Python · LibreOffice UNO · MCP

Overview / Engineering Problem
AI agents are increasingly capable of drafting text and reasoning over structured data, yet automating real office document suites—creating formatted reports, editing spreadsheets, building presentations, and exporting PDFs—remains fragile when agents rely on raw XML manipulation or brittle GUI macros.
LibreOffice-MCP bridges AI agents directly into LibreOffice through the Model Context Protocol (MCP). Distributed as a LibreOffice .oxt extension, an MCPB bundle, and a Python MCP server exposing 210+ tools, it lets agents programmatically control Writer, Calc, and Impress with native fidelity.
Architecture & Technical Decisions
The project separates agent protocol handling from LibreOffice's internal object model:
- Model Context Protocol (MCP) Server in Python: Exposes a structured catalog of 210+ typed tools that AI clients can discover and invoke deterministically across document creation, formatting, querying, and export workflows.
- LibreOffice UNO Bridge: Connects directly to LibreOffice's Universal Network Objects (UNO) API rather than rewriting ODF XML archives offline, ensuring live layout rules, styles, formulas, and slide structures remain valid.
- Multi-Suite Coverage (Writer, Calc, Impress): Covers word processing, spreadsheet calculation/formatting, and slide deck authoring within a single unified server surface.
- Packaged Distribution (
.oxt& MCPB): Provides both a native LibreOffice.oxtextension and an MCPB bundle so installation works cleanly across desktop environments and MCP-compatible agent hosts.
SDLC & Quality Practices
Designing a 210+ tool surface for LLM consumption demands strict interface discipline:
- Deterministic Tool Schemas: Each MCP tool defines explicit parameters and predictable return structures so agents can chain multi-step document edits reliably.
- Suite-Aligned Modularity: Capabilities are organized cleanly across Writer, Calc, and Impress domains rather than monolithic catch-all endpoints.
- Open-Source Packaging: Maintained with reproducible extension and MCPB bundle packaging for transparent community inspection and adoption.
Stack & Deliverables
| Layer | Technology / Artifact | Role |
|---|---|---|
| Protocol & Runtime | Python & MCP | Exposes 210+ structured automation tools for AI agents |
| Office Engine API | LibreOffice UNO | Native programmatic control of Writer, Calc, and Impress |
| Packaging | .oxt Extension & MCPB Bundle |
Turnkey installation in LibreOffice and MCP agent clients |
| Source Repository | GitHub (swe-sanad/LibreOffice-MCP) |
Public open-source codebase and release packaging |
Latest Release: v0.10.2 — Full 222-Tool Surface, RTL/CTL & Calc Formula Reliability (v0.10.2)
LibreOffice MCP v0.10.2
v0.10.2 expands the MCP server from 220 to 222 tools and advertises all 222 tools directly by default, alongside targeted fixes for RTL/CTL typography, locale-safe Calc formula normalization, Calc/Writer table styling, document_lifecycle empty-state handling, and list_documents / lo_status reliability.
Overview
LibreOffice MCP bridges LibreOffice and AI assistants (Claude Desktop, Claude Code, VS Code Copilot, and any MCP client) over the native UNO API using LibreOffice's own bundled Python interpreter — requiring zero third-party Python packages (uno + Python standard library only):
- 222-Tool MCP Server (
mcp/libreoffice_mcp.py) — JSON-RPC 2.0 over stdio across 14 tool modules covering Writer, Calc, Impress, Draw, and Cross-application lifecycle, properties, recovery, and automation (embedded Basic/Python macros, windowPrintWindowscreenshots, saved-file XML inspection, anduno_exec/dispatch_unoescape hatches). - LibreOffice Extension (
claude-connector-0.10.2.oxt) — Adds an in-app Claude menu and toolbar in Calc and Writer (with a worker-thread progress dialog and DPAPI-encrypted key storage on Windows) plus the startup agent-acceptor named-pipe job so MCP clients connect flag-free to any open LibreOffice instance. - Claude Desktop Bundle (
libreoffice-connector-0.10.2.mcpb) — One-click.mcpbdesktop extension backed by a Node.js launcher (mcpb/index.js) that auto-locates LibreOffice's bundled Python across Windows, macOS, and Linux.
Tool Surface Breakdown (222 Tools — All Advertised)
| Family | Modules | Tools | Highlights |
|---|---|---|---|
| Calc | calc_analysis (16), calc_data (28), calc_format (17), calc_sheets (17) |
78 | Ranges, locale-normalized formulas, pivot tables, charts, conditional formatting, table presets, RTL sheet layout, print setup |
| Writer | writer_format (20), writer_structure (18), writer_tables (10), writer_text (21) |
69 | Index-accurate paragraph editing, inline markup, headings/TOC, captions, bookmarks, tracked changes, tables, RTL/CTL defaults |
| Cross-App | shared_lifecycle (16), shared_properties (12), shared_recovery (5), shared_automation (16) |
49 | Lifecycle phase advisor, checkpoints, crash recovery, document watch, accessible PDF/form export, Basic/Python macros, lo_screenshot, uno_exec |
| Impress | impress |
19 | Slide layouts, bullet outlines, speaker notes, tables, charts, transitions, per-object animations, slide rendering (impress_export_slides) |
| Draw | draw |
7 | Multi-page vector drawings, shapes, text boxes, images, and glued connectors |
What's Fixed in v0.10.2
- RTL/CTL font and direction handling: Fixed RTL/CTL typography and text direction behavior across Writer and Calc tools, including
writing_mode(rtl/ltr/page) and cell padding (padding_mm,padding_v_mm,padding_h_mm) incalc_format_range(6aa5e18). - Calc formula normalization: Normalized formula argument separators and ODF bracket handling across locales (
6aa5e18,a6ba47c) —_normalize_formulapreserves commas inside plain-text cells and quoted string literals, converts top-level arguments to the sheet'sarg_sep, and strips accidental[...]brackets around sheet references. document_lifecyclewith no document open: Handledno_documentstates cleanly by returning an advisory payload recommendingcreate_documentoropen_documentinstead of raising an error (6aa5e18).list_documents&lo_statusreliability: Routedlist_documentsthrough the shared_open_docs_info()helper (05255dc) and kept document titles JSON-safe inlo_statuswhen an embedded chart is open (1897fd0).- PR #17 fixes: Merged PR #17 improvements (
ad6c85d). - Offline
tools/calltests: Kepttools/callunit tests fully offline by stubbing_connect, and updatedtest_reconnect.pyforarg_sep(a6ba47c).
Added / Changed in v0.10.2
- All 222 tools advertised directly: Updated
BASIC_TOOLSinmcp/loconn/registry.pyso every registered tool is advertised directly to MCP clients without requiringdispatchdiscovery (e48f2d0). - Writer & Calc table styling and sheet setup: Added zebra/row banding and header/border color overrides (
header_bg,header_fg,zebra_bg,even_row_bg,odd_row_bg,border_color) towriter_format_tableandcalc_format_table(plusneutral/sanadpresets),sizes_mmtocalc_set_dimensions, andheader_on/footer_ontocalc_page_setup(6aa5e18). - Documentation: Regenerated
docs/MCP-TOOLS.mdfor v0.10.2 (ebbb68a,e48f2d0) and updated the project name inREADME.md(201d292).
Installation & Bundle Assets
| Asset | Target | How to Install |
|---|---|---|
libreoffice-connector-0.10.2.mcpb |
Claude Desktop | Download from the release assets below and open / drag into Claude Desktop → Settings → Extensions. |
claude-connector-0.10.2.oxt |
LibreOffice (24.8+ / min 7.2) | Install via Tools → Extension Manager → Add… (or unopkg add claude-connector-0.10.2.oxt), then restart LibreOffice. |
Usage Overview
- Automatic LibreOffice Transport (pipe → socket → auto-launch): When
.oxtis installed, the MCP server connects directly to your running LibreOffice over the localagent-acceptornamed pipe with no CLI flags. Otherwise it connects onLO_UNO_PORT(default2002) or auto-launches LibreOffice (LO_AUTOSTART=0to disable,LO_HEADLESS=1for headless). - Claude Code / Generic MCP Client:
claude mcp add libreoffice -e LO_UNO_PORT=2002 -- "C:\Program Files\LibreOffice\program\python.exe" "<repo>\mcp\libreoffice_mcp.py" - VS Code / GitHub Copilot: Open the repository workspace —
.vscode/mcp.jsonconfigures thelibreofficeMCP server automatically viamcpb/index.js. - Full Tool Reference: See
docs/MCP-TOOLS.mdandCHANGELOG.md.