LibreOffice MCP Tools
This server provides 22 MCP tools for AI agents to read, write, and manipulate Office documents (DOCX, XLSX, PPTX, legacy formats, PDF) with a token-efficient design.
Document Management
Open documents across 13+ formats (DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, RTF, CSV, TXT, PDF), receiving a
docIdhandleClose, list, create (Writer/Calc/Impress), save, export (PDF, HTML, CSV, etc.), and convert documents between formats
Token-Efficient Reading
Metadata: title, author, word/page count, file size, dates
Outline: headings (Writer), sheet names (Calc), slide titles (Impress)
Text: paginated Markdown output with character/item limits
Range: specific paragraph or slide index ranges
Search: find text with surrounding context
Writer Editing
Insert text at start, end, or after a specific heading
Replace text (first or all occurrences, case-insensitive option)
Insert paragraphs at a specific index
Apply heading/paragraph styles to paragraphs by index
Calc (Spreadsheet) Editing
List sheets with row/column counts
Read cell ranges as JSON and/or Markdown table
Set single cells or ranges (2D array), add sheets with optional headers
Retrieve formula expressions from a range
Impress (Presentation) Editing
List slides with index and title
Get full slide content (title, body, speaker notes)
Retrieve speaker notes for all or specific slides
Add new slides or update existing title/body text
Format Support
Native parsing/writing for DOCX, XLSX, PPTX, CSV, TXT
Legacy and OpenDocument formats (DOC, XLS, PPT, ODT, ODS, ODP, RTF) via LibreOffice bridge
PDF text reading and export
LibreOffice is optional for basic modern-format reads but required for legacy formats, PDF export, and conversions
Provides tools for reading, writing, and editing Office documents via LibreOffice, including document management, text manipulation, spreadsheet operations, and presentation editing across multiple file formats.
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 Toolsopen the quarterly report.docx and show me the headings"
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 Tools
This project waswritten by GitHub Copilot and has not been fully reviewed by a human. Code may contain bugs, security issues, or unexpected behavior. Use at your own risk. Do not use in production without thorough review.
A Model Context Protocol (MCP) server that gives AI agents (Claude, Copilot, Gemini, Cursor, etc.) the ability to read, write, and edit Office documents via LibreOffice — with a token-efficient design that minimizes LLM context usage.
Inspired by the architecture of chrome-devtools-mcp.
✨ Features
22 MCP tools covering reading, writing, spreadsheets, and presentations
Token-efficient design: outline-first navigation, range-based access, pagination
Broad format support: DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, RTF, CSV, TXT, PDF
Legacy format bridge:
.doc,.xls,.pptauto-converted via LibreOffice before parsingNo LibreOffice required for basic reads: native parsers handle DOCX, XLSX, PPTX directly
LibreOffice required for: legacy formats, PDF export, format conversion
Related MCP server: Spire.Doc MCP Server
📋 Supported Formats
Format | Extensions | Read | Write | Method |
Word 2007+ |
| ✅ | ✅ | Native (mammoth read / JSZip OOXML write) |
Word 97-2003 |
| ✅ | ✅ | LibreOffice bridge |
Excel 2007+ |
| ✅ | ✅ | Native (ExcelJS) |
Excel 97-2003 |
| ✅ | ✅ | LibreOffice bridge |
PowerPoint 2007+ |
| ✅ | ✅ | Native (JSZip OOXML) |
PowerPoint 97-2003 |
| ✅ | ✅ | LibreOffice bridge |
OpenDocument Text |
| ✅ | ✅ | LibreOffice bridge |
OpenDocument Spreadsheet |
| ✅ | ✅ | LibreOffice bridge |
OpenDocument Presentation |
| ✅ | ✅ | LibreOffice bridge |
Rich Text Format |
| ✅ | ✅ | LibreOffice bridge |
CSV |
| ✅ | ✅ | Native |
| ✅ (text) | ❌ | LibreOffice CLI | |
Plain text |
| ✅ | ✅ | Native |
🚀 Quick Start
Prerequisites
Node.js 20+
LibreOffice (optional for basic DOCX/XLSX/PPTX reads; required for .doc/.xls/.ppt and format conversion)
Windows: Download LibreOffice
macOS:
brew install --cask libreofficeLinux:
sudo apt install libreofficeorsudo dnf install libreoffice
Installation
Using npx (recommended — no install needed):
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"]
}
}
}Global install:
npm install -g @passerbyflutter/libreoffice-mcp-toolsFrom source:
git clone https://github.com/passerbyflutter/libreoffice-mcp-tools
cd libreoffice-mcp-tools
npm install
npm run buildConfigure your MCP client
Add to your MCP client configuration (e.g., Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"],
"env": {
"SOFFICE_PATH": "/path/to/soffice"
}
}
}
}Or use .mcp.json at your project root:
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"]
}
}
}CLI Options
node build/bin/libreoffice-mcp.js [options]
--libreoffice-path <path> Path to soffice executable
(default: auto-detected or SOFFICE_PATH env)🛠 Tool Reference
Document Management
Tool | Description |
| Open a file → returns |
| Release document handle and temp files |
| List all open documents |
| Create new empty document (writer/calc/impress) |
| Save to current or new path |
| Export via LibreOffice (PDF, HTML, CSV, etc.) |
| Convert file format (DOC→DOCX, XLSX→CSV, etc.) |
Reading (Token-Efficient)
Tool | Description |
| Title, author, word/page count, dates |
| Headings (Writer) / sheet names (Calc) / slide titles (Impress) |
| Paginated document text as Markdown |
| Specific paragraph or slide range |
| Find text with surrounding context |
Writing (Writer)
Tool | Description |
| Insert at start/end/after heading |
| Find & replace (first or all occurrences) |
| Insert paragraph at specific index |
| Apply heading/paragraph style |
Spreadsheet (Calc)
Tool | Description |
| Sheet names with row/col counts |
| Cell range as JSON + markdown table |
| Set cell value or formula |
| Set 2D range of values |
| Add new sheet |
| Get formula expressions in range |
Presentation (Impress)
Tool | Description |
| Slide titles with index |
| Full slide content (title, body, notes) |
| Speaker notes |
| Add new slide (requires LibreOffice) |
| Update slide content |
💡 Token-Saving Workflow
For maximum token efficiency, follow this pattern:
1. document_open(filePath) → get docId
2. document_get_metadata(docId) → understand size/type
3. document_get_outline(docId) → see structure
4. document_read_range(docId, startIndex=N, endIndex=M) → read specific sectionInstead of dumping the entire document, you navigate to exactly what you need.
Spreadsheet workflow:
1. document_open(path) → docId
2. spreadsheet_list_sheets(docId) → see all sheets
3. spreadsheet_get_range(docId, sheetName="Sales", range="A1:D20") → targeted data🏗 Architecture
src/
├── index.ts # createMcpServer() — MCP server factory
├── LibreOfficeAdapter.ts # soffice subprocess manager
├── DocumentContext.ts # Open document registry
├── DocumentSession.ts # Per-document state + format bridge
├── McpResponse.ts # Response builder (text/JSON/markdown)
├── Mutex.ts # Serializes LibreOffice subprocess calls
├── parsers/
│ ├── DocxParser.ts # DOCX read → {paragraphs, outline, metadata} (mammoth)
│ ├── DocxOoxmlEditor.ts # DOCX write → direct JSZip OOXML manipulation (format-preserving)
│ ├── XlsxParser.ts # XLSX read/write via ExcelJS
│ ├── PptxParser.ts # PPTX read → {slides[]} (JSZip XML)
│ └── PptxOoxmlEditor.ts # PPTX write → add/update slides, create PPTX (JSZip OOXML)
├── formatters/
│ ├── MarkdownFormatter.ts
│ ├── JsonFormatter.ts
│ └── TableFormatter.ts # Spreadsheet → Markdown table
└── tools/
├── documents.ts # open/close/list/create
├── reader.ts # metadata/outline/read/search
├── writer.ts # insert/replace/style
├── spreadsheet.ts # get/set cells/ranges/sheets
├── presentation.ts # slides/notes
└── converter.ts # save/export/convert🧪 Testing
# Create sample fixtures
node tests/create-fixtures.mjs
# Run smoke tests
npm test📝 Environment Variables
Variable | Description |
| Path to LibreOffice |
| Set to |
📄 License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables 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.Last updated9MIT
- Alicense-qualityFmaintenanceEnables AI agents to create, read, modify, and convert Word documents without Microsoft Word, supporting 18 tools for document operations, paragraph manipulation, table management, formatting, and conversion between multiple formats including PDF, HTML, and Markdown.Last updated6MIT
- AlicenseAqualityFmaintenanceEnables AI assistants to create, read, convert, and manipulate LibreOffice documents programmatically, supporting 50+ file formats including Writer, Calc, Impress documents with real-time editing, batch operations, and document analysis capabilities.Last updated1492MIT
- Alicense-qualityCmaintenanceEnables AI agents to read, edit, and create Microsoft Word documents (.docx) with support for rich text, tables, and images, deployable locally or via SSE.Last updated3MIT
Related MCP Connectors
Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.
AI document editing for agents: draft, edit, export .docx/PDF. 37 MCP tools; agent self-signup.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/passerbyflutter/libreoffice-mcp-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server