wrapguard-mcp
WrapGuard MCP is a browser-driven auditing and fixing server for Korean/English mid-word wrapping issues in responsive pages.
Audit pages at multiple viewport widths (320, 375, 768, 1024 px by default) to detect Korean/English words split across visual lines.
Detect mid-word breaks using measured grapheme geometry in Chromium, including hard source newlines embedded inside words.
Inspect wrapping CSS for one element, showing computed properties and same-origin matching rules.
Suggest safe CSS fixes based on content type: prose, raw evidence, or code/URL content.
Verify wrap regressions against explicit error/warning thresholds for CI or release gates.
Apply explicit CSS fixes idempotently, with dry-run by default and real writes only when explicitly enabled and rooted.
Get server information such as display name, safety policy, and supported languages.
Supports local files, file URLs, and allowlisted HTTP(S) URLs with configurable ignore selectors and locale (auto/ko/en).
Inspects applied CSS wrapping rules, generates minimal CSS fixes for mid-word line breaks, and appends idempotent CSS rules to stylesheet files.
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., "@wrapguard-mcp Audit https://example.com for mid-word line breaks and suggest CSS fixes."
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.
WrapGuard MCP
WrapGuard is an MCP server and CLI that renders responsive pages with Playwright and finds Korean or English words split across visual lines. It also reports hard newlines embedded inside words, such as 업로↵드, without rewriting immutable source evidence.
한글·영어 문장이 반응형 화면에서 단어 중간에 잘리는 문제를 실제 브라우저 좌표로 검사합니다. 표시 이름은 자유롭게 바꿀 수 있지만 npm/GitHub/MCP Registry의 패키지 식별자는 별도로 유지됩니다.
What it checks
Korean eojeol-like tokens and English word tokens, including apostrophes and hyphens
Actual grapheme positions across 320, 375, 768, and 1024 px by default
Avoidable mid-word wraps versus unavoidable long identifiers
Hard source newlines between letters
Applied wrapping CSS and same-origin matching rules
Explicit, dry-run-first CSS suggestions
URLs, code, hashes, and immutable raw evidence can be excluded with patterns or data-wrapguard-ignore. Public fixtures contain no private data.
Related MCP server: UI Analyzer MCP Server
Install and run locally
Requirements: Node.js 22 or newer and a Playwright Chromium installation.
npm install
npx playwright install chromium
npm run build
node dist/stdio.jsWith browserChannel: "auto" (the default), WrapGuard tries Playwright Chromium first and then an installed Chrome or Microsoft Edge. Installing Playwright Chromium is the reproducible choice for CI.
After an npm release, an MCP client can launch it directly:
{
"mcpServers": {
"wrapguard": {
"command": "npx",
"args": ["-y", "wrapguard-mcp"],
"env": {
"WRAPGUARD_SERVER_NAME": "My Typography Inspector",
"WRAPGUARD_CONFIG": "C:/absolute/path/wrapguard.config.json"
}
}
}
}On Windows, clients that do not resolve command shims may need npx.cmd instead of npx.
Run it as a release gate without MCP:
wrapguard audit ./dist/index.html --viewports 320,375,768,1024 --output wrap-report.json
wrapguard audit ./dist/index.html --format markdown --output wrap-report.mdExit code 0 means no avoidable split, 1 means regression issues were found, and 2 means the audit could not run.
Change the displayed name
Copy wrapguard.config.example.json to wrapguard.config.json, then edit:
{
"serverName": "우리집 문장 검사기"
}WRAPGUARD_SERVER_NAME overrides the JSON value. This changes the runtime MCP display name only. Before the first public release, change name, mcpName, repository URLs, and server.json together if you want a different permanent package identity.
MCP tools
server_infoaudit_pagedetect_midword_breaksinspect_wrap_csssuggest_wrap_fixverify_wrap_regressionapply_wrap_fix— dry-run by default; real writes requireallowWrites: trueand an allowed root
Safe defaults
The default configuration audits local files under the configured roots and localhost only. Remote URL auditing, screenshots, and CSS writes are disabled unless explicitly enabled. A hosted instance should use a narrow allowedHosts list because unrestricted browser navigation creates an SSRF risk.
CSS previews, CSS writes, and screenshots resolve filesystem links before checking allowedFileRoots. Screenshot directories must be inside an existing allowed root. An explicitly selected configuration file must exist and contain a JSON object; a missing conventional wrapguard.config.json still uses defaults. Runtime and MCP versions are read from package.json.
Three publication layers
GitHub publishes source, issues, documentation, and releases. It does not by itself run an MCP endpoint.
npm publishes the stdio executable so users can run
npx -y wrapguard-mcp.Remote MCP hosts
/mcpover Streamable HTTP for clients that do not run local processes.
Publish source and npm
After reviewing the repository name and public contents:
git init
git add .
git commit -m "feat: release WrapGuard MCP 0.1.1"
gh repo create wrapguard-mcp --public --source . --remote origin --push
npm login
npm publish --access publicThen validate and publish server.json with the official mcp-publisher. The npm package must be published first and the mcpName in package.json must match server.json.
Host a remote endpoint
The included container starts the Streamable HTTP server at /mcp:
docker build -t wrapguard-mcp:0.1.1 .
docker run --rm -p 8787:8787 \
-e WRAPGUARD_HTTP_TOKEN="replace-with-a-long-random-value" \
-e WRAPGUARD_HTTP_HOSTS="localhost,127.0.0.1" \
wrapguard-mcp:0.1.1For a public host, set WRAPGUARD_HTTP_HOSTS to the deployed domain and store WRAPGUARD_HTTP_TOKEN as a platform secret. Use a container service that supports Playwright/Chromium, such as Cloud Run, Fly.io, Render, Railway, or an equivalent service. Add the final HTTPS URL to the remotes field in server.json only after the endpoint exists.
Vercel Functions are not the default recommendation for this project because browser binaries, execution duration, and memory limits make browser audits less predictable than a long-running container.
Development
npm run check
npm test
npm run build
npm pack --dry-runThe test suite uses synthetic Korean and English pages and an in-memory MCP client/server connection.
License
MIT
Available Tools
7 toolsapply_wrap_fixApply an explicit CSS wrap fixBIdempotent
Append an idempotent CSS rule. Dry-run is the default; real writes require allowWrites and an allowed root.
Inputs: cssFile (required), profile (required), selector (required), dryRun.
audit_pageAudit responsive word wrappingBRead-only
Render a page at multiple widths and report Korean/English mid-word wraps and forced source newlines.
Inputs: target (required), locale, viewports, screenshotDir, +1 more.
detect_midword_breaksDetect mid-word breaksBRead-only
Return only concrete Korean/English wrap issues measured from grapheme geometry in the browser.
Inputs: target (required), locale, viewports, screenshotDir, +1 more.
inspect_wrap_cssInspect wrapping CSSBRead-only
Inspect computed wrapping properties and same-origin matching CSS rules for one element.
Inputs: target (required), selector (required), viewport.
server_infoWrapGuard server informationARead-only
Show the configured display name, safety policy, and supported languages.
Inputs: no named parameters.
suggest_wrap_fixSuggest a safe wrapping fixBRead-only
Generate a minimal CSS rule for Korean, English, mixed prose, raw evidence, or code/URL content.
Inputs: selector (required), locale, contentKind.
verify_wrap_regressionVerify wrap regression thresholdBRead-only
Audit a page and evaluate it against explicit error/warning thresholds for CI or release gates.
Inputs: target (required), locale, maxErrors, viewports, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target distinct actions: detect, audit, inspect, suggest, apply, verify. The only real overlap is between detect_midword_breaks and audit_page, since both report wrap issues, but audit_page's multi-width rendering and forced-newline reporting help separate them.
Tool names mostly follow a clear verb_noun pattern like detect_, audit_, inspect_, suggest_, apply_, and verify_. The single deviation is server_info, which uses a noun phrase instead of a verb-based name, but the overall convention is consistent.
Seven tools is well-scoped for a focused Korean/English wrapping server. Each tool contributes to a clear workflow without excessive redundancy or an undersized surface.
The set covers the full lifecycle: audit/detect issues, inspect CSS, suggest fixes, apply fixes, and verify regressions. The main minor gap is the lack of an explicit undo/remove operation for applied wrap fixes.
Maintenance
Related MCP Connectors
Scan a web page for accessibility, security, privacy, quality and SEO issues, with fixes.
Audit public webpages and supplied markup for HTML, CSS, SEO, JSON-LD, and link issues.
Review frontend code and live pages against 386 quality-gated web development rules.
Playwright selector risk checks with healing suggestions and receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables HTML page analysis, verification, and automated correction using Playwright for rendering and Mistral AI for visual inspection. Captures screenshots, analyzes renders against specifications, and generates fixes for HTML issues.2ISC
- AlicenseNot gradedqualityDmaintenanceAnalyzes website UIs using Playwright and provides precise CSS/HTML fix instructions for AI coding assistants like GitHub Copilot and Cursor.4MIT
- FlicenseNot gradedqualityDmaintenanceDetects brittle Playwright selectors and provides healing suggestions, action receipts, human approvals, and failure exports.-
- AlicenseAqualityCmaintenanceRenders HTML in a headless browser and detects layout defects numerically, such as text overlaps, placeholder leftovers, and element overflow, without requiring baseline images.1MIT