feat: add infrastructure for MCP Apps#10259
Merged
joehan merged 2 commits intomcp-sse-supportfrom Apr 3, 2026
Merged
Conversation
This was referenced Apr 3, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds several new UI resources—login, update environment, deploy, and init—to the MCP resources collection. It also updates the toContent utility to include structuredContent in its return object. A review comment identified a violation of the repository's style guide regarding the use of as any in src/mcp/util.ts and suggested using an intersection type for better type safety.
src/mcp/util.ts
Outdated
| content: [{ type: "text", text: `${prefix}${text}${suffix}` }], | ||
| }; | ||
| structuredContent: data, | ||
| } as any; |
Contributor
There was a problem hiding this comment.
The use of as any as a type cast is discouraged by the repository style guide. To include the structuredContent property while remaining compatible with the CallToolResult return type, consider using an intersection type instead of an escape hatch.
Suggested change
| } as any; | |
| } as CallToolResult & { structuredContent: unknown }; |
References
- Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)
### Description Adds support for returning structured content from tools, which is used by MCP Apps to pass complex data to the host. Also updates the resource index. ### Scenarios Tested - Verified build and file changes.
### Description - Removes imports and registry entries for UI resources that are not yet available in this branch (login, update_environment, deploy, init). - Replaces as any in toContent with an intersection type for better type safety. ### Scenarios Tested - Verified build succeeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for returning structured content from tools, which is used by MCP Apps to pass complex data to the host. (Chained off #10258)