Skip to main content
Glama

md-redline

npm version

Встроенные комментарии для рецензирования спецификаций, промптов и дизайн-документов в формате markdown.

Выделяйте текст в отрендеренном документе, оставляйте комментарии, и ваш ИИ-агент сможет прочитать их и напрямую отреагировать. Комментарии сохраняются как невидимые HTML-маркеры прямо в файле .md. Никаких сторонних файлов, баз данных или внешних сервисов. Markdown-файл остается единственным источником истины.

Благодаря встроенному MCP-серверу ваш агент может запросить проверку в процессе выполнения задачи и приостановиться, пока вы не нажмете Send review. Вы оставляете отзыв, агент продолжает работу с того места, где остановился. Никакого копирования-вставки и переключения контекста.

md-redline screenshot

Посмотрите на рабочий процесс рецензирования за 30 секунд:

https://github.com/user-attachments/assets/7f493201-3aca-489c-86f0-3a7df454f693

Работает с Claude Code, Claude Desktop, Codex CLI, Gemini CLI и любым другим MCP-клиентом, поддерживающим stdio-серверы. Как утверждает Шон Гроув в specs are the new code, спецификации становятся основной единицей работы в агентской разработке. mdr предоставляет для этого рабочего процесса инструменты рецензирования, аналогичные проверке кода.

Быстрый старт

Предварительные требования: Node 20 или новее.

npx md-redline /path/to/spec.md

Это запустит локальное приложение при необходимости и откроет его в вашем браузере.

Или установите глобально:

npm install -g md-redline
mdr /path/to/spec.md        # Open a file
mdr /path/to/dir             # Open a directory
mdr --stop                   # Stop the running server

md-redline также работает как псевдоним для mdr.

Related MCP server: pad-core

Настройка MCP

Зарегистрируйте MCP-сервер в вашем агенте, чтобы он мог запрашивать проверку в процессе выполнения задачи.

Claude Code или Claude Desktop

mdr mcp install                   # register with both clients (default)
mdr mcp install --claude-code     # just Claude Code (via `claude mcp add`)
mdr mcp install --claude-desktop  # just Claude Desktop (JSON config file)

Codex CLI

codex mcp add md-redline -- mdr mcp

Gemini CLI

gemini mcp add --scope user md-redline mdr mcp

Флаг --scope user важен. Gemini по умолчанию использует область видимости для каждого проекта, что регистрирует mdr только для текущей директории.

Другие MCP-клиенты

Добавьте эту запись сервера в файл конфигурации MCP вашего клиента:

{
  "mcpServers": {
    "md-redline": {
      "command": "mdr",
      "args": ["mcp"]
    }
  }
}

Предварительные требования: mdr должен находиться в вашем PATH (например, через npm install -g md-redline). Если ваш клиент запускает подпроцессы, не наследуя PATH вашей оболочки, используйте абсолютный путь из which mdr в качестве значения command.

Рабочий процесс рецензирования

С использованием MCP (рекомендуется)

После регистрации попросите вашего агента запросить проверку:

"Let me review docs/specs/feature-x.md in mdr before you continue."

Агент вызывает mdr_request_review, mdr открывает файл, вы выделяете текст и оставляете комментарии, затем нажимаете Send review. Агент получает ваш отзыв в виде структурированного промпта и начинает обрабатывать ваши комментарии. Рецензирование происходит по запросу. Агент приостанавливается только тогда, когда вы его об этом просите.

Без MCP

  1. Откройте markdown-файл с помощью mdr /path/to/spec.md.

  2. Выделите текст и оставьте встроенные комментарии.

  3. Скопируйте промпт для передачи.

  4. Вставьте промпт в ваш ИИ-агент.

  5. Агент редактирует файл, обрабатывает отзыв и удаляет обработанные маркеры комментариев.

  6. Проверьте результат в режиме сравнения (diff).

Опционально: рабочий процесс разрешения

