Skip to content

Conversation

@lcomplete
Copy link
Owner

Summary

  • Fix tweet content type detection to correctly identify TWEET (1) and QUOTED_TWEET (3) types
  • Add markRead field to MCP responses for tracking read status
  • Handle null retweetedTweet in JSON parsing to prevent errors
  • Refactor GetContentDetailsTool to use shared conversion method
  • Simplify GetHighlightsTool to use PageHighlightService with proper pagination
  • Add query validation to SearchContentTool with clearer parameter descriptions
  • Normalize error objects to strings in MCP tools test UI for better display
  • Add Trae to supported MCP config examples in settings

Test plan

  • Test MCP tools with tweet content to verify correct content type detection
  • Verify GetContentDetails returns markRead status
  • Test GetHighlights pagination and sorting
  • Test SearchContentTool with empty query to verify error handling
  • Test MCP tools test UI error display with various error formats

🤖 Generated with Claude Code

lcomplete and others added 4 commits January 14, 2026 03:24
- Implemented McpPageItem DTO for list responses.
- Created GetContentDetailTool to fetch complete content details by content ID.
- Developed GetContentSummariesTool for batch retrieval of content summaries.
- Added GetHighlightsTool to retrieve user-highlighted text passages from articles.
- Introduced GetLibraryContentTool to access user's library content by category.
- Implemented GetUnreadRssTool to fetch all unread RSS items.
- Created ListGithubStarsTool to retrieve recent GitHub stars.
- Developed ListRecentContentTool for fetching recently saved content across all sources.
- Added ListRssFeedsTool to list all RSS subscriptions with statistics.
- Implemented ListRssItemsTool to get articles from a specific RSS feed subscription.
- Created ListTweetsTool to retrieve saved tweets with various sort options.
- Defined McpTool interface for consistent tool structure.
- Implemented SearchContentTool for full-text search across all saved content.
- Removed McpContentDetail and GetContentDetailTool classes.
- Updated McpHighlight to include huntlyUrl for better content referencing.
- Enhanced GetContentSummariesTool, GetHighlightsTool, GetLibraryContentTool, GetUnreadRssTool, ListGithubStarsTool, ListRecentContentTool, ListRssItemsTool, ListTweetsTool, and SearchContentTool to include huntlyUrl in descriptions and results.
- Added max_description_length parameter to several tools for better control over response sizes.
- Updated application-dev.yml to disable SQL logging by default.
- Modified start-dev.sh to allow enabling SQL logging via command line argument.
- Introduced McpToolsSection component in the client for displaying available MCP tools with descriptions and example requests.
- Removed GetContentSummariesTool as it is no longer needed.
- Updated GetHighlightsTool, GetLibraryContentTool, GetUnreadRssTool, ListGithubStarsTool, ListRecentContentTool, ListRssFeedsTool, ListRssItemsTool, ListTweetsTool to use LinkedHashMap for input schema properties.
- Removed max_description_length parameter from GetLibraryContentTool, GetUnreadRssTool, ListGithubStarsTool, ListRecentContentTool, ListRssItemsTool, ListTweetsTool.
- Introduced GetContentDetailsTool for batch retrieval of content details by IDs.
- Added TweetTextParser to extract plain text from tweet JSON properties, including handling of hashtags, URLs, mentions, and retweets.
- Created unit tests for TweetTextParser to ensure correct functionality with various tweet formats and edge cases.
- Fix tweet content type detection (ContentType.TWEET=1, QUOTED_TWEET=3)
- Add markRead field to McpPageItem for read status tracking
- Handle null retweetedTweet in JSON parsing to prevent errors
- Refactor GetContentDetailsTool to use shared toMcpPageItemFromEntity
- Simplify GetHighlightsTool to use PageHighlightService with proper pagination
- Add query validation to SearchContentTool with clearer description
- Normalize error objects to strings in MCP tools test UI
- Add Trae to supported MCP config examples in settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@augmentcode
Copy link

augmentcode bot commented Jan 14, 2026

🤖 Augment PR Summary

Summary: This PR adds an MCP (Model Context Protocol) SSE server to Huntly and a new Settings UI to configure and test MCP tools.

Changes:

  • Introduces /api/mcp/sse + /api/mcp/message endpoints and an McpToolRegistry for tool discovery/execution.
  • Adds multiple MCP tools (search, list recent/library/RSS/tweets, get highlights, batch content details) plus DTOs for MCP responses.
  • Improves content conversion for MCP responses (content type detection for tweets/quoted tweets, adds markRead field, and handles retweetedTweet: null safely).
  • Adds server-side tweet text extraction via TweetTextParser with unit tests to mirror frontend parsing behavior.
  • Adds a new client Settings page (/settings/mcp) to generate/copy/clear an MCP token and browse/test tools from the UI.
  • Extends global settings schema to store mcpToken (server entity + service, client OpenAPI types).
  • Updates dev workflow/docs: promotes start-dev.sh, adds dependency rebuild detection and an --sql flag.
  • Tweaks dev SQL logging defaults in application-dev.yml.

Technical Notes: MCP transport is implemented via SSE with per-connection session IDs; tool execution results are serialized to text content for MCP tool responses.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers("/api/auth/**").permitAll()
.antMatchers("/api/mcp/**").permitAll()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permitting all access to /api/mcp/** makes the MCP surface (including /api/mcp/tools/test) reachable without normal auth; if the underlying services don’t enforce user auth, this can expose private library/search data. At minimum, it’s worth double-checking that these endpoints are always protected either by the MCP token or application auth.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

"type", "text",
"text", result.toString())));
}
response.put("isError", false);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleToolCall() always returns isError: false even when a tool returns an error-shaped payload (e.g., Map.of("error", ...)). MCP clients may rely on isError to decide how to display/handle failures.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

dbSetting.setEnableProxy(globalSetting.getEnableProxy());
dbSetting.setColdDataKeepDays(Optional.of(globalSetting.getColdDataKeepDays()).orElse(AppConstants.DEFAULT_COLD_DATA_KEEP_DAYS));
dbSetting.setColdDataKeepDays(
Optional.of(globalSetting.getColdDataKeepDays()).orElse(AppConstants.DEFAULT_COLD_DATA_KEEP_DAYS));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional.of(globalSetting.getColdDataKeepDays()) will throw if coldDataKeepDays is null, which can turn a partial settings update into a 500. Using a null-safe default here would prevent a surprise NPE.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

lcomplete and others added 2 commits January 14, 2026 20:54
- Add REACT_APP_VERSION environment variable to release workflow
- Export APP_VERSION from env.ts with fallback to "v.dev"
- Update Home.tsx to display version from environment instead of hardcoded value
- Update TweetTextParserTest to use mock data instead of real tweet data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add server-side MCP token generation using SecureRandom for cryptographic security
- Update client to call new generateMcpToken endpoint instead of client-side generation
- Deny MCP access when no token is configured (previously allowed for development)
- Detect and properly flag error responses in MCP tool execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lcomplete lcomplete changed the title Improve MCP tools with better content handling and error display MCP (Model Context Protocol) SSE server to Huntly and a new Settings UI to configure and test MCP tools Jan 14, 2026
@lcomplete lcomplete merged commit 7a2f7f8 into main Jan 14, 2026
1 check passed
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