{"id":50614463,"url":"https://github.com/algodesigner/revisedoc","last_synced_at":"2026-06-06T07:02:04.622Z","repository":{"id":357132439,"uuid":"1235499187","full_name":"algodesigner/revisedoc","owner":"algodesigner","description":"revisedoc — Edit .docx files with tracked changes, comments, and revision history. CLI, Python API, and MCP server for AI agents.","archived":false,"fork":false,"pushed_at":"2026-05-11T12:57:03.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T14:28:39.442Z","etag":null,"topics":["document-editing","docx","mcp","opencode","python","redlining","track-changes","word"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/algodesigner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-11T11:37:53.000Z","updated_at":"2026-05-11T12:57:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/algodesigner/revisedoc","commit_stats":null,"previous_names":["algodesigner/revisedoc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/algodesigner/revisedoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algodesigner%2Frevisedoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algodesigner%2Frevisedoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algodesigner%2Frevisedoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algodesigner%2Frevisedoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/algodesigner","download_url":"https://codeload.github.com/algodesigner/revisedoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/algodesigner%2Frevisedoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33972398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["document-editing","docx","mcp","opencode","python","redlining","track-changes","word"],"created_at":"2026-06-06T07:02:03.949Z","updated_at":"2026-06-06T07:02:04.574Z","avatar_url":"https://github.com/algodesigner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# revisedoc\n\nEdit `.docx` files the way Word intended — with full change tracking, inline\ncomments, and revision history. No more sending around unmarked copies or\nlosing track of what changed. Use it from the command line, from your Python\ncode, or hook it up as an MCP server so your AI coding agent can edit documents\nwith the same care a human reviewer would.\n\n## Features\n\n- **Tracked-changes replace** — Replace text using Word-compatible `\u003cw:del\u003e` / `\u003cw:ins\u003e` markup\n- **Inline comments** — Anchor comments to any text range\n- **Revision inspection** — List all tracked changes with id, author, date, type, text\n- **Revision restoration** — Undo a specific tracked change\n- **MCP server** — Expose all operations as structured tools for AI agents (opencode, Claude Code, etc.)\n\n## Use Cases\n\n- **Contract redlining** — Replace outdated terms in a `.docx` contract with\n  tracked changes so the other side sees exactly what was modified.\n\n- **Document review workflows** — Annotate drafts with inline comments,\n  then list and restore revisions to review changes systematically.\n\n- **AI-assisted editing** — Connect the MCP server to opencode or Claude Code\n  and have your agent propose edits with full change tracking — no more\n  \"just trust me, I made some changes.\"\n\n- **Batch processing** — Script document updates across hundreds of files\n  using the Python API, with every change recorded in Word's revision log.\n\n## Quick Start\n\nCreate a document, then use the MCP tools from your AI agent:\n\n```\n1. docx_inspect     — see the paragraph structure and formatting\n2. docx_search      — locate exact text before editing\n3. docx_replace     — make tracked changes (strikethrough + underline)\n4. docx_comment     — annotate clauses with inline comments\n5. docx_list_revisions — review what changed\n```\n\nEvery operation produces standard Word revision markup — open the output in\nWord to see tracked changes, or accept/reject them as usual.\n\n## Installation\n\n```bash\npip install revisedoc          # with pip\npipx install revisedoc          # with pipx (isolated)\n```\n\nFor AI agent integration (opencode, Claude Code):\n\n```bash\npip install \"revisedoc[mcp]\"     # pip — quotes required in zsh\npipx install \"revisedoc[mcp]\"    # pipx — quotes required in zsh\n```\n\n\u003e `[mcp]` is an optional extra — it installs the same `revisedoc` package plus the\n\u003e `mcp` SDK dependency. Without it, the CLI and Python API work fine; only the\n\u003e `revisedoc-mcp` server is unavailable.\n\u003e\n\u003e **Note for zsh users:** the square brackets must be quoted. Use\n\u003e `pip install \"revisedoc[mcp]\"` not `pip install revisedoc[mcp]`.\n\n## CLI Usage\n\n```bash\n# Replace text with tracked changes\nrevisedoc replace input.docx output.docx \"old text\" \"new text\" --author \"Me\"\n\n# Add a comment\nrevisedoc comment input.docx output.docx \"target text\" \"my comment\" --author \"Reviewer\"\n\n# List tracked changes\nrevisedoc list-revisions input.docx\nrevisedoc list-revisions input.docx --format json\n\n# Undo a revision (restore deleted text)\nrevisedoc restore input.docx output.docx --revision-id 3\n\n# Undo an insertion instead\nrevisedoc restore input.docx output.docx --revision-id 3 --restore-type insertion\n\n# Print document plain text\nrevisedoc get-text input.docx\n```\n\n## Python API\n\n```python\nfrom docx import Document\nfrom revisedoc import replace_text, add_comment, list_revisions, restore_revision, get_full_text, finalize_comments\n\ndoc = Document(\"input.docx\")\nreplace_text(doc, \"old phrase\", \"new phrase\", author=\"MyBot\")\nadd_comment(doc, \"some specific text\", \"Review this part\", author=\"Reviewer\")\npending = doc.part._pending_comments\ndoc.save(\"output.docx\")\nfinalize_comments(\"output.docx\", pending_comments=pending)\n```\n\n## MCP Server — AI Agent Integration\n\nStart the MCP server:\n\n```bash\nrevisedoc-mcp\n```\n\n### opencode\n\nAdd to `opencode.json`:\n\n```json\n{\n  \"mcp\": {\n    \"revisedoc\": {\n      \"type\": \"local\",\n      \"command\": [\"revisedoc-mcp\"],\n      \"enabled\": true\n    }\n  }\n}\n```\n\n### Claude Code\n\nAdd to `.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"revisedoc\": {\n      \"command\": \"revisedoc-mcp\"\n    }\n  }\n}\n```\n\n### Available Tools\n\n| Tool | Description |\n|---|---|\n| `docx_replace` | Replace text with tracked changes |\n| `docx_comment` | Add a comment anchored to text |\n| `docx_list_revisions` | List all tracked changes |\n| `docx_restore` | Undo a revision by ID |\n| `docx_get_text` | Print document plain text |\n\n## Development\n\n```bash\npip install -e \".[mcp,test]\"\npytest tests/ -v\n```\n\n## Architecture\n\nThe package structure:\n\n```\nsrc/revisedoc/\n├── __init__.py     # Public API exports\n├── editor.py       # Core editing operations\n├── cli.py          # Command-line interface\n└── mcp.py          # MCP server for AI agents\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgodesigner%2Frevisedoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falgodesigner%2Frevisedoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falgodesigner%2Frevisedoc/lists"}