# python-hwpx-automation [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/airmang/python-hwpx-automation  
**GitHub Stars:** 70  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/python-hwpx-automation

## Description
MCP server for AI agents to read, edit, inspect, and validate local HWPX documents.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "python-hwpx-automation": {
    "command": "uvx",
    "args": ["python-hwpx-automation"]
  }
}
```

## Documentation

## What python-hwpx-automation does

python-hwpx-automation adds an automation layer on top of the `python-hwpx` engine for working with HWPX documents. Its MCP adapter lets an AI agent inspect, create, modify, preview, validate, and repair files in approved local workspaces. The package can also be used directly from Python or through the `hwpx` command-line interface without MCP.

Document workflows include outline and text inspection, text search and replacement, table and form operations, declarative document creation, tracked edits, paragraph and page formatting, image insertion, mail merge, and Markdown conversion. Additional generators cover items such as photo sheets, nameplates, and organization charts. An optional ingestion extra adds support for reading PDF, DOCX, XLSX, HTML, and TXT through a MarkItDown adapter.

## How it works

Install the MCP extra and start `hwpx-automation-mcp` as a standard local MCP process. The client passes tool calls to the Python automation layer, which operates on files inside configured workspace roots. Reading tools do not save documents; editing tools save when called. A safer workflow is to copy a document first, make the smallest required change, read it again, and validate the result.

The package uses structured operations rather than asking models to edit raw HWPX XML. Normal saves pass through a single save pipeline that checks document integrity, XML, package identifiers, and open safety. Capability checks can reject mismatched core, automation, and plugin versions. A minimal profile exposes six focused tools for smaller local models: `read_outline`, `apply_text_changes`, `replace_text`, `stage_text`, `create_from_markdown`, and `validate_document`.

## Setup and configuration

Use Python 3.10 or newer, then install the adapter:

```bash
pip install "python-hwpx-automation[mcp]"
hwpx-automation-mcp
```

Configure the MCP client to launch the command, or use `uvx` with the package’s `mcp` extra. Set `HWPX_AUTOMATION_WORKSPACE_ROOTS` to a JSON array of allowed absolute directories, such as ` ["~/Documents"] `. Windows paths must be escaped as JSON. If the variable is empty, the process working directory is used, which can prevent GUI clients from reaching documents.

Useful settings include `HWPX_AUTOMATION_PROFILE=minimal`, `HWPX_AUTOMATION_ADVANCED=1`, `HWPX_AUTOMATION_MAX_CHARS` for response limits, `HWPX_AUTOMATION_AUTOBACKUP` for pre-save backups, and `HWPX_AUTOMATION_QUALITY` for the default save policy. The `ingest` extra is needed for non-HWPX document input.

## Tools and capabilities

The default tool set includes:

- Inspecting document information, maps, outlines, tables, text, and matches.
- Searching and replacing text, applying command batches, and recording tracked edits.
- Analyzing, applying, and verifying form fills, plus computing table totals and subtotals.
- Creating documents from plans, merging data into templates, and checking official-document style.
- Changing paragraph and page settings and inserting pictures.
- Rendering HTML or PNG previews, converting HWPX to Markdown, repairing files, and checking server health.

Advanced mode adds inspection and validation tools. The separate `render-pdf` command can create a PDF and page PNGs through Hancom Office on macOS or Windows.

## Limitations and notes

Workspace traversal outside approved roots and symlink escapes are rejected. URL inputs are restricted to HTTPS and public IP addresses by default; private or loopback HTTPS targets require an explicit setting, while link-local, metadata, and reserved addresses remain blocked.

Editing calls save immediately, so review work should happen on a copied document. The PDF renderer requires Hancom Office and a supported host platform, unlike the regular HWPX automation features. Long text can be staged in smaller pieces with `stage_text` and referenced by `draft_id` when using the minimal profile.

_Full upstream README: https://allmcps.com/mcp/python-hwpx-automation/readme_