Включите режим разрешения (resolve mode) в настройках для рецензирования человеком с явными состояниями open (открыто) и resolved (разрешено).

Для кого это

  • Люди, пишущие спецификации, промпты или дизайн-документы локально с помощью файловых ИИ-агентов

  • Команды, проверяющие документы перед их коммитом или отправкой на более широкое рецензирование

  • Все, кто находится в цикле редактирования человек + агент и хочет получать структурированную встроенную обратную связь в обычных файлах

Не является целью

  • Не является инструментом для совместного многопользовательского редактирования.

  • Не является заменой для PR-ревью на GitHub (используйте их, когда файл уже в git).

  • Не предназначено для недоверенного контента. Это локальный инструмент разработки для ваших собственных файлов.

Как хранятся комментарии

Комментарии хранятся как невидимые HTML-маркеры непосредственно в markdown, сразу перед текстом, к которому они относятся, поэтому и люди, и агенты могут работать с одним и тем же файлом.

Some text <!-- @comment{
  "id":"uuid",
  "anchor":"highlighted text",
  "text":"Rewrite this section to be clearer.",
  "author":"User",
  "timestamp":"2026-03-26T12:00:00.000Z",
  "replies":[]
} -->highlighted text continues here.

Это делает обратную связь:

  • видимой для ИИ-агентов через обычное чтение файла

  • переносимой вместе с markdown-файлом

  • невидимой в обычных рендерерах (GitHub, предварительный просмотр в VS Code)

Функции

Рецензирование и комментирование

  • Встроенные комментарии, привязанные к отрендеренному тексту, включая перекрывающиеся комментарии

  • Потоковые ответы и опциональные состояния рецензирования open / resolved

  • Регулируемые якоря с маркерами перетаскивания

  • Режимы просмотра: отрендеренный, исходный код и diff

  • Копирование промпта для передачи для одного или нескольких файлов

Навигация и редактирование

  • Редактирование с несколькими вкладками, сохранением сессии и контекстными меню вкладок

  • Проводник файлов, недавние файлы и системный выбор файлов ОС

  • Поиск в документе (Cmd+F) с навигацией по совпадениям

  • Оглавление с отслеживанием прокрутки

  • Палитра команд (Cmd+K), сочетания клавиш и панель настроек (Cmd+,)

  • Изменяемые панели и контекстные меню по правому клику

Рендеринг и интеграции

  • Перезагрузка в реальном времени через SSE при внешнем изменении файлов

  • Рендеринг диаграмм Mermaid с возможностью комментирования текста

  • Встраивание локальных изображений и кликабельные ссылки между markdown-файлами

  • Настраиваемые шаблоны комментариев

  • 8 тем: Light, Dark, Sepia, Nord, Solarized, GitHub, Rosé Pine, Catppuccin

Поддерживаемые платформы

  • macOS: поддерживается

  • Linux: поддерживается; системный выбор файлов требует zenity

  • Windows: поддерживается; системный выбор файлов использует PowerShell

Разрешения

По умолчанию md-redline может читать любой markdown-файл в вашей домашней директории. При первом запуске mdr (или при первом запуске после обновления с версии без функции доверенных корней) ваша домашняя папка добавляется в список доверенных корней в ~/.md-redline.json. Файлы вне вашей домашней директории (/tmp, смонтированные тома, системные пути) требуют явного предоставления разрешения через системный выбор папок при первом их открытии. Предоставленные папки запоминаются после перезапуска.

Чтобы использовать строгую модель для каждой папки, запустите mdr --restrict один раз после установки. Это создаст ~/.md-redline.json без доверия по умолчанию, и вы будете предоставлять доступ к каждой папке явно при первом открытии файла в ней.

Сохранение файлов использует атомарную запись с последующим переименованием и обнаружение конфликтов на основе времени изменения (mtime) для предотвращения потери данных при одновременном редактировании. Вывод Mermaid SVG очищается через DOMPurify перед рендерингом. Запускайте md-redline только в тех средах, которым вы доверяете.

