MCP (Model Context Protocol) SSE server to Huntly and a new Settings UI to configure and test MCP tools#94
Conversation
- 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>
🤖 Augment PR SummarySummary: This PR adds an MCP (Model Context Protocol) SSE server to Huntly and a new Settings UI to configure and test MCP tools. Changes:
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 👎 |
| .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() | ||
| .authorizeRequests() | ||
| .antMatchers("/api/auth/**").permitAll() | ||
| .antMatchers("/api/mcp/**").permitAll() |
There was a problem hiding this comment.
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.
🤖 Was this useful? React with 👍 or 👎
app/server/huntly-server/src/main/java/com/huntly/server/mcp/McpServerController.java
Show resolved
Hide resolved
| "type", "text", | ||
| "text", result.toString()))); | ||
| } | ||
| response.put("isError", false); |
| 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)); |
- 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>
Summary
Test plan
🤖 Generated with Claude Code