LibreOffice MCP Tools
LibreOffice MCP Tools
[!WARNING] このプロジェクトは GitHub Copilot によって作成 されており、人間による完全なレビューは行われていません。 コードにはバグ、セキュリティ上の問題、または予期しない動作が含まれている可能性があります。自己責任で使用してください。 十分なレビューなしに本番環境で使用しないでください。
Model Context Protocol (MCP) サーバーであり、AIエージェント(Claude、Copilot、Gemini、Cursorなど)がLibreOfficeを介して Officeドキュメントを読み取り、書き込み、編集 する機能を提供します。LLMのコンテキスト使用量を最小限に抑える、トークン効率に優れた設計になっています。
chrome-devtools-mcp のアーキテクチャに触発されています。
✨ 特徴
22種類のMCPツール: 読み取り、書き込み、スプレッドシート、プレゼンテーションをカバー
トークン効率に優れた設計: アウトライン優先のナビゲーション、範囲ベースのアクセス、ページネーション
幅広いフォーマットサポート: DOCX, DOC, XLSX, XLS, PPTX, PPT, ODT, ODS, ODP, RTF, CSV, TXT, PDF
レガシーフォーマットブリッジ:
.doc,.xls,.pptはLibreOfficeを介して解析前に自動変換基本的な読み取りにはLibreOffice不要: ネイティブパーサーがDOCX, XLSX, PPTXを直接処理
LibreOfficeが必要なケース: レガシーフォーマット、PDFエクスポート、フォーマット変換
Related MCP server: Spire.Doc MCP Server
📋 サポートされているフォーマット
フォーマット | 拡張子 | 読み取り | 書き込み | メソッド |
Word 2007+ |
| ✅ | ✅ | ネイティブ (mammoth read / JSZip OOXML write) |
Word 97-2003 |
| ✅ | ✅ | LibreOfficeブリッジ |
Excel 2007+ |
| ✅ | ✅ | ネイティブ (ExcelJS) |
Excel 97-2003 |
| ✅ | ✅ | LibreOfficeブリッジ |
PowerPoint 2007+ |
| ✅ | ✅ | ネイティブ (JSZip OOXML) |
PowerPoint 97-2003 |
| ✅ | ✅ | LibreOfficeブリッジ |
OpenDocument Text |
| ✅ | ✅ | LibreOfficeブリッジ |
OpenDocument Spreadsheet |
| ✅ | ✅ | LibreOfficeブリッジ |
OpenDocument Presentation |
| ✅ | ✅ | LibreOfficeブリッジ |
Rich Text Format |
| ✅ | ✅ | LibreOfficeブリッジ |
CSV |
| ✅ | ✅ | ネイティブ |
| ✅ (テキスト) | ❌ | LibreOffice CLI | |
プレーンテキスト |
| ✅ | ✅ | ネイティブ |
🚀 クイックスタート
前提条件
Node.js 20+
LibreOffice (基本的なDOCX/XLSX/PPTXの読み取りにはオプション; .doc/.xls/.pptおよびフォーマット変換には必須)
Windows: LibreOfficeをダウンロード
macOS:
brew install --cask libreofficeLinux:
sudo apt install libreofficeまたはsudo dnf install libreoffice
インストール
npxを使用する場合(推奨 — インストール不要):
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"]
}
}
}グローバルインストール:
npm install -g @passerbyflutter/libreoffice-mcp-toolsソースからインストール:
git clone https://github.com/passerbyflutter/libreoffice-mcp-tools
cd libreoffice-mcp-tools
npm install
npm run buildMCPクライアントの設定
MCPクライアントの設定(例: Claude Desktopの claude_desktop_config.json)に追加します:
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"],
"env": {
"SOFFICE_PATH": "/path/to/soffice"
}
}
}
}または、プロジェクトルートの .mcp.json を使用します:
{
"mcpServers": {
"libreoffice": {
"command": "npx",
"args": ["-y", "@passerbyflutter/libreoffice-mcp-tools"]
}
}
}CLIオプション
node build/bin/libreoffice-mcp.js [options]
--libreoffice-path <path> Path to soffice executable
(default: auto-detected or SOFFICE_PATH env)🛠 ツールリファレンス
ドキュメント管理
ツール | 説明 |
| ファイルを開く → |
| ドキュメントハンドルと一時ファイルを解放 |
| 開いているすべてのドキュメントを一覧表示 |
| 新しい空のドキュメントを作成 (Writer/Calc/Impress) |
| 現在または新しいパスに保存 |
| LibreOfficeを介してエクスポート (PDF, HTML, CSVなど) |
| ファイルフォーマットを変換 (DOC→DOCX, XLSX→CSVなど) |
読み取り (トークン効率重視)
ツール | 説明 |
| タイトル、作成者、単語数/ページ数、日付 |
| 見出し (Writer) / シート名 (Calc) / スライドタイトル (Impress) |
| Markdown形式でページ分割されたドキュメントテキスト |
| 特定の段落またはスライド範囲 |
| 周辺コンテキストを含むテキスト検索 |
書き込み (Writer)
ツール | 説明 |
| 先頭/末尾/見出しの後ろに挿入 |
| 検索と置換 (最初またはすべての出現箇所) |
| 特定のインデックスに段落を挿入 |
| 見出し/段落スタイルを適用 |
スプレッドシート (Calc)
ツール | 説明 |
| 行数/列数を含むシート名 |
| JSON + Markdownテーブルとしてのセル範囲 |
| セル値または数式を設定 |
| 2次元の値範囲を設定 |
| 新しいシートを追加 |
| 範囲内の数式を取得 |
プレゼンテーション (Impress)
ツール | 説明 |
| インデックス付きのスライドタイトル |
| スライドの全コンテンツ (タイトル、本文、ノート) |
| 発表者ノート |
| 新しいスライドを追加 (LibreOfficeが必要) |
| スライドのコンテンツを更新 |
💡 トークン節約ワークフロー
最大限のトークン効率を得るには、このパターンに従ってください:
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 sectionドキュメント全体をダンプする代わりに、必要な場所に正確に移動します。
スプレッドシートのワークフロー:
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🏗 アーキテクチャ
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🧪 テスト
# Create sample fixtures
node tests/create-fixtures.mjs
# Run smoke tests
npm test📝 環境変数
変数 | 説明 |
| LibreOffice |
| 詳細なログを出力するには |
📄 ライセンス
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
- AlicenseNot gradedqualityDmaintenanceEnables 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.9MIT
- AlicenseNot gradedqualityFmaintenanceEnables 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.6MIT
- 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.1495MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to read, edit, and create Microsoft Word documents (.docx) with support for rich text, tables, and images, deployable locally or via SSE.3MIT
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