Skip to content

Extract inline MCP handler methods into standalone functions#777

Merged
selfcontained merged 1 commit into
mainfrom
agt_c261f9414cd2/job-debt-collector-5b666804
Jul 15, 2026
Merged

Extract inline MCP handler methods into standalone functions#777
selfcontained merged 1 commit into
mainfrom
agt_c261f9414cd2/job-debt-collector-5b666804

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Extracted all 17 inline handler methods from the createMcpHandlers() closure in apps/server/src/server/mcp-handlers.ts into standalone named functions
  • createMcpHandlers() drops from ~560 lines of inline logic to ~100 lines of thin delegation
  • Same pattern as the activity.ts extraction in refactor: extract inline handlers from registerActivityRoutes() #773

What qualifies as tech debt

The original createMcpHandlers() was a 694-line function with 17 inline methods, all sharing a closure over dependencies. Each handler is now a top-level named function that receives deps explicitly — easier to read, test, and navigate individually.

Next up

Extract route handlers from the 713-line registerReleaseRoutes() in apps/server/src/routes/release.ts (top of the backlog).

🤖 Generated with Claude Code

Each inline method in the 694-line createMcpHandlers() closure is now a
standalone named function. The registration function drops to ~100 lines
of thin delegation, matching the activity.ts extraction pattern from #773.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit bf80d3b into main Jul 15, 2026
1 check passed
@selfcontained
selfcontained deleted the agt_c261f9414cd2/job-debt-collector-5b666804 branch July 15, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant