carve-mcp
OfficialThis MCP server gives MCP-compatible assistants Carve parsing, linting, formatting, rendering, migration, compatibility checking, AST/source editing, and optional workspace review capabilities.
Lint and diagnose Carve documents, propose safe fixes, apply selected fix IDs, and return forward/undo patches.
Format canonical Carve with optional table alignment and render to HTML, Markdown, plain text, or ANSI with loss reporting.
Check publishing compatibility across HTML, Markdown, plain text, ANSI, GitHub, WordPress, and PDF-stage profiles.
Parse to a position-aware interchange AST; create/apply AST patches; select nodes; retrieve exact source blocks and byte offsets.
Plan and preview semantic or reversible AST edits, splice selected source ranges, and guard edits via hashes, parse checks, and lint checks.
Migrate HTML, Markdown, Djot, or BBCode to Carve with fidelity diagnostics.
With explicit workspace roots, support includes, reviewed edits/undo, strict workspace review, and cross-document reference graphs.
Provide guide/rule/lint resources and optional prompts/tool profiles; raw HTML passthrough and filesystem access are disabled by default.
Allows migration of Markdown documents to Carve with fidelity diagnostics and rendering of Carve documents as Markdown.
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., "@carve-mcp Lint this Carve document: ::heading[Welcome]"
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.
Carve MCP server
MCP server for the Carve parser, linter, formatter, and renderers, using @markup-carve/carve 0.1.15 or later. File access is enabled only for configured roots. Read the Carve documentation for the language syntax.
Install
npm install -g @markup-carve/carve-mcpRelated MCP server: deliverable-mcp
Usage
carve-mcp --helpDocumentation
License
Available Tools
15 toolscarve_apply_ast_patchApply structured AST patchARead-only
Validate and apply structured operations to a PART 12 Carve AST, returning the patched AST and canonical Carve source.
Inputs: ast (required), operations (required). Returns: ast, source
carve_apply_reversible_ast_patchPreview reversible AST patch as source editsARead-only
Verify a reversible AST patch against source, apply or undo it, and return a minimal stale-guarded UTF-8 source edit without writing files.
Inputs: patch (required), source (required), inverse, includeAst. Returns: ast, sha256, source, direction, +1 more
carve_check_targetsCheck Carve publishing targetsARead-only
Compare one Carve document across HTML, Markdown, plain text, ANSI, GitHub, WordPress, and PDF-stage profiles, returning target-specific warnings, losses, and fallbacks.
Inputs: source (required), targets. Returns: source, summary, targets, versions, +3 more
carve_create_ast_patchCreate structured AST patchARead-only
Compare two PART 12 Carve ASTs and return position-independent add, replace, and remove operations.
Inputs: after (required), before (required). Returns: changes, operations, changeCount, operationCount
carve_create_reversible_ast_patchCreate reversible AST patchARead-only
Compare two PART 12 ASTs and return forward and inverse operations with semantic stale-edit fingerprints.
Inputs: after (required), before (required). Returns: changes, forward, inverse, version, +2 more
carve_diagnose_and_fixDiagnose and fix CarveBRead-only
Diagnose Carve source, propose bounded fixes, and optionally apply selected safe fix IDs with forward and undo patches. Writer-review fixes are never applied automatically.
Inputs: source (required), platforms, applyFixIds. Returns: fixes, patch, valid, value, +6 more
carve_formatFormat CarveARead-only
Format Carve source canonically and report any lossy raw-format nodes.
Inputs: source (required), alignTables. Returns: value, losses, truncated, totalLosses
carve_get_blockGet Carve source blocksARead-only
Return the exact source text of the nodes a selector matches, or a heading's section, with UTF-8 byte offsets and the source sha256. No AST unless includeAst.
Inputs: source (required), selector (required), scope, includeAst. Returns: blocks, sha256, truncated, matchCount, +1 more
carve_lintLint CarveARead-only
Check Carve source for author-facing problems and silent degradation.
Inputs: source (required), platforms. Returns: valid, warnings, warningCount
carve_migrateMigrate to CarveARead-only
Migrate HTML, Markdown, Djot, or BBCode source to Carve with version 2 fidelity diagnostics.
Inputs: format (required), source (required), markdownDialect. Returns: value, report
carve_parseParse CarveBRead-only
Parse and resolve Carve into its position-aware interchange AST.
Inputs: source (required), positions. Returns: type, children, srcByteLength
carve_plan_ast_editPlan a semantic AST editARead-only
Plan one or more atomic semantic AST edits and return a human-readable, reversible, stale-guarded source patch without writing the document.
Inputs: edit (required), source (required), selector (required), then. Returns: edit, match, steps, sha256, +5 more
carve_renderRender CarveBRead-only
Render Carve to HTML, Markdown, plain text, or ANSI terminal text, with loss reporting.
Inputs: source (required), target (required), preset, extensions, +7 more. Returns: value, losses, truncated, totalLosses
carve_replace_sourceReplace Carve source of one nodeARead-only
Splice Carve text over the exact source bytes of one selected node or heading section, leaving every other byte untouched. Refuses if the node kind changes, the rest of the document parses differently, or new lint findings appear. Returns forward and undo patches.
Inputs: text (required), source (required), selector (required), scope, +2 more. Returns: end, lint, match, patch, +6 more
carve_select_ast_nodesFind AST nodes by semantic selectorARead-only
Resolve an element ID on any node, a heading ID, footnote label, node type, or current AST path to reviewable PART 12 AST paths without silently choosing among multiple matches.
Inputs: ast (required), selector (required). Returns: matches, selector, truncated, matchCount
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 patch/edit cluster has unclear boundaries: carve_plan_ast_edit, carve_create_ast_patch, and carve_create_reversible_ast_patch all produce patches, while carve_apply_ast_patch and carve_apply_reversible_ast_patch both apply them, and carve_replace_source provides yet another source-editing path. An agent must reason carefully about reversible vs. non-reversible and AST-level vs. source-level before selecting, and carve_diagnose_and_fix partially overlaps with lint/format plus plan-and-apply flows.
All names use the carve_ prefix with snake_case and a dominant verb_noun convention (create_ast_patch, apply_ast_patch, select_ast_nodes, get_block, replace_source). The only minor deviation is that several tools are verb-only (format, lint, render, parse, migrate), but the pattern remains predictable and readable.
Fifteen tools is at the upper edge of a reasonable scope for a markup-language toolchain spanning parsing, formatting, linting, rendering, migration, and editing. However, the count is inflated by the redundant reversible/non-reversible patch pairs, so not every tool clearly earns an independent place.
The surface covers the full lifecycle well: parse, format, lint, render across multiple targets, migrate, diagnose/fix, inspect blocks, and create/apply patches with undo. Minor gaps exist around direct document persistence (tools explicitly avoid writing files) and general insertion/append operations outside the patch model, but agents can work around these.
Maintenance
Related MCP Connectors
Remote MCP for JSON repair, hashing, formatting, IDs, dates, units, and other small tools.
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Convert files, URLs, and documents to clean, AI-ready Markdown via MCP.
Caelara Labs Document Utilities tools over remote MCP. Calls need an X-Caelara-Key API key.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to inspect and export OpenPencil .fig and .pen files directly from disk, supporting operations like info, tree traversal, XPath queries, linting, and conversion to various formats without the desktop app or CLI.MIT
- AlicenseBqualityCmaintenanceEnables MCP clients to render Markdown to HTML, estimate page counts, verify document delivery constraints, and atomically ship documents through a zero-dependency JSON-RPC stdio server.4MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating, reading, editing, and verifying PDF, Word, Excel, and PowerPoint documents through MCP tools that return structured results. It preserves source files by default for edits and supports local stdio operation without network requests.MIT
- AlicenseNot gradedqualityBmaintenanceEnables autonomous agents to parse markdown documents into structured AST nodes—including headings, lists, tables, callouts, and code blocks—and serialize modified AST back into clean canonical markdown via MCP tools.7MIT