mcpField
M
mdpreview

mdpreview

github.com/tdiminoDocuments4141 installsUpdated 1w ago
Repository

About mdpreview

mdpreview is a live Markdown preview and annotation tool with multi-tab browsing, threaded comments, and bookmarks. Annotations are stored in JSON sidecar files and can also be added from the command line.

Key features

  1. 01Automatic refresh after file changes
  2. 02Multi-tab browsing and runtime controls
  3. 03Add margin comments to selected text
  4. 04Threaded replies and annotation status
  5. 05Sidebar table of contents, tags, and bookmarks
  6. 06Add annotations from the CLI

Use cases

  1. 01Preview rendered output while editing Markdown
  2. 02Record review notes beside document passages
  3. 03Store and exchange annotations in JSON sidecar files
  4. 04Switch among documents and organize bookmarks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/tdimino/claude-code-minoan --skill mdpreview

After installing, type/mdpreviewin Claude Code to confirm it loaded.

Bundled filesREADME.md

Details

From the project README

mdpreview — Markdown Preview & Annotate

Catppuccin Mocha/Latte live-reloading Markdown viewer with multi-tab support and Google Docs-style margin annotations.

Canonical repo: github.com/tdimino/dabarat. Clone it or ensure md_preview_and_annotate is on your PYTHONPATH.

Quick Start

# Preview one or more files
python3 -m md_preview_and_annotate file.md [file2.md ...] --port 3031

# If not installed globally, run from the cloned repo:
python3 ~/Desktop/Programming/md-preview-and-annotate/md_preview_and_annotate/__main__.py file.md
Add a file to a running server
python3 -m md_preview_and_annotate --add another.md --port 3031
Add an annotation from CLI (no server needed)
python3 -m md_preview_and_annotate --annotate file.md \
  --text "RPL §235-b" --author "Claude" --comment "Cite the specific subsection"

This writes directly to the sidecar JSON (file.md.annotations.json). The live viewer picks it up on the next 500ms poll cycle.

Features

FeatureDetails
Live reload500ms polling, auto-refreshes on file save
Multi-tabOpen multiple .md files, switch tabs, add/close at runtime
Tab reuseLaunching a new file while the server is running adds it as a tab
AnnotationsRight-margin comment bubbles with author badges (human/AI)
Threaded repliesReply to any annotation inline
BookmarksGlobal persistence to ~/.claude/bookmarks/ with INDEX.md
Sidecar JSONAnnotations persisted in file.md.annotations.json alongside source
File tagging7 predefined + custom tags via command palette # prefix
Command paletteCmd+K / Ctrl+K for quick access to commands, tabs, and recent files
CatppuccinFull Mocha (dark) / Latte (light) theme with 26 CSS variables
TypographyCormorant Garamond headings, DM Sans body, Victor Mono code
Sidebar TOCResizable table of contents with scroll-spy
Code highlightinghighlight.js with Catppuccin syntax theme
Chrome --appOpens in frameless Chrome window for native feel
Cross-file linksLocal .md links open in new tabs instead of navigating away

Annotation System

To create annotations interactively, select text in the viewer — a floating button appears, then fill in the comment form in the right gutter.

To create annotations programmatically (e.g., from Claude Code), use the --annotate CLI flag. This requires no running server — it writes directly to the sidecar JSON.

  • Human authors — blue name badge
  • AI authors — mauve name badge with robot icon
  • Actions — resolve (toggle strikethrough) or delete (trash icon), revealed on hover
  • Persistence — sidecar JSON file, auto-loaded on viewer refresh or file poll
Sidecar JSON Schema
{
  "version": 1,
  "tags": ["draft", "research"],
  "annotations": [
    {
      "id": "a1b2c3",
      "anchor": { "text": "selected phrase", "heading": "", "offset": 0 },
      "author": { "name": "Claude", "type": "ai" },
      "created": "2026-02-12T15:30:00+00:00",
      "body": "Comment text here",
      "resolved": false,
      "replies": []
    }
  ]
}

API Endpoints

EndpointMethodPurpose
/api/content?tab=<id>GETMarkdown content for a tab
/api/tabsGETList open tabs
/api/annotations?tab=<id>GETAnnotations for a tab
/api/tags?tab=<id>GETTags for a tab
/api/addPOSTOpen a new file tab
/api/closePOSTClose a tab
/api/annotatePOSTCreate an annotation
/api/resolvePOSTToggle annotation resolved state
/api/replyPOSTAdd a threaded reply
/api/delete-annotationPOSTDelete an annotation
/api/tagsPOSTAdd/remove a tag

Comments

Markdown supported