什么是 MarkView?
在原生 macOS 应用中预览 Markdown,支持 live reload 与 GFM rendering。
README
MarkView
Native macOS markdown preview with MCP server for Claude Code. Claude writes markdown — MarkView renders it live, in a real native window, while you work.
Versions: The macOS app (
appbadge) and the npm MCP wrapper (npmbadge) are versioned independently. App releases happen when the Swift binary changes; npm patches happen for MCP server improvements. Both badges always show the latest of each.

| Preview only | Editor + Preview |
|---|---|
![]() | ![]() |
Quick Start — Claude Code
One command to wire MarkView into every Claude Code session:
claude mcp add --transport stdio --scope user markview -- npx mcp-server-markview
That's it. Claude can now call preview_markdown to render any markdown string in a native macOS window, or open_file to open any .md file directly.
| Tool | What it does |
|---|---|
preview_markdown | Render markdown content in a live-reloading MarkView window |
open_file | Open an existing .md file in MarkView |
Claude Desktop Setup
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"markview": {
"command": "npx",
"args": ["mcp-server-markview"]
}
}
}
Note: MCP servers belong in
~/.claude.json(Claude Code) orclaude_desktop_config.json(Claude Desktop), not~/.claude/settings.json.
Installation
Homebrew (recommended)
# Full .app with Quick Look extension — Apple notarized, Gatekeeper approved
brew install --cask paulhkang94/markview/markview
# CLI only (builds from source)
brew tap paulhkang94/markview
brew install markview
Build from source
Prerequisites: macOS 14+, Swift 6.0+ (Xcode Command Line Tools)
git clone https://github.com/paulhkang94/markview.git
cd markview
swift build -c release
Install as app (Open With support)
bash scripts/bundle.sh --install
Creates MarkView.app in /Applications and registers it with Launch Services for right-click > Open With in Finder.
Install CLI
bash scripts/install-cli.sh
Creates mdpreview and md symlinks in ~/.local/bin/.
Usage
CLI
mdpreview README.md # Open a file
mdpreview # Open empty editor
Finder
Right-click any .md, .markdown, .mdown, .mkd file > Open With > MarkView
Programmatic
open -a MarkView README.md
Features
- GitHub Flavored Markdown via swift-cmark (tables, strikethrough, autolinks, task lists, footnotes)
- Mermaid diagrams — flowcharts, sequence, Gantt, ER, and pie charts
- Syntax highlighting via Prism.js (18 languages)
- Quick Look integration — spacebar-preview
.mdfiles in Finder without opening the app - Markdown linting with 9 built-in rules and status bar diagnostics
- Live split-pane editor with WKWebView rendering and bidirectional scroll sync
- File watching with DispatchSource — works with VS Code, Vim, and other editors
- Local image rendering — inlines relative paths like
correctly - Export to HTML and PDF
- HTML sanitizer — strips scripts, event handlers, and XSS vectors
- Drag and drop — drop any
.mdfile onto the window to open - Find & Replace — Cmd+F / Cmd+Option+F
- Format on save — auto-applies lint fixes
- Auto-save, word count, line numbers, scroll position preservation
- Dark mode — system/light/dark theme options, 18 configurable settings
Architecture
Sources/MarkViewCore/ # Library (no UI, fully testable)
MarkdownRenderer.swift # cmark-gfm C API wrapper
FileWatcher.swift # DispatchSource file monitoring
MarkdownLinter.swift # 9-rule pure Swift linting engine
HTMLSanitizer.swift # XSS prevention
LanguagePlugin.swift # Plugin protocol + registry
Plugins/ # CSV, HTML, Markdown plugins
Sources/MarkView/ # SwiftUI app (macOS 14+)
ContentView.swift # Split-pane editor + preview
WebPreviewView.swift # WKWebView with Prism.js
ExportManager.swift # HTML/PDF export
Sources/MarkViewMCPServer/ # MCP server for AI tool integration
main.swift # stdio JSON-RPC (preview_markdown, open_file)
Tests/TestRunner/ # 403 standalone tests (no XCTest)
Tests/VisualTester/ # 5 visual regression tests + WCAG contrast
Tests/FuzzTester/ # 10K random input crash testing
Tests/DiffTester/ # Differential testing vs cmark-gfm CLI
See docs/ARCHITECTURE.md for full details.
Testing
swift run MarkViewTestRunner # 403 tests
python3 scripts/verify.py # Full verification (build + tests, writes stamp)
python3 scripts/verify.py --extended # + fuzz + differential
bash scripts/test-mcp.sh # MCP protocol tests
Development
swift build
swift run MarkView
swift run MarkView /path/to/file.md
Support
- GitHub Sponsors
- Star this repo to help others find it
License
MIT — see LICENSE.
常见问题
MarkView 是什么?
在原生 macOS 应用中预览 Markdown,支持 live reload 与 GFM rendering。
相关 Skills
技能工坊
by anthropics
覆盖 Skill 从创建到迭代优化全流程:起草能力、补测试提示、跑评测与基准方差分析,并持续改写内容和描述,提升效果与触发准确率。
✎ 技能工坊把技能从创建、迭代到评测串成闭环,方差分析加描述优化,特别适合把触发准确率打磨得更稳。
PPT处理
by anthropics
处理 .pptx 全流程:创建演示文稿、提取和解析幻灯片内容、批量修改现有文件,支持模板套用、合并拆分、备注评论与版式调整。
✎ 涉及PPTX的创建、解析、修改到合并拆分都能一站搞定,连备注、模板和评论也能处理,做演示文稿特别省心。
PDF处理
by anthropics
遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。
✎ PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。
相关 MCP Server
文件系统
编辑精选by Anthropic
Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。
✎ 这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。
by wonderwhy-er
Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。
✎ 这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。
by stickerdaniel
LinkedIn Profile and Job Scraper 是让 Claude 直接抓取 LinkedIn 个人资料、公司信息和职位详情的工具。
✎ 这个服务器解决了招聘和商业调研中手动复制粘贴 LinkedIn 数据的痛点,适合猎头或市场分析师快速获取候选人背景和公司动态。不过,LinkedIn 反爬机制频繁更新,数据稳定性需要持续维护,使用时建议搭配人工验证。

