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

Merged
aleleba merged 1 commits from feat/comment-support into main 2026-05-30 20:46:36 -06:00
Owner

Summary

Adds 6 new MCP tools for managing Docmost page comments. Replaces PR #3 which had a broken head: main reference.

  • list_comments — List all comments on a page (content as Markdown)
  • get_comment — Retrieve a single comment by ID
  • create_comment — Create page-level or inline comment (Markdown input, auto-converted to ProseMirror JSON)
  • update_comment — Update comment content (creator only)
  • delete_comment — Delete a comment (creator or space admin)
  • check_new_comments — Poll for new comments across a space since a given timestamp

New files

  • src/lib/markdown-to-json.tsmarkdownToTiptapJson() utility (Markdown → TipTap JSON via marked + generateJSON)

Modified files

  • src/lib/filters.ts — new filterComment() function
  • src/index.ts — imports, 6 client methods, 6 registered MCP tools
  • README.md — documentation for comment tools

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
  • check_new_comments returns only comments created after the given timestamp

🤖 Generated with Claude Code

## Summary Adds 6 new MCP tools for managing Docmost page comments. Replaces PR #3 which had a broken `head: main` reference. - `list_comments` — List all comments on a page (content as Markdown) - `get_comment` — Retrieve a single comment by ID - `create_comment` — Create page-level or inline comment (Markdown input, auto-converted to ProseMirror JSON) - `update_comment` — Update comment content (creator only) - `delete_comment` — Delete a comment (creator or space admin) - `check_new_comments` — Poll for new comments across a space since a given timestamp ## New files - `src/lib/markdown-to-json.ts` — `markdownToTiptapJson()` utility (Markdown → TipTap JSON via `marked` + `generateJSON`) ## Modified files - `src/lib/filters.ts` — new `filterComment()` function - `src/index.ts` — imports, 6 client methods, 6 registered MCP tools - `README.md` — documentation for comment tools ## 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 - [ ] `check_new_comments` returns only comments created after the given timestamp 🤖 Generated with [Claude Code](https://claude.com/claude-code)
aleleba added 1 commit 2026-05-30 20:46:20 -06:00
Adds 6 new MCP tools for managing Docmost page comments:
- list_comments: list all comments on a page (content as Markdown)
- get_comment: retrieve a single comment by ID
- create_comment: create page-level or inline comment (Markdown input)
- update_comment: update comment content (creator only)
- delete_comment: delete a comment (creator or space admin)
- check_new_comments: poll for new comments since a timestamp

Implementation details:
- New markdownToTiptapJson() utility in src/lib/markdown-to-json.ts
- New filterComment() in src/lib/filters.ts
- Supports inline comments, threaded replies via parentCommentId
- README updated with comment tools documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
aleleba merged commit a8b40641ac into main 2026-05-30 20:46:36 -06:00
Sign in to join this conversation.