LibreOffice MCP Server
Enables AI assistants to create, read, edit, and manipulate LibreOffice documents with support for track changes, comments, search/replace, and real-time document operations through a native extension or HTTP API.
README
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.
š Features
LibreOffice Extension (Plugin) - Recommended!
- 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)
- 9 Consolidated Tools: Reduced from 32 individual tools for better UX
- Track Changes Support: Full revision tracking awareness
- Multi-document: Work with all open LibreOffice documents
- HTTP API: External AI assistant access via localhost:8765
Document Operations
- Create Documents: New Writer, Calc, Impress, and Draw documents
- Read Content: Extract text with visible_content for Track Changes awareness
- Navigate: Paragraph-level navigation, cursor positioning, document outline
- Edit: Insert, format, select, and replace text
- Search: Find/replace with Track Changes awareness (skips tracked deletions)
- Comments: Add and retrieve document annotations
- Track Changes: Enable, disable, list, accept/reject revisions
š§ 9 Consolidated MCP Tools
The MCP interface provides 9 logical tool groups (consolidated from 32 individual tools):
| Tool | Actions | Description |
|---|---|---|
document |
create, info, list, content, status | Document management |
structure |
outline, paragraph, range, count | Document navigation |
cursor |
goto_paragraph, goto_position, position, context | Cursor control |
selection |
paragraph, range, delete, replace | Text selection |
search |
find, replace, replace_all | Search/replace (Track Changes aware) |
track_changes |
status, enable, disable, list, accept, reject, accept_all, reject_all | Revision tracking |
comments |
list, add | Comment management |
save |
save, export | Save/export documents |
text |
insert, format | Text insertion and formatting |
See docs/TOOL_REFERENCE.md for complete documentation.
š Requirements
- LibreOffice: 24.2+ (must be accessible via command line)
- Python: 3.12+
- UV Package Manager: For dependency management
š Installation
LibreOffice Extension (Recommended)
# Clone the repository
git clone https://github.com/jwingnut/mcp-libre.git
cd mcp-libre
# Build and install the LibreOffice extension
cd plugin/
./build.sh
unopkg add ../build/libreoffice-mcp-extension-1.0.0.oxt
# Restart LibreOffice
After installation:
- Open LibreOffice Writer
- Go to Tools > MCP Server > Start MCP Server
- The HTTP API is now available at
http://localhost:8765
FastMCP Bridge (for Claude Code)
# Install FastMCP
pip install fastmcp httpx
# Configure Claude Code
claude mcp add libreoffice -- fastmcp run /path/to/libreoffice_mcp_server.py
šÆ Quick Start
Using with Claude Code
Once configured, you can use natural language commands:
"Get document info"
ā document(action="info")
"Find all occurrences of 'hello'"
ā search(action="find", query="hello")
"Enable track changes"
ā track_changes(action="enable")
"Go to paragraph 5 and get context"
ā cursor(action="goto_paragraph", n=5)
ā cursor(action="context")
HTTP API Examples
# Check server status
curl http://localhost:8765/health
# Get document info
curl -X POST http://localhost:8765/tools/get_document_info_live -d '{}'
# Find text
curl -X POST http://localhost:8765/tools/find_text_live \
-H "Content-Type: application/json" \
-d '{"query": "hello"}'
# Enable Track Changes
curl -X POST http://localhost:8765/tools/set_track_changes_live \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
š Repository Structure
mcp-libre/
āāā plugin/ # LibreOffice extension
ā āāā pythonpath/
ā ā āāā uno_bridge.py # UNO API wrapper
ā ā āāā mcp_server.py # HTTP API server
ā āāā build.sh # Build script
ā āāā README.md # Plugin documentation
āāā libreoffice_mcp_server.py # FastMCP bridge (9 consolidated tools)
āāā docs/
ā āāā TOOL_REFERENCE.md # Complete tool documentation
ā āāā KNOWN_ISSUES_AND_ROADMAP.md
āāā src/ # Legacy external server
āāā tests/ # Test suite
āāā README.md
š Documentation
- Tool Reference: Complete documentation of all 9 tools
- Plugin README: LibreOffice extension details
- Known Issues & Roadmap: Future plans
š Recent Changes
v0.3.0 - Tool Consolidation
- Consolidated 32 tools into 9 logical groups
- Reduced permission prompts for better UX
- Each tool uses
actionparameter for routing
v0.2.0 - Track Changes Awareness
- Added 7 Track Changes management tools
- Search/replace now skips tracked deletions
get_paragraphreturnsvisible_contentfieldfind_textreturnstrack_changes_activefield
v0.1.0 - Initial Release
- 25 individual MCP tools
- HTTP API on localhost:8765
- LibreOffice extension with UNO API integration
š” Security
- Local Execution: All operations run locally
- File Permissions: Limited to user's file access
- No Network: No external network dependencies
- Email Privacy: Uses GitHub noreply email for commits
š¤ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Links
- Repository: https://github.com/jwingnut/mcp-libre
- MCP Specification: https://spec.modelcontextprotocol.io/
- LibreOffice: https://www.libreoffice.org/
- FastMCP: https://github.com/modelcontextprotocol/python-sdk
LibreOffice MCP Server v0.3.0 - AI-Powered Document Editing
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.