Add notification_read and notification_write tools

Add notification management via two new MCP tools using the
method-dispatch pattern:

- `notification_read`: list notifications (global or repo-scoped,
  with status/subject_type/since/before filters) and get single
  notification thread by ID
- `notification_write`: mark single notification as read, mark all
  notifications as read (global or repo-scoped)

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-04-02 02:09:31 +02:00
parent 133fe487cd
commit f54cb51963
3 changed files with 285 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ import (
"gitea.com/gitea/gitea-mcp/operation/issue"
"gitea.com/gitea/gitea-mcp/operation/label"
"gitea.com/gitea/gitea-mcp/operation/milestone"
"gitea.com/gitea/gitea-mcp/operation/notification"
"gitea.com/gitea/gitea-mcp/operation/pull"
"gitea.com/gitea/gitea-mcp/operation/repo"
"gitea.com/gitea/gitea-mcp/operation/search"
@@ -41,6 +42,9 @@ func RegisterTool(s *server.MCPServer) {
// Repo Tool
s.AddTools(repo.Tool.Tools()...)
// Notification Tool
s.AddTools(notification.Tool.Tools()...)
// Issue Tool
s.AddTools(issue.Tool.Tools()...)