libreoffice-mcp-ubuntu

jwingnut/libreoffice-mcp-ubuntu

3.2

If you are the rightful owner of libreoffice-mcp-ubuntu and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The LibreOffice MCP Server is a FastMCP server that allows Claude Code to control LibreOffice Writer through an HTTP API bridge.

Tools
9
Resources
0
Prompts
0

LibreOffice MCP Server (Ubuntu)

FastMCP server that provides Claude Code with tools to control LibreOffice Writer through an HTTP API bridge.

Architecture

Claude Code (Ubuntu VM)
    │
    └── LibreOffice MCP Server (this)
            │
            │ HTTP requests (localhost:8765)
            ▼
        LibreOffice Writer
            │
            └── MCP Extension (HTTP API)

Components

1. MCP Server (libreoffice_mcp_server.py)

FastMCP server providing 9 consolidated tools for document manipulation:

ToolActionsDescription
documentcreate, info, list, content, statusDocument management
structureoutline, paragraph, range, countNavigate document structure
cursorgoto_paragraph, goto_position, position, contextCursor navigation
selectionparagraph, range, delete, replaceText selection and manipulation
searchfind, replace, replace_allFind and replace (Track Changes aware)
track_changesstatus, enable, disable, list, accept, reject, accept_all, reject_allRevision tracking
commentslist, addComment management
savesave, exportSave and export documents
textinsert, formatInsert and format text

2. LibreOffice Extension (libreoffice-mcp-extension.oxt)

LibreOffice extension that provides an HTTP API on port 8765 for the MCP server to connect to.

Setup

1. Install the LibreOffice Extension

# Install via LibreOffice
unopkg add libreoffice-mcp-extension.oxt

Or: Tools → Extension Manager → Add → Select the .oxt file

2. Create Virtual Environment

uv venv
source .venv/bin/activate
uv pip install fastmcp httpx

3. Configure Claude Code

Add to .mcp.json:

{
  "mcpServers": {
    "libreoffice": {
      "command": "/home/vboxuser/projects/libreoffice-mcp/run_libreoffice_mcp.sh",
      "args": []
    }
  }
}

Usage

  1. Start LibreOffice Writer
  2. Start the MCP Server in LibreOffice: Tools → MCP Server → Start MCP Server
  3. Use Claude Code with LibreOffice tools

Example Commands

# Check connection
document(action="status")

# Create new document
document(action="create", doc_type="writer")

# Get document content
document(action="content")

# Insert text at cursor
text(action="insert", content="Hello, World!")

# Find and replace
search(action="replace_all", old="foo", new="bar")

# Enable track changes
track_changes(action="enable")

# Save document
save(action="save", file_path="/path/to/document.odt")

Integration with Zotero

This MCP server works alongside the Zotero MCP server for a complete academic writing workflow:

  1. LibreOffice MCP - Document editing and formatting
  2. Zotero MCP - Citation management with scannable cite markers
  3. Zotero ODF Plugin - Converts markers to live citations

Files

  • libreoffice_mcp_server.py - MCP server (FastMCP)
  • libreoffice-mcp-extension.oxt - LibreOffice extension
  • run_libreoffice_mcp.sh - Wrapper script for Claude Code