hwp-live-safe
You can use this local MCP server to safely draft a new unsaved Hancom Office 2022 document via preview-first text/table insertions and local profile values, plus an experimental foreground-typing mode for an existing user-selected Hancom window.
Check whether the local Hancom 2022 automation bridge is ready (
hwp_status).Launch Hancom and create a brand-new unsaved document owned by HWP Live Safe (
hwp_start_new_document).Read the current owned document text and revision (
hwp_read_context).List configured local profile keys without returning profile values (
hwp_profile_list).Preview profile-value insertions with optional text styling and revision guard (
hwp_preview_profile_insert).Preview allowlisted text/table insertions with formatting controls (
hwp_preview_edits).Apply exactly one fresh approved preview to the owned document (
hwp_apply_preview).Undo HWP Live Safe's immediately preceding unchanged edit (
hwp_undo_last).Use experimental foreground tools to check status, list/select visible Hancom windows, preview/apply one short literal or profile-value insertion at a user-confirmed collapsed caret, and disconnect (
hwp_foreground_*).It deliberately does not open/save/export/close/delete/overwrite user files, attach natively to arbitrary existing documents, run HTTP, or call external AI/cloud services.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hwp-live-safe Create a new blank Hancom document with a short welcome memo and show me the preview before applying."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HWP Live Safe
GitHub pre-release
v0.3.0-rc.1(package version0.3.0rc1) — a local, preview-first MCP server for a new visible Hancom Office 2022 document on Windows.
Repository · Issues · Security reports
HWP Live Safe gives MCP-compatible assistants a deliberately narrow way to draft a document without silently touching an arbitrary user file. It opens a new unsaved Hancom document that it owns, reads its current text, makes a short-lived preview, and applies only the approved preview.
It is intended for careful drafting, personal-form entry, and reviewable insertions. It is not an editor for arbitrary existing .hwp/.hwpx files.
How the safe connection works
flowchart LR
C["Codex · Claude Code · Cursor · Grok Build<br/>or another local MCP client"]
S["HWP Live Safe<br/>local stdio MCP server"]
P["Preview state<br/>revision · expiry · approval"]
B["Native safe backend<br/>HWPFrame automation"]
N["New visible, unsaved<br/>Hancom document"]
L[("Local profile store")]
F["Experimental foreground typing<br/>short literal insertion only"]
E["User-selected existing<br/>Hancom window"]
C -->|"stdio tools"| S
S --> P
P -->|"approved preview"| B
B -->|"creates and owns"| N
L -->|"value stays local until insertion"| S
S -.->|"separate explicit mode"| F
F -.->|"keyboard input; no read-back"| EThe solid path is the native safe mode. It creates a fresh document and never attaches to an existing user file. The dotted path is a separate experimental typing aid; it cannot read the target document or provide verified Undo.
Related MCP server: HWP-MCP
What it does
Starts one visible, new, unsaved Hancom Office 2022 document.
Inserts one reviewed text block or one non-empty table per preview.
Supports text size, bold, and paragraph alignment for native text insertion.
Detects a changed document text fingerprint and discards stale previews.
Allows an immediate, verified undo of its own latest unchanged edit.
Reads local profile values without returning those values in profile-list or profile-preview MCP responses.
Offers a tightly restricted experimental foreground typing mode for one user-selected Hancom window and one short, approved insertion.
What it deliberately does not do
Open, save, save-as, export, close, delete, or overwrite a user file.
Natively attach to, read, or edit an already-open normal Hancom document.
Replace a selection, bulk-fill a form, or make unreviewed long-form edits.
Run an HTTP server or call an LLM, analytics service, or cloud API itself.
Read KNOWN_LIMITATIONS.md before using it with an important document.
Verification status
Check | Status for |
Unit tests on the in-memory backend | Automated on Windows/Python 3.11 and 3.12 |
Fake stdio MCP discovery and 15-tool smoke test | Automated |
Wheel contents and | Automated |
Tracked-profile, local-config, path, and token scan | Automated |
Real Hancom Office 2022 UI release gate | Recorded manually on 2026-09-02 for the scoped configuration below |
See the release checklist for the disposable-document test procedure. Existing-file editing is unsupported by design, not an unverified capability.
Manually validated configuration
The release evidence used a new unsaved document and dummy profile data. It
validates one concrete configuration, not every Windows or Hancom installation.
The native-safe portion was witnessed at source commit 72cda61; the later
foreground-only fixes were witnessed at 0436e9a. Neither of those tagged-release
changes touched the native COM worker or native safe-mode service path. This PR
does change the worker: its new synthetic native checks are described below, and
the interactive visual gate has not been repeated at this PR head.
Component | Recorded value |
Windows | Windows 10 Home 22H2, build |
Hancom Office 2022 executable |
|
Python |
|
MCP Python SDK |
|
MCP client | Codex CLI |
Automation registration | 32-bit |
Runtime source evidence | Native safe mode |
Installation | Local source checkout; no PyPI package was used |
Requirements
Windows
Python 3.11 or later
Hancom Office with an accessible
HWPFrame.HwpObjectautomation registration
The native safe mode may coexist with an already-open Hancom window, but it only
continues after validating that COM created a distinct, blank, unsaved document
and a unique new window. Set HWP_LIVE_SAFE_STRICT_ISOLATION=1 to retain the
stricter policy that refuses to start while any Hancom process is running. The
experimental foreground mode is separate and does not provide native document
attachment. HWP_LIVE_POWERSHELL_PATH can select a specific compatible Windows
PowerShell executable when automatic discovery is unsuitable.
Install from a source checkout
This release candidate is prepared for a public GitHub pre-release; it is not a published package-registry release.
uv sync --extra devFor a persistent command available to an MCP client, install the checkout as a uv tool:
uv tool install .The installed command is hwp-live-safe.
Do not use uv tool install hwp-live-safe or pip install hwp-live-safe by
package name: the project does not publish to PyPI.
Connect an MCP client
After installing the command, use a stdio MCP configuration equivalent to .mcp.json.example:
{
"mcpServers": {
"hwp-live-safe": {
"command": "hwp-live-safe",
"args": []
}
}
}For Codex, copy the relevant values from .codex/config.toml.example into the user or project configuration after installing the command. The same stdio command can be used by Claude Code, Cursor, Grok Build, and other MCP-compatible local clients.
Do not commit a real .mcp.json or .codex/config.toml: they can contain machine-specific paths or client credentials and are ignored by default.
Safe workflow
Ask the assistant to call
hwp_start_new_document.It calls
hwp_read_contextand uses the returnedrevision.It calls
hwp_preview_editswith one concise text block or table.For a long, ambiguous, or replacement-style change, inspect the preview and explicitly approve it before
hwp_apply_preview.Read the document again after manual changes. A manual change invalidates prior previews and safe undo.
For example:
Start a new HWP Live Safe document. Make a centered bold heading “2026 지원서”, then show me the preview for a two-column personal-information table. Do not save anything.
Local profile values
Copy profiles/profile.example.json to the local profile directory and fill only its value fields:
$profileDir = Join-Path $env:LOCALAPPDATA "HWP Live Safe\profiles"
New-Item -ItemType Directory -Force $profileDir
Copy-Item .\profiles\profile.example.json (Join-Path $profileDir "default.json")Alternatively, set HWP_LIVE_SAFE_PROFILE_DIR to a local directory. The older HWP_LIVE_PROFILE_DIR name remains accepted for migration from the pre-release project name. If the new default folder does not exist but the old %LOCALAPPDATA%\HWP Live 2022\profiles folder does, the server reads that old folder until you migrate it.
Use hwp_profile_list, then hwp_preview_profile_insert. The list and preview return only the field label and configured state, not the value. Once inserted, the value is part of the document; later hwp_read_context calls can therefore return it to the MCP client. Choose a trusted client and model provider before reading a sensitive document.
Never commit a real profile file.
Experimental existing-window typing
The hwp_foreground_* tools are intentionally much narrower than the native safe mode. They can list visible Hancom window titles, let the user explicitly select one, and type one approved short text at a user-confirmed collapsed caret. They cannot read the document, inspect selection state, replace text, create tables, or undo automatically.
Use this only for a short literal insertion and verify the visible result in Hancom immediately. For a mistake, use Hancom's own Undo. Do not use it for long prose, selected-range replacement, batch edits, or sensitive work that needs reliable read-back.
Development and verification
The unit tests use an in-memory Hancom substitute and never start Hancom:
uv sync --extra dev
$env:PYTHONDONTWRITEBYTECODE = "1"
.\.venv\Scripts\python.exe -m pytest -p no:cacheprovider
.\.venv\Scripts\python.exe tests\mcp_smoke.pytests/mcp_live_smoke.py is an optional real Hancom smoke test. Run it only on
a disposable session; it creates an unsaved document, inserts test text and a
table, verifies that later body text lands outside the table, and undoes the
final text insertion. The disposable table document remains open and unsaved
for visual inspection.
Interactive native release gate
The opt-in native release gate promotes the
reusable part of a local manual probe. Run python scripts/native_release_gate.py --live
in this project's MCP 2.x environment on Windows. It requires explicit YES
checkpoints for a new disposable document, formatting, table, stale preview, and
guarded Undo checks. It reads no personal profiles, selects no foreground window,
and does not open/save/close documents. The unsaved test document is left for
manual inspection and cleanup. The gate prints its document ID; after a
successful run, identify the new window by MANUAL-STALE, UNDO-GATE, and
MANUAL-UNDO, then close only that window without saving. If the window cannot
be identified, leave it open. Fake-backend tests verify the gate's sequence;
they do not certify live rendering. Profile/foreground gates remain separate.
See integration boundaries and evidence.
For an unattended native contract check, run
python scripts/native_external_change_gate.py --live on Windows. It creates
one separate unsaved synthetic document, verifies preview/apply/Undo, then
changes that same document through the native backend outside the preview
service. Stale preview and Undo must both refuse that change. This checks the
native revision guard; it does not confirm visual layout or simulate manual
typing. The script prints its document ID and remaining markers so its window
can be identified and closed manually without saving.
Security and privacy
See SECURITY.md. HWP Live Safe itself uses local stdio and does not make network calls. Your MCP client may still send tool results or document text to a model provider, so the end-to-end privacy boundary depends on the client and provider you choose.
Use GitHub private vulnerability reporting for security-sensitive findings. General questions about choosing or combining HWP engines belong in the HWP AI Bridge discussions; reproducible HWP Live Safe defects belong in this repository's issue tracker.
Contributions are welcome through pull requests; read CONTRIBUTING.md before submitting one.
License and trademark notice
This project is released under the MIT License. It is an independent open-source project and is not affiliated with or endorsed by Hancom.
Available Tools
15 toolshwp_apply_previewA
Apply exactly one fresh preview to the visible, automation-owned document.
Inputs: plan_id (required). Returns: object
hwp_foreground_apply_previewA
Activate the selected Hancom window and type exactly one fresh foreground preview.
This never saves or closes a document. It has no read-back or automatic Undo, so use it only after the user has approved the preview.
Inputs: plan_id (required). Returns: object
hwp_foreground_disconnectB
Forget the selected foreground window without changing Hancom.
Inputs: no named parameters. Returns: object
hwp_foreground_list_windowsA
List visible Hancom window titles for an explicit experimental typing choice.
This does not read document text or edit anything. Window titles can reveal file names, so call it only when the user asks to target an already-open Hancom window and is comfortable identifying it.
Inputs: no named parameters. Returns: object
hwp_foreground_preview_profile_insertB
Preview a local profile value typed at a user-confirmed foreground caret.
The profile value is resolved only inside the local server and is never included in the MCP response. This is experimental and has no automatic document read-back or Undo.
Inputs: key (required), profile_id (required), expected_revision (required), user_confirms_collapsed_caret (required). Returns: object
hwp_foreground_preview_textA
Preview literal text typed at a user-confirmed caret in the selected window.
The mode cannot read the document or verify selection state. Set user_confirms_collapsed_caret true only after the user explicitly confirms that the intended Hancom tab has one collapsed caret, not selected text.
Inputs: text (required), expected_revision (required), user_confirms_collapsed_caret (required). Returns: object
hwp_foreground_select_windowA
Select one short-lived Hancom-window candidate for foreground typing.
This does not activate or edit the window. The user must explicitly identify the desired listed window and active tab before it is selected.
Inputs: candidate_id (required). Returns: object
hwp_foreground_statusA
Show the experimental foreground-typing session state without touching Hancom.
Inputs: no named parameters. Returns: object
hwp_preview_editsA
Create a 60-second, non-mutating preview for text or table insertions.
Call hwp_read_context first and pass its revision. Show the preview and obtain the user's approval before calling hwp_apply_preview.
Inputs: edits (required), expected_revision (required). Returns: object
hwp_preview_profile_insertA
Preview inserting one local profile value at the current HWP Live caret.
Values stay inside the local server and are not returned in the preview. First call hwp_read_context, place or confirm the visible caret, then ask for approval before applying the returned plan.
Inputs: key (required), profile_id (required), expected_revision (required), style, +1 more. Returns: object
hwp_profile_listA
List configured local profile keys without returning any profile value.
This does not open Hancom, read a document, or write a profile. It only exposes profile/key labels and whether each value is configured.
Inputs: no named parameters. Returns: object
hwp_read_contextA
Read text from HWP Live's current unsaved document and return its revision.
Inputs: no named parameters. Returns: object
hwp_start_new_documentA
Launch Hancom and create a brand-new unsaved document owned by HWP Live.
It never attaches to or changes an already-open user document.
Inputs: no named parameters. Returns: object
hwp_statusA
Check whether the local Hancom 2022 automation bridge is ready.
This does not launch Hancom, edit a document, or access a user file.
Inputs: no named parameters. Returns: object
hwp_undo_lastB
Undo HWP Live's immediately preceding change if the document is unchanged.
Inputs: expected_revision (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
The hwp_ foreground prefix cleanly separates the experimental foreground-typing flow from the normal HWP Live document flow, and each tool corresponds to a distinct lifecycle step. Some confusion is possible among the several preview/apply tools, but the descriptions and prefixes make the boundaries clear enough.
All tools share the hwp_ prefix and snake_case, giving a coherent namespace, but the internal convention varies: verb-first names like read_context and apply_preview mix with noun-first names like profile_list and foreground_status. Some compound names such as preview_profile_insert and foreground_preview_profile_insert are awkward and not consistently verb_noun.
15 tools is at the upper end of the well-scoped range, and each tool represents a distinct state transition or query for either the normal or foreground workflow. Despite the two parallel modes, no tool feels redundant.
The core safe document workflow is well covered: start, read, preview, apply, and undo, plus experimental foreground operations and profile-value insertion. Obvious gaps like saving or closing documents and managing profile values are absent, but the safety-focused design appears to intentionally exclude them.
Maintenance
Related MCP Connectors
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
Local-first browser Office suite with OAuth 2.1 Remote MCP and human-reviewed edit proposals.
MCP-native collaborative markdown editor with real-time AI document editing
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables comprehensive control of Hangul (HWP) documents through an MCP server, supporting operations from basic document management to advanced formatting, tables, images, and document structure manipulation.6-
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that enables AI models to control Hancom Office Hanword (HWP) documents on Windows. It allows for the automated creation, editing, and management of Korean word processor files, including text formatting and table manipulation.-
- FlicenseNot gradedqualityDmaintenanceEnables automation of Hancom HWP (Hanword) documents via MCP, including creating, editing, saving, and managing multiple document tabs.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents and chat clients to directly edit an open Hancom Office 2022 document on Windows through MCP, providing paragraph, table, cell, chart, layout, and document-management tools with undo-safe operations and no overwriting of the original file.MIT