# Carve [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/markup-carve/carve-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 1573  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/carve

## Description
Parse, lint, format, render, and migrate Carve documents through MCP.

## Tools
Capabilities this server exposes over MCP:

- **carve_lint** — Check Carve source for author-facing problems and silent degradation.
- **carve_diagnose_and_fix** — 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.
- **carve_format** — Format Carve source canonically and report any lossy raw-format nodes.
- **carve_render** — Render Carve to HTML, Markdown, plain text, or ANSI terminal text, with loss reporting.
- **carve_check_targets** — Compare one Carve document across HTML, Markdown, plain text, ANSI, GitHub, WordPress, and PDF-stage profiles, returning target-specific warnings, losses, and fallbacks.
- **carve_parse** — Parse and resolve Carve into its position-aware interchange AST.
- **carve_create_ast_patch** — Compare two PART 12 Carve ASTs and return position-independent add, replace, and remove operations.
- **carve_apply_ast_patch** — Validate and apply structured operations to a PART 12 Carve AST, returning the patched AST and canonical Carve source.
- **carve_select_ast_nodes** — 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.
- **carve_get_block** — 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.
- **carve_replace_source** — 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.
- **carve_plan_ast_edit** — Plan one or more atomic semantic AST edits and return a human-readable, reversible, stale-guarded source patch without writing the document.
- **carve_create_reversible_ast_patch** — Compare two PART 12 ASTs and return forward and inverse operations with semantic stale-edit fingerprints.
- **carve_apply_reversible_ast_patch** — Verify a reversible AST patch against source, apply or undo it, and return a minimal stale-guarded UTF-8 source edit without writing files.
- **carve_migrate** — Migrate HTML, Markdown, Djot, or BBCode source to Carve with version 2 fidelity diagnostics.

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

```json
"mcpServers": {
  "carve": {
    "command": "npx",
    "args": ["-y","@markup-carve/carve-mcp"]
  }
}
```

## Documentation

## What Carve MCP server does

Carve MCP server brings core Carve document operations into an MCP interface. It can parse documents, report lint results, diagnose and fix issues, format source, render documents, and check targets. The server also exposes structured editing workflows based on the Carve abstract syntax tree (AST), including node selection, block retrieval, source replacement, AST patch creation, patch application, and planned edits.

Editing tools include reviewed and reversible workflows. Agents can create and apply reversible AST patches, perform reviewed edits, and undo reviewed changes with an undo receipt. Migration and reference-graph tools extend the server beyond one-off parsing or formatting tasks, making it suitable for document transformation and relationship inspection.

## How it works

The server uses the `@markup-carve/carve` package and exposes its parser, linter, formatter, and renderers through MCP tools. An MCP client invokes individual operations such as `carve_parse`, `carve_lint`, or `carve_render`; editing operations can work at the AST or source level depending on the requested workflow.

File access is limited to configured roots. This boundary applies to operations that access documents or other files, so the server is intended to work within explicitly allowed locations rather than across an unrestricted filesystem.

The available tool surface includes:

- Validation and transformation with `carve_lint`, `carve_diagnose_and_fix`, `carve_format`, `carve_render`, and `carve_migrate`.
- Parsing and target inspection with `carve_parse`, `carve_check_targets`, and `carve_reference_graph`.
- AST navigation and editing with `carve_select_ast_nodes`, `carve_get_block`, `carve_create_ast_patch`, `carve_apply_ast_patch`, and `carve_plan_ast_edit`.
- Source and reversible editing with `carve_replace_source`, `carve_reviewed_edit`, `carve_undo_reviewed_edit`, `carve_create_reversible_ast_patch`, `carve_apply_reversible_ast_patch`, and `undoReceipt`.

## Setup and configuration

Install the package globally with npm:

```sh
npm install -g @markup-carve/carve-mcp
```

Run the command-line help to inspect the available server options:

```sh
carve-mcp --help
```

The server uses `@markup-carve/carve` version 0.1.15 or later. Configure the roots that the server may access before using file-based operations. Carve language syntax is covered in the Carve documentation.

## Limitations and notes

File access is intentionally restricted to configured roots. The server depends on the Carve package and is designed specifically for Carve documents. Its package is released under the MIT license.

_Full upstream README: https://allmcps.com/mcp/carve/readme_

