word-doc

Create, read, edit, and comment on Microsoft Word documents via MCP tools and python-docx.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/coolrobertj/Agency-Cowork --skill word-doc-coolrobertj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: word-doc
Source: https://github.com/coolrobertj/Agency-Cowork/tree/main/skills/word-doc/skills/word-doc
Command: npx skills add https://github.com/coolrobertj/Agency-Cowork --skill word-doc-coolrobertj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, and includes scripts (resource) components.

What problem does it solve? Working with Microsoft Word documents programmatically is fragmented: cloud files live in OneDrive/SharePoint, local edits need python-docx, and DRM-protected files cannot be opened at all. This Skill unifies creation, reading, batch editing, and comment collaboration into one edit-first workflow. ## Core Features & Use Cases - Cloud document operations: Create Word documents in OneDrive with HTML or plain text content, fetch content from SharePoint/OneDrive URLs, and add or reply to comments via Microsoft Word MCP tools. - Local batch editing: Inspect document structure (paragraphs, tables, styles, headers/footers) and apply batch operations like find-replace, paragraph updates, table edits, and header/footer changes using the bundled docx_editor script. - DRM handling: Detect and strip IRM/DRM protection (OLE2 containers) before editing, then re-apply it afterward so protected files remain compliant. - Use Case: Download a quarterly status report from SharePoint, replace all "Q3 2025" references with "Q4 2025", update a status table, and upload the revised document back — all in one batch operation. ## Quick Start Ask your agent to download the Word file from this SharePoint link, replace every occurrence of "Q3 2025" with "Q4 2025", and upload it back.

Frequently Asked Questions about word-doc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a Word document programmatically with python-docx?

Use the docx_editor script to inspect the document structure first, then apply batch operations like find-replace, update-paragraph, insert-paragraph, and update-table-cell via a JSON operations list. Batch editing applies all changes in one pass while preserving formatting.

How do I find and replace text in a docx file?

Run docx_editor with the find-replace action, passing the find and replace strings. It searches across both paragraphs and tables, and can be combined with other edits in a single batch operation.

Why can't python-docx open my Word file?

The file is likely DRM/IRM-protected, which wraps the DOCX in an OLE2 container with a D0 CF header that python-docx cannot parse. Strip the protection first using the drm_handler PowerShell script, edit, then re-apply DRM afterward.

Can I add comments to a Word document in OneDrive?

Yes, via the microsoft-word MCP tools. First call GetDocumentContent with the SharePoint or OneDrive URL to obtain the driveId and documentId, then use AddComment or ReplyToComment with those identifiers.

How do I create a Word document in OneDrive with formatted content?

Use the microsoft-word CreateDocument MCP tool with HTML content for rich formatting such as headings, tables, lists, and bold text. You can optionally provide a file name and a shareWith email to share it immediately.