feat: add comment support (list, get, create, update, delete) #3

Closed
ITSalt wants to merge 3 commits from ITSalt/feat/comment-support into main
ITSalt commented 2026-03-10 03:34:14 -06:00 (Migrated from github.com)

Summary

  • Add 5 new MCP tools for managing Docmost page comments: list_comments, get_comment, create_comment, update_comment, delete_comment
  • Comment content is automatically converted between Markdown (agent-facing) and ProseMirror/TipTap JSON (Docmost API format)
  • Supports page-level comments, inline (text selection) comments, and threaded replies via parentCommentId

New Tools

Tool Description
list_comments List all comments on a page (paginated), content as Markdown
get_comment Retrieve a single comment by ID
create_comment Create a page or inline comment. Accepts Markdown, converts to ProseMirror JSON
update_comment Update comment content (creator only)
delete_comment Delete a comment (creator or space admin)

Implementation Details

  • Uses Docmost's internal /comments/* API endpoints (available in open-source core)
  • Reuses existing convertProseMirrorToMarkdown() for reading comments
  • New markdownToTiptapJson() utility (via marked + @tiptap/html generateJSON) for writing
  • New filterComment() in filters.ts for consistent response formatting
  • All tools follow the existing registerTool() pattern

Test plan

  • list_comments returns comments for a page with Markdown content
  • get_comment returns a single comment with correct fields
  • create_comment creates a page-level comment visible in Docmost UI
  • create_comment with type: "inline" and selection creates inline comment
  • create_comment with parentCommentId creates a reply
  • update_comment updates comment content
  • delete_comment removes the comment

🤖 Generated with Claude Code

## Summary - Add 5 new MCP tools for managing Docmost page comments: `list_comments`, `get_comment`, `create_comment`, `update_comment`, `delete_comment` - Comment content is automatically converted between **Markdown** (agent-facing) and **ProseMirror/TipTap JSON** (Docmost API format) - Supports page-level comments, inline (text selection) comments, and threaded replies via `parentCommentId` ## New Tools | Tool | Description | |------|-------------| | `list_comments` | List all comments on a page (paginated), content as Markdown | | `get_comment` | Retrieve a single comment by ID | | `create_comment` | Create a page or inline comment. Accepts Markdown, converts to ProseMirror JSON | | `update_comment` | Update comment content (creator only) | | `delete_comment` | Delete a comment (creator or space admin) | ## Implementation Details - Uses Docmost's internal `/comments/*` API endpoints (available in open-source core) - Reuses existing `convertProseMirrorToMarkdown()` for reading comments - New `markdownToTiptapJson()` utility (via `marked` + `@tiptap/html generateJSON`) for writing - New `filterComment()` in `filters.ts` for consistent response formatting - All tools follow the existing `registerTool()` pattern ## Test plan - [ ] `list_comments` returns comments for a page with Markdown content - [ ] `get_comment` returns a single comment with correct fields - [ ] `create_comment` creates a page-level comment visible in Docmost UI - [ ] `create_comment` with `type: "inline"` and `selection` creates inline comment - [ ] `create_comment` with `parentCommentId` creates a reply - [ ] `update_comment` updates comment content - [ ] `delete_comment` removes the comment 🤖 Generated with [Claude Code](https://claude.com/claude-code)
aleleba closed this pull request 2026-05-30 20:46:25 -06:00

Pull request closed

Sign in to join this conversation.