Claude Assistant for LibreOffice Writer

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.

Category
Visit Server

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

  1. Claude Code CLI, installed and logged in:
    claude        # then /login if needed
    
  2. LibreOffice with Python scripting (standard on Linux).
  3. A Python 3.10+ environment with claude-agent-sdk for 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.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured