FastMCP server that provides Claude Code with tools to control LibreOffice Writer through an HTTP API bridge.
Claude Code (Ubuntu VM)
│
└── LibreOffice MCP Server (this)
│
│ HTTP requests (localhost:8765)
▼
LibreOffice Writer
│
└── MCP Extension (HTTP API)
FastMCP server providing 9 consolidated tools for document manipulation:
| Tool | Actions | Description |
|---|---|---|
document |
create, info, list, content, status | Document management |
structure |
outline, paragraph, range, count | Navigate document structure |
cursor |
goto_paragraph, goto_position, position, context | Cursor navigation |
selection |
paragraph, range, delete, replace | Text selection and manipulation |
search |
find, replace, replace_all | Find and 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 and export documents |
text |
insert, format | Insert and format text |
LibreOffice extension that provides an HTTP API on port 8765 for the MCP server to connect to.
# Install via LibreOffice
unopkg add libreoffice-mcp-extension.oxtOr: Tools → Extension Manager → Add → Select the .oxt file
uv venv
source .venv/bin/activate
uv pip install fastmcp httpxAdd to .mcp.json:
{
"mcpServers": {
"libreoffice": {
"command": "/home/vboxuser/projects/libreoffice-mcp/run_libreoffice_mcp.sh",
"args": []
}
}
}- Start LibreOffice Writer
- Start the MCP Server in LibreOffice: Tools → MCP Server → Start MCP Server
- Use Claude Code with LibreOffice tools
# 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")This MCP server works alongside the Zotero MCP server for a complete academic writing workflow:
- LibreOffice MCP - Document editing and formatting
- Zotero MCP - Citation management with scannable cite markers
- Zotero ODF Plugin - Converts markers to live citations
libreoffice_mcp_server.py- MCP server (FastMCP)libreoffice-mcp-extension.oxt- LibreOffice extensionrun_libreoffice_mcp.sh- Wrapper script for Claude Code