MCP support for comment lifecycle: list, create, reply, resolve and reopen

オープン
#442 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発

調査の方向性

The issue proposes extending the HackMD MCP server and REST API. Start by examining the existing MCP server codebase and the REST API routes for notes. Look for models or services handling comments. The first step is to understand the current data structures and permissions. 'Done' means implementing the proposed endpoints and MCP tools as described, likely across multiple files including server routes, MCP tool definitions, and comment service logic.

索引モデルが issue の本文から書いたものです。

説明

Problem

HackMD provides native inline and page-level comments, replies, reactions,
pinning and comment resolution in the web interface.

However, comments are currently not accessible through:

  • the official HackMD MCP server,
  • the public REST API,
  • hackmd-cli,
  • GitHub synchronization or exports.

Because of this, AI agents can edit a note through MCP, but they cannot:

  1. discover unresolved review comments,
  2. understand the requested changes,
  3. respond to the reviewer,
  4. resolve the comment after updating the note.

This prevents an end-to-end AI-assisted documentation review workflow.

Related issues:

  • #428 – API and export support for comments and reactions
  • #207 – Sync/export comments as a separate JSON file

This request extends those proposals to the complete comment lifecycle
and the official HackMD MCP server.

Use case

A reviewer adds a comment to a HackMD note.

An AI agent connected through the official HackMD MCP server should be able to:

  1. list unresolved comments,
  2. retrieve the comment thread and referenced document location,
  3. update the Markdown note,
  4. reply with a description of the implemented change,
  5. mark the comment as resolved.

The same workflow should work from Claude Code, ChatGPT, Cursor and other
MCP-compatible clients.

Proposed REST API

Read comments

GET /v1/notes/:noteId/comments
GET /v1/notes/:noteId/comments/:commentId

Optional filters:

  • status=open|resolved|hidden
  • type=page|inline
  • includeReplies=true
Create comments and replies

POST /v1/notes/:noteId/comments
POST /v1/notes/:noteId/comments/:commentId/replies

Manage comment state

POST /v1/notes/:noteId/comments/:commentId/resolve
POST /v1/notes/:noteId/comments/:commentId/reopen

Optionally:

POST /v1/notes/:noteId/comments/:commentId/pin
POST /v1/notes/:noteId/comments/:commentId/unpin
POST /v1/notes/:noteId/comments/:commentId/hide

Proposed MCP tools

  • list-comments
  • get-comment
  • create-comment
  • reply-to-comment
  • resolve-comment
  • reopen-comment

Optional tools:

  • pin-comment
  • unpin-comment
  • hide-comment

Example:

list-comments:
noteId: string
status: open | resolved | all
includeReplies: boolean

reply-to-comment:
noteId: string
commentId: string
content: string

resolve-comment:
noteId: string
commentId: string
resolutionMessage: string (optional)

Inline comment anchoring

Inline comments should expose both:

  • the selected text,
  • a document range or stable anchor.

Example response:

{
"id": "comment-id",
"type": "inline",
"body": "Please explain this behavior.",
"selectedText": "The service creates a new task.",
"range": {
"startLine": 42,
"endLine": 43
},
"status": "open",
"author": {
"id": "user-id",
"name": "Reviewer"
},
"createdAt": "2026-09-23T10:30:00Z",
"replies": []
}

Because line numbers can change during collaborative editing, a stable
internal anchor should preferably be included as well.

Permissions and safety

All REST API and MCP operations should respect existing HackMD permissions.

Suggested behavior:

  • readers can only retrieve comments they are allowed to see,
  • commenters can create comments and replies,
  • writers and above can resolve or reopen comments,
  • all operations preserve author and audit information,
  • destructive or state-changing MCP tools clearly identify write operations.

Suggested implementation phases

Phase 1
  • list and read comments,
  • page-level comments,
  • replies,
  • resolve and reopen.
Phase 2
  • create inline comments,
  • stable document anchors,
  • reactions, pinning and hiding,
  • export and GitHub synchronization.

Why this belongs in MCP

HackMD's official MCP already allows AI agents to read and update note
content. Comment support would complete the review workflow and allow
agents to act on human feedback without copying comments manually into
the AI conversation.

主要言語
言語のデータがありません
スター
40
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackmdio/hackmd-io-issues のほかの issue

hackmdio/hackmd-io-issues の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。