Arezzo

io.github.ConvergentMethods由 GitHub 账号 ConvergentMethods 发布v0.1.1更新于 Oct 27, 2026

Deterministic Google Docs API compiler. Your agent stops silently corrupting documents.

已验证STDIO仅桌面效率与工作流文件与存储

概览

AI 生成的概览

本地 MCP 服务器,通过语义化操作读取和编辑 Google 文档,并编译为正确的 batchUpdate 请求。

可以做什么
  • 读取文档结构:标题层级、命名范围、表格与分节边界
  • 编辑文档:插入、删除或替换文本,设置格式、链接与标题
  • 插入表格及行列、列表、图片、页眉页脚、脚注与命名范围
  • 试运行操作,在执行前查看编译出的请求
适用场景
适合需要可靠修改 Google 文档的场景,尤其是多步编辑,手工计算索引容易损坏文档。README 建议编辑前先读取文档,结构性改动后再次读取。
运行要求
以 Python 包形式通过 pip 本地安装,再用初始化命令写入 MCP 客户端配置文件。需要一个已启用 Google Docs API 的 Google Cloud 项目,以及 OAuth 2.0 桌面应用类型的客户端凭据文件,通过 GOOGLE_APPLICATION_CREDENTIALS 环境变量指定;首次需在浏览器完成一次 OAuth 授权。
安装前请注意
需要 Google OAuth 凭据,初始化向导会将其复制到本地配置目录。编辑工具会写入真实的 Google 文档,误操作会改动线上文档,建议先使用试运行校验工具。文档内容与编辑请求会发送至 Google Docs API。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Arezzo,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Arezzo

Deterministic compiler for Google Docs API operations.

You cannot safely modify a Google Doc by constructing batchUpdate requests yourself. The API uses UTF-16 code units with cascading index shifts — insert 10 characters at position 50, and every subsequent index in your batch is now wrong. A single miscalculation silently corrupts the document with no error message.

Arezzo compiles semantic intent into a correct request sequence. Tell it what you want to do; it handles the index arithmetic.

For AI agents (MCP tools)

Arezzo exposes three tools via the Model Context Protocol:

read_document(document_id)  → Returns the document's structural map: headings with hierarchy,    named ranges, tables, section boundaries. Call this before editing    so you know what addresses are available.
edit_document(document_id, operations)  → Compiles operations into correct batchUpdate requests and executes    them. Handles UTF-16 arithmetic, cascading index shifts, and    OT-compatible request ordering. Supported operations: insert/delete/    replace text, formatting (bold, italic, headings, links), tables,    lists, images, headers/footers, footnotes, named ranges.
validate_operations(document_id, operations)  → Compile-only dry run. Returns the compiled requests for inspection    without executing. Use before edit_document when uncertain.

Operation format

json
{  "type": "insert_text",  "address": {"heading": "Revenue Analysis"},  "params": {"text": "New paragraph content.\n"}}

Address modes:

  • {"heading": "Section Name"} — by heading text
  • {"named_range": "range_name"} — by named range
  • {"bookmark": "bookmark_id"} — by bookmark ID
  • {"start": true} — document start
  • {"end": true} — document end
  • {"index": 42} — absolute UTF-16 index

Operation types: insert_text, delete_content, replace_all_text, replace_section, update_text_style, update_paragraph_style, insert_bullet_list, insert_table, insert_table_row, insert_table_column, delete_table_row, delete_table_column, insert_image, create_header, create_footer, create_footnote, create_named_range, replace_named_range_content, insert_page_break

Recommended workflow

read_document → edit_document → (if structural changes) read_document → edit_document

Always read before editing. After inserting structural elements (tables, headers, footers), read again to get the new element indices before adding content inside them.

Installation

bash
pip install arezzoarezzo init

arezzo init walks through Google OAuth setup and writes platform config files for your MCP client.

Setup

Prerequisites: A Google Cloud project with the Google Docs API enabled and an OAuth 2.0 client ID (Desktop application type).

bash
arezzo init

The wizard:

  1. Copies your credentials.json to ~/.config/arezzo/
  2. Runs the OAuth consent flow (browser opens once)
  3. Generates config files for Claude Code, Cursor, and VS Code

For Claude Desktop, arezzo init prints the config block to add manually.

Platform configs

After arezzo init, config files are written to your project directory:

Claude Code / Cursor (.mcp.json):

json
{  "mcpServers": {    "arezzo": {      "command": "arezzo"    }  }}

VS Code (.vscode/mcp.json):

json
{  "servers": {    "arezzo": {      "type": "stdio",      "command": "arezzo"    }  }}

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

json
{  "mcpServers": {    "arezzo": {      "command": "arezzo"    }  }}

Why Arezzo exists

The Google Docs batchUpdate API operates on UTF-16 code units with absolute index positions. Every character insertion or deletion shifts all subsequent indices. In a batch with multiple mutations, each request's indices must account for the effect of every prior request in the same batch.

Getting this right requires:

  • UTF-16 length calculation (not Python len() — surrogate pairs count differently)
  • Reverse-order execution for same-type mutations (delete from end to start)
  • Two-phase compilation (content mutations before format mutations)
  • Cascading offset tracking across multi-step operations

Arezzo handles this deterministically. The same input always produces the same output. No reasoning, no guessing, no "usually works."

Architecture

semantic operation    ↓arezzo.parser.parse_document()    — build heading/range/bookmark indexes    ↓arezzo.address.resolve_address()  — semantic reference → document index    ↓arezzo.operations.*               — operation → batchUpdate request(s)    ↓arezzo.index.sort_requests()      — OT-compatible mutation ordering    ↓correct batchUpdate request sequence

The engine is a pure function: compile_operations(doc, operations) → requests. Deterministic. No side effects. No API calls.

The MCP server (arezzo.server) wraps the engine with Google Docs API I/O and behavioral guidance fields (next_step, present_to_user, document_reality).

License

MIT — Convergent Methods, LLC

来源:README.md,提交 8a458d7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分