Разработка

Из исходного кода

git clone https://github.com/dejuknow/md-redline.git
cd md-redline
npm install
npm run dev

Откройте локальный URL, выведенный Vite (обычно http://localhost:5188).

Скрипты

npm run dev          # Start dev server
npm run lint         # Lint
npm test             # Production build + unit tests
npm run test:e2e     # Playwright E2E tests
npm run build        # Production build

Оценка агента

Инструментарий оценки проверяет, правильно ли ИИ-агенты читают, обрабатывают и удаляют встроенные комментарии.

  • npm run eval:dry проверяет фикстуры оценки

  • npm run eval запускает полный инструментарий оценки

  • Подробности см. в eval/README.md

Архитектура

bin/md-redline             CLI entry point (invoked as `mdr` or `md-redline`)
server/index.ts            Hono server for file I/O, browsing, SSE, and local integrations
src/App.tsx                Main application shell
src/components/            Viewer, sidebar, raw view, diff view, TOC, explorer, settings, etc.
src/hooks/                 State, persistence, selection, file watching, drag handles, tabs
src/lib/comment-parser.ts  Inline comment parsing and mutation helpers
src/markdown/pipeline.ts   Markdown rendering pipeline
eval/                      Eval harness for agent behavior against inline comments
e2e/                       Playwright end-to-end coverage

Лицензия

MIT

Available Tools

6 tools
mdr_add_filesA

Add markdown files to a review session that is already open in mdr (md-redline), without starting a new one. Use it when the reviewer asks for another file mid-review, or when you need to comment on a file the session does not cover yet. Works for sessions from mdr_request_review and mdr_comment alike. The reviewer's mdr tab opens the new files. Returns immediately; carry on with the same sessionId as before. A session that has ended cannot take more files: start a new review instead.

Inputs: filePaths (required), sessionId (required).

mdr_askA

Ask the user one or more questions anchored to specific text in a file inside an active review session. Each question becomes an inline marker the user sees and can reply to in the md-redline UI. Returns with the reply text as soon as the user has answered every question, or with whatever partial replies exist when they finish the review (Done / Finish review), or empty-handed if the session ends another way. Replies also land in the marker threads on disk, so when this tool returns without reply text you should re-read the file(s) before concluding the user did not answer. Use this when a comment is unclear, or when you hit a planning fork while editing. Prefer asking over guessing when the right answer would meaningfully change your edit.

Only one mdr_ask can be pending per session at a time. If this returns "a previous mdr_ask is still pending", post a reply to the prior question via mdr_comment — pass this same sessionId plus a replies: payload targeting that commentId, which resolves the pending ask in-place without opening a second session — and then retry mdr_ask with your new questions.

Inputs: questions (required), sessionId (required).

mdr_baselineA

Call this BEFORE you edit markdown files the user will later review in mdr (md-redline). It saves a copy of each file as it is right now so the reviewer's diff can show exactly what you changed. Returns immediately. Include files you are about to create (their folder must already exist); they are saved as empty. Do not call it after you have already edited a file: the copy would already contain your changes. Workflow: mdr_baseline (before editing) -> edit the files -> mdr_request_review. At most 64 files per call. If the reviewer already has a before point for a file from an earlier handoff or review, that one is kept.

Inputs: filePaths (required), agentName.

mdr_commentA

Post YOUR OWN comments into markdown files for the user to read. Use this when the user asks YOU to review a doc and leave feedback on it.

If instead the user wants to review a doc THEMSELVES and have you address what they write ("I want to review X in mdr", "let me review X", "open X so I can comment"), call mdr_request_review, NOT this tool. The word "review" in those requests describes what the user is about to do, not what you should do. This tool writes your comments into their file, which is the opposite of what they asked for.

Returns IMMEDIATELY after posting (never blocks). In the filePaths form the returned sessionId MUST be passed to mdr_wait afterward to block until the user clicks Done — that is a two-tool flow: mdr_comment (post) → mdr_wait (block). This does NOT apply to the sessionId form below, which posts into a session you did not open; mdr_wait rejects user-origin sessions. Skipping mdr_wait leaves a banner on the user's screen until they click Done; you will not see their replies or edits before continuing, and any user feedback will be invisible to you for this turn.

The comments appear as inline markers anchored to specific text, which the user can then address.

Comments are anchored to exact text in the rendered document (not the raw markdown). For text inside Mermaid diagrams or markdown-formatted spans, the renderer will fall back to label/stripped matching.

Include author on each comment/reply identifying yourself (e.g. 'Claude', 'Codex', 'Gemini'). This appears in the mdr UI so the user knows which agent left the feedback.

To reply inside a review the user already has open — the session from an mdr_request_review handoff, or one this tool returned earlier — pass sessionId instead of filePaths. The batch lands in that session and no second tab or banner appears. Use it whenever you are replying as you work rather than posting a fresh review; the filePaths form always opens its own session.

Inputs: replies, comments, filePaths, sessionId, +1 more.

mdr_request_reviewA

Open markdown files in mdr (md-redline) so the USER can review them and leave comments for you to address, or continue an existing review session. Use this whenever the user wants to read, review, or comment on a doc themselves, including phrasings like "I want to review X in mdr", "open X so I can comment", or "let me look at X". The user is the reviewer here; you wait and then address what they write. To start a new review, pass filePaths. If you are about to edit or create files the user will review, call mdr_baseline before touching them so the user can see a diff of your changes. Calling it after you have edited does not help: the copy would already include your edits. To continue after addressing a batch of comments, or to re-poll while the user is still reviewing, pass the sessionId from the previous result (without filePaths). If the result says the user has not finished yet, call again with the same sessionId to keep waiting. IMPORTANT: while this tool is waiting (no "batch" or "done" result has arrived yet, or you are between batches), you do not have permission to read, open, edit, or otherwise act on the files under review using other tools. The user is actively writing @comment markers into those files; reading them yourself will surface unsubmitted markers you must not address. Once a "batch" or "done" result arrives you may read/edit the files, but only to address the comments listed in that result — ignore any other @comment markers you encounter in the file.

Inputs: filePaths, sessionId, enableResolve.

mdr_waitA

Block until the user has finished engaging with an mdr_comment session. Call this once after you have posted all your feedback batches via mdr_comment. Returns when the user clicks Done in the mdr UI. If the wait times out (90s), returns {status:"pending"} — call mdr_wait again with the same sessionId to keep waiting. After this returns {status:"done"}, read the file(s) to see the user's replies, deletions, and resolutions.

Inputs: sessionId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 6 tools

    Disambiguation4/5

    The tools are mostly distinct: mdr_request_review is for user-led review, mdr_comment for agent-led feedback, mdr_ask for questions, and the others each have a clear single purpose. mdr_request_review and mdr_comment could be confused at a glance since both involve 'review', but the descriptions explicitly and thoroughly disambiguate them.

    Naming Consistency4/5

    All tools share the mdr_ prefix and snake_case convention, which gives a strong cohesive feel. However, the suffixes mix patterns: verb_noun (request_review, add_files), a noun used as verb (baseline), and bare verbs (ask, comment, wait), so the verb_noun pattern is not uniform.

    Tool Count5/5

    Six tools is well-scoped for a review-collaboration domain. Each tool covers a distinct step in the workflow—starting/continuing reviews, adding files, baselining, asking, commenting, and waiting—without redundancy or bloat.

    Completeness5/5

    The tool set covers the full lifecycle of both review directions: user reviewing with agent addressing (request_review, baseline, add_files, ask, comment) and agent reviewing for the user (comment, wait). No obvious dead ends or missing operations for the stated purpose.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      MCP server for collaborative markdown editing, allowing agents to write documents and humans to comment, with comments fed back as agent input.
      MIT