Claude Assistant for LibreOffice Writer
Enables Claude to read, rewrite, generate, and summarize LibreOffice Writer documents with preview-then-apply editing through MCP tools, authenticating via Claude Code login.
README
Claude Assistant for LibreOffice Writer
A LibreOffice Writer extension that adds a native Claude sidebar: chat with Claude, rewrite the selected text, generate or continue writing, and summarise the document — with every edit previewed for Apply / Reject before it touches your document.
It authenticates off your existing Claude Code login (subscription) via the Claude Agent SDK — no Anthropic API key required.
How it works
LibreOffice (Writer) agent sidecar (Python 3.10+ venv)
Claude sidebar panel ── JSON over a pipe ── claude-agent-sdk
owns the document (UNO) in-process MCP server "writer"
applies edits on approval drives Claude via Claude Code login
The extension exposes the document to Claude as MCP tools
(get_document_text, get_selection, replace_selection, insert_at_cursor).
Claude calls them; edit tools are gated by the sidebar's preview-then-apply UI.
The agent runs in a separate Python process (the sidecar) because LibreOffice's
bundled Python is usually too old for the SDK; the two talk over the subprocess
pipe. Document edits are applied in-process via UNO as single undoable steps.
Prerequisites
- Claude Code CLI, installed and logged in:
claude # then /login if needed - LibreOffice with Python scripting (standard on Linux).
- A Python 3.10+ environment with
claude-agent-sdkfor the sidecar.
Install
Easiest — just install the extension; it sets itself up. Install
claude-writer.oxt (Tools → Extension Manager → Add, or unopkg add claude-writer.oxt), restart LibreOffice, and open the Claude sidebar. On
first run it auto-creates its own Python environment at
~/.local/share/claude-writer/venv and installs the Claude Agent SDK — you'll
see "Setting up Claude…" in the panel for ~30s, then it's ready. Needs a
python3 with venv on PATH (and the Claude Code CLI logged in).
Or run the installer (does the setup up-front instead of on first run, and
builds the .oxt for you):
./install.sh
It uses uv or python3 -m venv. To remove
everything later: ./uninstall.sh.
<details> <summary>Manual install (what install.sh does)</summary>
uv venv .venv && uv pip install -r requirements.txt # sidecar SDK env
mkdir -p ~/.config/claude-writer
echo "$PWD/.venv/bin/python" > ~/.config/claude-writer/python
PYTHON=.venv/bin/python ./build.sh # -> claude-writer.oxt
unopkg add --force claude-writer.oxt
</details>
Pointing at a different Python
By default the panel launches <extension>/.venv/bin/python. Override with:
export CLAUDE_WRITER_PYTHON=/path/to/python3 # has claude-agent-sdk installed
Optional model override: export CLAUDE_WRITER_MODEL=claude-opus-4-8.
Usage
- Rewrite: select text, ask e.g. "make this more formal" → Claude reads the selection and proposes a replacement; Apply or Reject.
- Generate / continue: place the cursor, ask "continue this paragraph" → Claude proposes an insertion to approve.
- Summarise: ask "summarise this document" → Claude reads the full text.
- Chat: ask anything; Claude answers in the panel without editing.
Applied edits are single undo steps — Ctrl+Z reverts cleanly.
Project layout
| Path | Role |
|---|---|
python/claude_panel.py |
UNO sidebar factory + panel UI, thread marshalling |
python/sidecar_client.py |
Launches/streams the sidecar, routes document ops |
python/writer_ops.py |
UNO document read/edit operations |
sidecar/agent_main.py |
Agent loop: MCP server + ClaudeSDKClient |
sidecar/writer_tools.py |
The mcp__writer__* tool definitions |
*.xcu, description.xml, META-INF/manifest.xml |
Extension manifests |
Testing the backbone (no GUI)
cd sidecar
../.venv/bin/python fake_panel_test.py ../.venv/bin/python "Make my selection formal."
This drives the real sidecar with a faked document and prints the tools Claude called and the edits it proposed — verifying Claude Code auth and the MCP round-trip without LibreOffice.
Status
v0.1 — working: native sidebar (chat, rewrite selection, generate/continue, summarise), in-document highlighted preview with Apply / Improve / Reject, whole-document rewrite, Enter-to-send, and Claude Code (subscription) auth with no API key. Document operations and the agent round-trip are verified against a live LibreOffice.
License
MIT — see LICENSE. Note: the Claude name and the sidebar icon are Anthropic brand assets and are not covered by the MIT license; replace the icon before redistributing if you don't have permission to use it.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。