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 分