Skip to content

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Dec 26, 2025

Summary

Hook the client up to the actual sever

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR connects the desktop client to the actual server for MCP Apps functionality, replacing mock data with real API calls.

  • Adds sessionId prop threading from GooseMessage through ToolCallWithResponse to McpAppRenderer
  • Implements dynamic resource fetching via readResource API
  • Enables MCP apps to call tools and read resources through the backend

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ui/desktop/src/components/GooseMessage.tsx Passes sessionId to ToolCallWithResponse component for API authentication
ui/desktop/src/components/ToolCallWithResponse.tsx Adds maybeRenderMCPApp helper that extracts resourceUri from tool metadata and conditionally renders MCP apps
ui/desktop/src/components/McpApps/McpAppRenderer.tsx Replaces static resource prop with dynamic fetching via readResource API; implements tools/call and resources/read handlers for guest app requests

Comment on lines 55 to 60
if (response.data) {
setResourceHtml(response.data.html);
// TODO: Extract CSP from resource metadata when backend supports it
// For now, CSP will be null and the proxy will use default restrictions
}
} catch (err) {
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The useEffect is missing proper error handling for the case when response.data is null or undefined. If the API returns a successful response but with null data, setResourceHtml will be called with undefined, but no error state will be set. Consider adding a check and setting an error if data is missing.

Suggested change
if (response.data) {
setResourceHtml(response.data.html);
// TODO: Extract CSP from resource metadata when backend supports it
// For now, CSP will be null and the proxy will use default restrictions
}
} catch (err) {
if (response.data && typeof response.data.html === 'string') {
setResourceHtml(response.data.html);
setError(null);
// TODO: Extract CSP from resource metadata when backend supports it
// For now, CSP will be null and the proxy will use default restrictions
} else {
setResourceHtml(null);
setError('Resource data is missing or invalid');
}
} catch (err) {
setResourceHtml(null);

Copilot uses AI. Check for mistakes.
toolInput={{ arguments: toolCall.arguments }}
extensionName={extensionName}
sessionId={sessionId}
append={append}
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The toolResult prop is not being passed to McpAppRenderer. This will prevent the guest app from receiving tool result notifications via the ui/notifications/tool-result method. Consider passing the toolResult by extracting it from resultWithMeta.value, which should match the ToolResult type expected by the component.

Suggested change
append={append}
append={append}
toolResult={value}

Copilot uses AI. Check for mistakes.
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