Skip to main content

LibreOffice MCP Server

A Model Context Protocol (MCP) server that gives agentic coding tools programmatic control over presentations (pptx), documents (docx), and spreadsheets (xlsx) — plus PDF export via LibreOffice headless mode.

Works with any MCP-compatible agent: Claude Code, Codex, OpenCode, Pi Agent, Cursor, Windsurf, etc.


Tools Overview

Presentations (presentation_*)

Tool Description
presentation_create Create a new .pptx with configurable dimensions
presentation_add_slide Add a slide (title / title_and_content / blank / title_only)
presentation_set_title Set a slide's title text
presentation_add_bullets Add bullet points to a slide
presentation_add_table Add a styled data table to a slide
presentation_add_image Add an image to a slide
presentation_export_pdf Convert .pptx → .pdf via LibreOffice
presentation_info Get slide count, dimensions, titles

Documents (document_*)

Tool Description
document_create Create a new .docx
document_add_heading Add a heading at any level
document_add_paragraph Add formatted paragraph text
document_add_table Add a table with headers + rows

Spreadsheets (spreadsheet_*)

Tool Description
spreadsheet_create Create a new .xlsx
spreadsheet_add_sheet Add a worksheet
spreadsheet_set_cell Write a value to a cell
spreadsheet_add_chart Add a bar / column / line / pie chart

Prerequisites

  • Python 3.10+
  • LibreOffice (for PDF export — soffice on PATH)
  • pip or uv

Install LibreOffice:

# macOS
brew install --cask libreoffice

# Ubuntu/Debian
sudo apt install libreoffice

# Fedora
sudo dnf install libreoffice

Installation

Option A: pip

pip install libreoffice-mcp

Option B: uv

uv pip install libreoffice-mcp

This installs the libreoffice-mcp CLI entrypoint.


Agent Configuration (Tested Locally)

Claude Code

Add to ~/.claude/mcp.json:

{
  "mcpServers": {
    "libreoffice": {
      "command": "libreoffice-mcp"
    }
  }
}

If libreoffice-mcp is not on your PATH, use the full path to the binary (e.g. ~/.local/bin/libreoffice-mcp or your venv path).

Restart Claude Code with Ctrl+Shift+P → "Restart Claude Code Server".

OpenCode

Add under mcpServers in ~/.config/opencode/opencode.jsonc:

    "libreoffice": {
      "type": "local",
      "command": ["libreoffice-mcp"],
      "enabled": true
    }

Use the full binary path if it's not on your PATH.

Restart OpenCode.

Hermes Agent

Add under mcp_servers in ~/.hermes/config.yaml:

  libreoffice:
    command: libreoffice-mcp
    enabled: true

Use the full binary path if needed.


Quickstart Example

Create a presentation with 3 slides programmatically:

# Agent calls these via MCP tools

1. presentation_create {"output_path": "/tmp/deck.pptx"}
2. presentation_set_title  {"file_path": "/tmp/deck.pptx", "slide_index": 0, "title": "Quarterly Review"}
3. presentation_add_bullets {"file_path": "/tmp/deck.pptx", "slide_index": 0, "bullets": ["Revenue +24%", "8 releases shipped", "1.2M users"]}
4. presentation_add_slide {"file_path": "/tmp/deck.pptx", "layout": "title_and_content"}
5. presentation_set_title {"file_path": "/tmp/deck.pptx", "slide_index": 1, "title": "Roadmap"}
6. presentation_add_bullets {"file_path": "/tmp/deck.pptx", "slide_index": 1, "bullets": ["Q3: Foundation", "Q4: Acceleration", "Q1: Scale"]}
7. presentation_export_pdf {"file_path": "/tmp/deck.pptx"}

Project Structure

libreoffice-mcp/
├── pyproject.toml
├── README.md
└── libreoffice_mcp/
    ├── __init__.py
    ├── server.py          # MCP stdio server + tool dispatch
    ├── presentation.py    # pptx operations (python-pptx)
    ├── document.py        # docx operations (python-docx)
    ├── spreadsheet.py     # xlsx operations (openpyxl)
    └── utils.py           # Path helpers

Troubleshooting

soffice not found when exporting PDF

Make sure LibreOffice is installed and soffice is on your PATH:

which soffice
soffice --version

On macOS, Homebrew sometimes links it as /opt/homebrew/bin/soffice. Ensure your shell PATH includes this.

MCP tools not appearing

  • Check the agent's MCP server logs for connection errors.
  • Verify libreoffice-mcp runs standalone: echo '{}' | libreoffice-mcp
  • Ensure Python dependencies are installed: pip install python-pptx openpyxl python-docx mcp

License

MIT

Template Tools (Human-Grade Output)

For professional, styled output without manual formatting:

Tool Description Best For
template_executive_presentation 5-slide corporate deck with hero, metrics, financials, roadmap Board decks, quarterly reviews
template_proposal_document Multi-page doc with title page, sections, budget table Client proposals, SOWs
template_financial_spreadsheet Styled Excel with formulas, margins, embedded chart Monthly/quarterly reports

These templates produce navy/orange color scheme, 16:9 widescreen, and professional typography — no manual tweaking needed.

Release files for libreoffice-mcp 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libreoffice-mcp 0.2.1
File Size Uploaded
libreoffice_mcp-0.2.1.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libreoffice-mcp 0.2.1
File Interpreter ABI Platform
libreoffice_mcp-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / libreoffice_mcp-0.2.1.tar.gz

Download URL libreoffice_mcp-0.2.1.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f0978f28acb478e64cb5a8482d1ad9134c0ce52d205a8954ddc7fa786fa14ed9
BLAKE2b-256 checksum
How to use checksums
6d7c74df048a14b6c1912f7cba5a736c1591e60afd67a2c264ad30de294d1747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release files / libreoffice_mcp-0.2.1-py3-none-any.whl

Download URL libreoffice_mcp-0.2.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abb3557e18cb1b8da901846865a4b19649924425b8c83da53b49d78d5b26b77b
BLAKE2b-256 checksum
How to use checksums
390e54203e9aed2281c17dbae8d1b5f131e47a5eb0154297698321c38f726b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page