Skip to content

Conversation

shakunvohradeltek
Copy link

Summary

  • Enhanced work item comments retrieval to show all comments instead of just first 5
  • Added comprehensive attachment support with URL-based access to avoid token limits
  • Implemented smart work item ID detection in search functionality
  • Added Sharp image processing integration for robust image handling
  • All changes maintain backward compatibility and follow existing patterns

Key Features Added

  • Complete comment pagination: Now retrieves all comments (default 100 vs previous limit of 5)
  • Attachment URL delivery: Returns downloadable URLs instead of base64 content to prevent Claude Code's 25K token limit
  • Smart search enhancement: Direct work item ID detection for faster retrieval
  • Image processing pipeline: Comprehensive image handling with Sharp integration
  • Token limit optimization: Intelligent content delivery to stay within MCP constraints

Technical Changes

  • `src/features/work-items/index.ts`: Enhanced comment handling and attachment URL generation
  • `src/features/work-items/get-work-item-comments/`: New comprehensive comment processing
  • `src/features/work-items/get-work-item-attachments/`: New attachment handling with URL-based access
  • `src/features/search/search-work-items/feature.ts`: Added work item ID detection
  • `src/utils/image-processor.ts`: New comprehensive image processing utilities
  • `package.json`: Added Sharp dependency for image processing

Test Plan

  • Package builds successfully with `npm pack`
  • All TypeScript compilation passes
  • ESLint validation passes
  • Maintains existing API compatibility
  • Work item comments now show complete data (all 11 comments vs previous 5)
  • Attachment URLs are functional and downloadable
  • Search functionality enhanced with direct work item ID support
  • Token limits resolved through URL-based content delivery

🤖 Generated with Claude Code

…upport

- Add complete work item comments retrieval with image processing support
- Implement attachment URL-based access to avoid token limits
- Enhance search functionality with direct work item ID detection
- Add intelligent comment pagination (display all comments vs limited)
- Integrate image URLs for Claude analysis instead of base64 content
- Support both images and documents with downloadable URLs
- Add comprehensive error handling and TypeScript compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@shakunvohradeltek
Copy link
Author

shakunvohradeltek commented Aug 16, 2025

@Tiberriver256 can you take a look at this when you get a chance?

@GlassOnTin
Copy link

Code Review

Good: URL-based attachments solve the token limit problem elegantly. Smart work item ID detection improves UX.

Issues:

  1. Sharp dependency (50MB) - Too heavy for an MCP server. Consider removing image processing entirely and just return URLs.
  2. No tests - Missing unit tests for new features
  3. image-processor.ts (831 lines) - Unnecessary complexity. This belongs in a client, not the MCP server.
  4. get-work-item-comments/feature.ts (659 lines) - Needs refactoring into smaller functions

Recommendation: Strip out Sharp and image processing. Keep just the core URL-based attachment and comment pagination features. Add tests.

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.

2 participants