Enables programmatic creation, reading, editing, and conversion of LibreOffice documents (Writer, Calc, Impress, Draw) with support for 50+ formats including PDF, DOCX, and HTML. Provides real-time document manipulation, spreadsheet data extraction, document merging, and live viewing capabilities through both an external server and native LibreOffice extension.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LibreOffice MCP Serverconvert my report.docx to PDF and email it to me"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LibreOffice MCP Server
A comprehensive Model Context Protocol (MCP) server that provides tools and resources for interacting with LibreOffice documents. This server enables AI assistants and other MCP clients to create, read, convert, and manipulate LibreOffice documents programmatically.
๐ Repository Structure
This repository is organized into logical directories:
src/- Core MCP server implementationtests/- Test suite and validation scriptsexamples/- Demo scripts and usage examplesconfig/- Configuration templates for integrationsscripts/- Utility scripts for setup and managementdocs/- Comprehensive documentation
For detailed information, see docs/REPOSITORY_STRUCTURE.md.
๐ Features
LibreOffice Extension (Plugin) - NEW! ๐
Native Integration: Embedded MCP server directly in LibreOffice
Real-time Editing: Live document manipulation with instant visual feedback
Performance: 10x faster than external server (direct UNO API access)
Multi-document: Work with all open LibreOffice documents
Auto-start: Automatically available when LibreOffice starts
HTTP API: External AI assistant access via localhost:8765
Document Operations
Create Documents: New Writer, Calc, Impress, and Draw documents
Read Content: Extract text from any LibreOffice document
Convert Formats: Convert between 50+ formats (PDF, DOCX, HTML, etc.)
Edit Documents: Insert, append, or replace text in Writer documents
Document Info: Get detailed metadata about documents
Spreadsheet Operations
Read Spreadsheets: Extract data from Calc spreadsheets and Excel files
Structured Data: Get data as 2D arrays with row/column information
Advanced Tools
Document Search: Find documents containing specific text
Batch Convert: Convert multiple documents simultaneously
Merge Documents: Combine multiple documents into one
Document Analysis: Get detailed statistics (word count, sentences, etc.)
Live Viewing & Real-time Editing
GUI Integration: Open documents in LibreOffice for live viewing
Real-time Updates: See changes as AI assistants modify documents
Change Monitoring: Watch documents for modifications in real-time
Interactive Sessions: Create live editing sessions with automatic refresh
MCP Resources
Document Discovery: List all LibreOffice documents (
documents://)Content Access: Access specific document content (
document://{path})
๐ Requirements
LibreOffice: 24.2+ (must be accessible via command line)
Python: 3.12+
UV Package Manager: For dependency management
For detailed installation instructions for all platforms, run:
๐ Installation
Clone the repository:
git clone https://github.com/patrup/mcp-libre/ cd mcp-libreCheck prerequisites:
./mcp-helper.sh requirements # Show detailed requirements ./mcp-helper.sh check # Verify your systemInstall dependencies:
uv syncMake helper script executable:
chmod +x mcp-helper.sh
๐ฏ Quick Start
Test the Server
Start MCP Server
Integration with Super Assistant
๐ง Available Tools
Tool | Description |
| Create new LibreOffice documents |
| Extract text from documents |
| Convert between formats |
| Get document metadata |
| Read spreadsheet data |
| Edit document text |
| Search documents by content |
| Batch format conversion |
| Merge multiple documents |
| Document analysis |
| Open document in GUI for live viewing |
| Start live editing with real-time preview |
| Monitor document changes in real-time |
| Force document refresh in GUI |
๐ Documentation
Prerequisites: Quick reference for system requirements
Plugin Migration Guide: Migrate from external server to plugin
Examples: Code examples and usage patterns
Live Viewing Guide: See changes live in LibreOffice GUI
Super Assistant Setup: Chrome extension integration
ChatGPT Browser Guide: Using with ChatGPT and alternatives
Troubleshooting: Common issues and solutions
Quick Start: Quick reference guide
Complete Solution: Comprehensive overview
๐ Integration Options
1. LibreOffice Extension (NEW - Recommended!) ๐
The most powerful and efficient way to use the MCP server:
Benefits of the Extension:
10x Performance: Direct UNO API access (no subprocess overhead)
Real-time Editing: Live document manipulation in open LibreOffice windows
Native Integration: Appears in LibreOffice Tools menu
Multi-document Support: Work with all open documents simultaneously
Auto-start: Automatically starts with LibreOffice
Advanced Features: Full access to LibreOffice formatting and capabilities
Usage:
The extension provides an HTTP API on
http://localhost:8765Configure your AI assistant to use this endpoint
Access controls via Tools > MCP Server in LibreOffice
Real-time document editing with instant visual feedback
For detailed plugin information, see plugin/README.md.
2. Claude Desktop
Generate configuration automatically:
Then restart Claude Desktop and start using LibreOffice commands:
"Create a new Writer document and save it as project-report.odt"
"Convert my document to PDF format"
3. Super Assistant Chrome Extension
Generate configuration and start proxy:
4. Direct MCP Client
๐จ Usage Examples
Natural Language (via Super Assistant)
"Create a new Writer document with a project report"
"Convert my ODT file to PDF format"
"Search for documents containing 'budget' in my Documents folder"
"Get statistics for my essay - how many words?"
Programmatic Usage
๐ Supported File Formats
Input (Reading)
LibreOffice:
.odt,.ods,.odp,.odgMicrosoft Office:
.doc,.docx,.xls,.xlsx,.ppt,.pptxText:
.txt,.rtf
Output (Conversion)
PDF:
.pdfMicrosoft Office:
.docx,.xlsx,.pptxWeb:
.html,.htmText:
.txtLibreOffice:
.odt,.ods,.odp,.odgMany others: 50+ formats supported by LibreOffice
๐งช Testing
LibreOffice Extension Testing
External Server Testing
๐ง Configuration
MCP Configuration for Integrations
Generate personalized configuration files for Claude Desktop and/or Super Assistant:
This automatically creates configurations with your actual project paths:
Claude Desktop:
~/.config/claude/claude_desktop_config.jsonSuper Assistant:
~/Documents/mcp/mcp.config.json(or custom location)
Environment Variables
Custom Search Paths
Edit libremcp.py to modify document discovery locations:
๐ก Security
Local Execution: All operations run locally
File Permissions: Limited to user's file access
No Network: No external network dependencies
Temporary Files: Automatically cleaned up
๐จ Troubleshooting
LibreOffice Issues
Java Warnings
Java warnings are usually non-fatal
Core functionality works without Java
Install Java for full LibreOffice features
Permission Errors
Check file and directory permissions
Ensure LibreOffice can access document paths
Verify write permissions for output directories
๐ค Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
The MIT License is a permissive license that allows:
โ Commercial use
โ Modification
โ Distribution
โ Private use
For other license options, see LICENSE_OPTIONS.md.
๐ Links
MCP Specification: https://spec.modelcontextprotocol.io/
LibreOffice: https://www.libreoffice.org/
FastMCP Framework: https://github.com/modelcontextprotocol/python-sdk
๐ Support
Issues: Use GitHub issues for bug reports
Documentation: See the
docs/folder for detailed guidesExamples: Check
EXAMPLES.mdfor usage patterns
LibreOffice MCP Server v0.1.0 - Bridging AI and Document Processing