MarkView

io.github.paulhkang94由 GitHub 帳號 paulhkang94 發布v1.7.2更新於 Oct 24, 2026

Native macOS markdown preview with MCP server for Claude Code. Swift/SwiftUI, no Electron.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

讓助手在原生 macOS MarkView 預覽視窗中渲染 Markdown 字串或開啟 .md 檔案。

可以做什麼
MarkView 是一款原生 macOS Markdown 預覽應用程式,附帶一個小型 MCP 伺服器,提供兩個工具:preview_markdown 在可即時更新的 MarkView 視窗中渲染 Markdown 字串,open_file 則在應用程式中開啟既有的 .md 檔案。渲染支援 GitHub 風格 Markdown、Mermaid 圖表、語法突顯與本機圖片路徑。應用程式本身也提供分割窗格編輯器、語法檢查與 HTML/PDF 匯出。
適用情境
適合在 macOS 上使用 Claude Code 或 Claude Desktop,並希望把 Markdown 輸出顯示在原生視窗而非終端機或瀏覽器分頁時使用。特別適合邊寫邊檢視產生的文件、README 或筆記。
執行需求
需要 macOS 14 或更新版本,並安裝 MarkView 應用程式(建議使用 Homebrew cask,或以 Swift 6.0+ 與 Xcode 命令列工具從原始碼建置)。MCP 伺服器透過 npx mcp-server-markview 以 stdio 在本機執行,因此需要 Node.js。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
此伺服器僅限桌面端且僅支援 macOS,無法在其他平台或瀏覽器中執行。open_file 會開啟本機檔案,preview_markdown 會把內容顯示在視窗中,因此在共用或螢幕可見的機器上應避免指向敏感檔案。應用程式與 npm 封裝套件各自獨立發布版本,兩者可能不一致。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MarkView,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MarkView

[App] [npm] [Glama]

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 (app badge) and the npm MCP wrapper (npm badge) 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.

[MarkView demo]

Preview onlyEditor + Preview
[Preview][Editor + Preview]

Quick Start — Claude Code

One command to wire MarkView into every Claude Code session:

bash
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.

ToolWhat it does
preview_markdownRender markdown content in a live-reloading MarkView window
open_fileOpen an existing .md file in MarkView

Claude Desktop Setup

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "markview": {      "command": "npx",      "args": ["mcp-server-markview"]    }  }}

Note: MCP servers belong in ~/.claude.json (Claude Code) or claude_desktop_config.json (Claude Desktop), not ~/.claude/settings.json.

Installation

Homebrew (recommended)

bash
# Full .app with Quick Look extension — Apple notarized, Gatekeeper approvedbrew install --cask paulhkang94/markview/markview
# CLI only (builds from source)brew tap paulhkang94/markviewbrew install markview

Build from source

Prerequisites: macOS 14+, Swift 6.0+ (Xcode Command Line Tools)

bash
git clone https://github.com/paulhkang94/markview.gitcd markviewswift build -c release

Install as app (Open With support)

bash
bash scripts/bundle.sh --install

Creates MarkView.app in /Applications and registers it with Launch Services for right-click > Open With in Finder. Refuses (unless you pass --force) if a Dock tile is pinned to a build/ or repo-root MarkView.app path, since both are ephemeral dev output.

Install CLI

bash
bash scripts/install-cli.sh

Creates mdpreview and md symlinks in ~/.local/bin/.

Usage

CLI

bash
mdpreview README.md       # Open a filemdpreview                 # Open empty editor

Finder

Right-click any .md, .markdown, .mdown, .mkd file > Open With > MarkView

Programmatic

bash
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 .md files 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 ![](./image.png) correctly
  • Export to HTML and PDF
  • HTML sanitizer — strips scripts, event handlers, and XSS vectors
  • Drag and drop — drop any .md file 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 contrastTests/FuzzTester/               # 10K random input crash testingTests/DiffTester/               # Differential testing vs cmark-gfm CLI

See docs/ARCHITECTURE.md for full details.

Testing

bash
swift run MarkViewTestRunner    # 403 testspython3 scripts/verify.py       # Full verification (build + tests, writes stamp)python3 scripts/verify.py --extended  # + fuzz + differentialbash scripts/test-mcp.sh        # MCP protocol tests

Development

bash
swift buildswift run MarkViewswift run MarkView /path/to/file.md

Support

License

MIT — see LICENSE.

來源:README.md,提交 523804c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.7.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分