Conversation
…e/selection support
- Replace hardcoded Huntly API tools with dynamic MCP tool loading via @ai-sdk/mcp; tools are loaded from the Huntly server SSE endpoint at chat start and closed when streaming finishes
- Add image context menu item ("Send to Chat") that queues image attachments for the side panel; add selection context support that captures selected page content when right-clicking
- Add pending command queue in background.ts so context commands are buffered when the side panel is not yet open and consumed on panel mount
- Add toolSource/toolSourceLabel to ChatPart and display MCP badge in ToolCallBlock for MCP-sourced tools
- Fix SessionChatPool to use useState instead of useRef for stable identity; pass session id into createEmptySession to avoid id mismatch
- Only fire title generation after streaming settles to avoid redundant calls
- Extract createPageContextPart from createCurrentPageContextPart for reuse with selection context
- Update McpServerController to accept login session auth (Spring Security principal) in addition to MCP token, and add tests for the new auth paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Augment PR SummarySummary: This PR upgrades the browser extension to load Huntly server tools dynamically via MCP and improves “Send to Chat” context capture. Changes:
Technical Notes: Tool-call metadata is propagated through UI-message conversion to keep MCP attribution stable across streaming updates. 🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
| if (isSidePanelMenuItem(info.menuItemId)) { | ||
| openSidePanelForContextMenuClick(tab); | ||
| void openSidePanelForContextMenuClick(tab); |
There was a problem hiding this comment.
app/extension/src/background.ts:L1246 — handlePageSidePanelContextMenuClick is implemented (including selection capture + queued commands) but it’s never invoked from the context-menu click handler, so right-clicking a selection and choosing “Chat” won’t attach the selection/page context. Was the intent for CONTEXT_MENU_SIDE_PANEL_PAGE clicks to route through that handler instead of only opening the panel?
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| private boolean validateToken(String authorization) { | ||
| private boolean isAuthorized(Principal principal, String authorization) { | ||
| if (principal != null && StringUtils.isNotBlank(principal.getName())) { |
There was a problem hiding this comment.
app/server/huntly-server/src/main/java/com/huntly/server/mcp/McpServerController.java:L278 — isAuthorized returns true for any non-blank Principal name; if Spring injects an anonymous principal (commonly "anonymousUser"), this could unintentionally allow unauthenticated access to MCP endpoints. Consider explicitly rejecting anonymous principals (similar to the Authentication check) before granting login-based access.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
@ai-sdk/mcp; tools are fetched from the Huntly server's SSE endpoint at chat start and closed after streaming finishestoolSource/toolSourceLabeladded toChatPart; MCP-sourced tools display a badge inToolCallBlockMcpServerController.isAuthorizednow accepts Spring Security session login in addition to MCP token, allowing browser-based access without a separate tokenTest plan
./mvnw test -pl huntly-server—McpServerControllerTestshould pass including new login-auth casescd app/extension && yarn test🤖 Generated with Claude Code