markview
Native macOS markdown previewer. Opens files and renders markdown content in a live preview window directly from your AI tools.
README
MarkView
A native macOS markdown preview app built with Swift and SwiftUI. No Electron, no web server — just a fast, lightweight previewer that renders GitHub Flavored Markdown.
Demo

<a href="https://glama.ai/mcp/servers/@paulhkang94/markview"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@paulhkang94/markview/badge" alt="markview MCP server" /> </a>
Screenshots
| Preview only | Editor + Preview |
|---|---|
![]() |
![]() |
Features
- Live preview with split-pane editor and WKWebView rendering
- GitHub Flavored Markdown via Apple's swift-cmark (tables, strikethrough, autolinks, task lists)
- Syntax highlighting for 18 languages via Prism.js
- Markdown linting with 9 built-in rules and status bar diagnostics
- File watching with DispatchSource (works with VS Code, Vim, and other editors)
- Multi-format support via plugin architecture (Markdown, CSV, HTML)
- HTML sanitizer that strips scripts, event handlers, and XSS vectors
- Mermaid diagrams — flowcharts, sequence, Gantt, ER, and pie charts via mermaid.js
- Bidirectional scroll sync — frame-perfect editor/preview sync via CADisplayLink
- Local image rendering — correctly inlines relative paths like
 - Drag and drop — drop any
.mdfile onto the window to open - Find & Replace — Cmd+F to find, Cmd+Option+F to find and replace
- Format on save — auto-applies markdown lint fixes when saving
- Window auto-resize — smart resize when toggling editor/preview panes
- Export to HTML and PDF
- Dark mode support with system/light/dark theme options
- 18 configurable settings including font, preview width, tab behavior, and more
Installation
Homebrew (recommended)
# Full .app with Quick Look extension
brew install --cask paulhkang94/markview/markview
# CLI only (builds from source)
brew tap paulhkang94/markview
brew install markview
The app is Apple notarized and Gatekeeper approved — no quarantine warnings on install.
Build from source
Prerequisites: macOS 14+, Swift 6.0+ (included with 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
This creates MarkView.app in /Applications and registers it with Launch Services. You can then right-click any .md file in Finder and choose Open With > MarkView.
Install CLI commands
bash scripts/install-cli.sh
This creates mdpreview and md symlinks in ~/.local/bin/. Note: if md is aliased in your shell (e.g., to mkdir), use mdpreview instead.
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
MCP Server (AI Integration)
MarkView includes an MCP server that lets AI assistants preview markdown directly in MarkView.
Tools
| Tool | Description |
|---|---|
preview_markdown |
Write content to a temp file and open it in MarkView with live reload |
open_file |
Open an existing .md file in MarkView |
Quick Start (npx)
npx mcp-server-markview
Claude Code Setup
Add to ~/.claude/settings.json:
{
"mcpServers": {
"markview": {
"command": "npx",
"args": ["mcp-server-markview"],
"type": "stdio"
}
}
}
Or use the built binary directly (faster startup, no Node.js required):
{
"mcpServers": {
"markview": {
"command": "/path/to/markview/.build/release/MarkViewMCPServer",
"type": "stdio"
}
}
}
Claude Desktop Setup
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"markview": {
"command": "npx",
"args": ["mcp-server-markview"]
}
}
}
Test the MCP server
bash scripts/test-mcp.sh
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
MarkdownSuggestions.swift # Auto-suggest engine
LanguagePlugin.swift # Plugin protocol + registry
HTMLSanitizer.swift # XSS prevention
Plugins/ # CSV, HTML, Markdown plugins
Sources/MarkView/ # SwiftUI app (macOS 14+)
ContentView.swift # Split-pane editor + preview
WebPreviewView.swift # WKWebView with Prism.js
Settings.swift # 18 settings with theme/width/font enums
ExportManager.swift # HTML/PDF export
Sources/MarkViewMCPServer/ # MCP server for AI tool integration
main.swift # stdio JSON-RPC server (preview_markdown, open_file)
Tests/TestRunner/ # 382 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
scripts/test-mcp.sh # 5 MCP protocol + integration tests
See docs/ARCHITECTURE.md for full details.
Testing
# Run all tests (382 tests)
swift run MarkViewTestRunner
# Full verification (build + tests)
bash verify.sh
# Extended (fuzz + differential)
bash verify.sh --extended
Development
swift build # Build all targets
swift run MarkView # Launch app
swift run MarkView /path/to/file.md # Launch with file
swift run MarkViewTestRunner # Run tests
Support
If MarkView is useful to you, consider supporting development:
- GitHub Sponsors
- Star this repo to help others find it
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

