feat: add MCP server with shared controller logic#1597
Open
dstotijn wants to merge 1 commit intocallumalpass:mainfrom
Open
feat: add MCP server with shared controller logic#1597dstotijn wants to merge 1 commit intocallumalpass:mainfrom
dstotijn wants to merge 1 commit intocallumalpass:mainfrom
Conversation
Add Model Context Protocol server exposing TaskNotes tools at /mcp endpoint behind an enableMCP setting. Extract shared business logic from HTTP controllers into reusable utilities so both controllers and MCPService call the same code: - timeTrackingUtils: active sessions, time summary, task time data - calendarUtils: event collection, filtering, provider detection - TaskStatsService.getStats(): unified task statistics MCPService triggers webhooks for all mutations and reuses the shared utils, eliminating ~400 lines of duplication. Also fixes a pre-existing bug where webhook payloads for start-with-description had stale data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mcpendpoint, gated behind anenableMCPsettingtimeTrackingUtils,calendarUtils,TaskStatsService.getStats()) so both HTTP controllers and MCPService call the same code — eliminating ~400 lines of duplicationMCP Tools Exposed
Tasks (CRUD, query, toggle status/archive, parse from text), time tracking (start/stop sessions, summaries), pomodoro (start/stop/pause/resume, status), calendar events, filter options, task statistics, and health check.
Note
For locally running AI agents, the mdbase-skill is likely a better fit. This in-plugin MCP endpoint is primarily useful for remote/hosted AI clients — such as Claude or ChatGPT on mobile, or other host apps that have no direct access to a vault via (bash) tool calls.
Test plan
enableMCPin settings, verify/mcpendpoint responds to MCP protocol messages🤖 Generated with Claude Code