- Home
- MCP servers
- LibreOffice
LibreOffice
- python
14
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can use the LibreOffice MCP Server to programmatically create, read, convert, and edit LibreOffice documents through MCP clients. It provides a direct bridge between AI assistants and LibreOffice, enabling live editing, multi-document workflows, and convenient document operations from code.
How to use
To use the MCP server, start it in your preferred mode and connect your MCP client to the provided endpoints. You can run it in standard MCP mode for local, inline operation or start it via the UV runtime for enhanced management. Once running, you can create documents, read text, convert formats, search content, and perform live edits from your client by calling the available endpoints.
How to install
Follow these concrete steps to set up the LibreOffice MCP Server on your system.
# 1) Clone the project
git clone https://github.com/patrup/mcp-libre/
cd mcp-libre
# 2) Check prerequisites
./mcp-helper.sh requirements
./mcp-helper.sh check
# 3) Install dependencies
uv sync
# 4) Make helper script executable
chmod +x mcp-helper.sh
Configuration and startup options
You have two primary ways to run the MCP server, depending on whether you prefer a standard stdio workflow or a managed UV-based run. The stdio approach starts the server directly in the current process, while the UV approach uses the UV runtime to manage execution.
# Start in standard MCP mode (stdio)
python src/main.py
# Or start using UV for better management
uv run python src/main.py
API endpoints and live integration
Integrate with client applications through the built-in HTTP API exposed by the LibreOffice extension. The extension provides an HTTP API at the endpoint http://localhost:8765 for external AI assistants to interact with open LibreOffice documents in real time.
Troubleshooting and notes
If you encounter issues, verify your LibreOffice installation and the ability to execute headless conversions. Common checks include ensuring the correct LibreOffice version is installed, validating the path to LibreOffice, and confirming file permissions for input and output directories.
Examples and usage patterns
Use the MCP client to call tools such as creating documents, reading text, converting formats, and monitoring live edits. Refer to the available tools for a complete list of operations you can perform against LibreOffice documents.
Available tools
create_document
Create new LibreOffice documents (Writer, Calc, Impress, Draw) with initial content.
read_document_text
Extract visible text from documents, enabling content ingestion by AI assistants.
convert_document
Convert documents between formats (e.g., PDF, DOCX, HTML) while preserving content structure.
get_document_info
Obtain metadata and document properties for management and auditing.
read_spreadsheet_data
Read data from Calc spreadsheets and Excel files as structured data.
insert_text_at_position
Edit documents by inserting or replacing text at a specified location.
search_documents
Search documents by content to locate relevant files quickly.
batch_convert_documents
Convert multiple documents in a single operation to save time.
merge_text_documents
Combine several documents into a single consolidated document.
get_document_statistics
Generate statistics such as word count and sentence count for documents.
open_document_in_libreoffice
Open a document in the LibreOffice GUI for live viewing and interaction.
create_live_editing_session
Start a live editing session with real-time preview as changes are made.
watch_document_changes
Monitor documents for changes and reflect updates in real time.
refresh_document_in_libreoffice
Force a refresh of the document in the LibreOffice GUI to reflect edits.