Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/github/ui_capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
// advertise MCP Apps UI support.
const mcpAppsExtensionKey = "io.modelcontextprotocol/ui"

// MCPAppMIMEType is the MIME type for MCP App UI resources.
const MCPAppMIMEType = "text/html;profile=mcp-app"

// clientSupportsUI reports whether the MCP client that sent this request
// supports MCP Apps UI rendering.
// It checks the context first (set by HTTP/stateless servers from stored
Expand Down
12 changes: 6 additions & 6 deletions pkg/github/ui_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ func RegisterUIResources(s *mcp.Server) {
URI: GetMeUIResourceURI,
Name: "get_me_ui",
Description: "MCP App UI for the get_me tool",
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
},
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
html := MustGetUIAsset("get-me.html")
return &mcp.ReadResourceResult{
Contents: []*mcp.ResourceContents{
{
URI: GetMeUIResourceURI,
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
Text: html,
// MCP Apps UI metadata - CSP configuration to allow loading GitHub avatars
// See: https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx
Expand All @@ -49,15 +49,15 @@ func RegisterUIResources(s *mcp.Server) {
URI: IssueWriteUIResourceURI,
Name: "issue_write_ui",
Description: "MCP App UI for creating and updating GitHub issues",
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
},
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
html := MustGetUIAsset("issue-write.html")
return &mcp.ReadResourceResult{
Contents: []*mcp.ResourceContents{
{
URI: IssueWriteUIResourceURI,
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
Text: html,
},
},
Expand All @@ -71,15 +71,15 @@ func RegisterUIResources(s *mcp.Server) {
URI: PullRequestWriteUIResourceURI,
Name: "pr_write_ui",
Description: "MCP App UI for creating GitHub pull requests",
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
},
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
html := MustGetUIAsset("pr-write.html")
return &mcp.ReadResourceResult{
Contents: []*mcp.ResourceContents{
{
URI: PullRequestWriteUIResourceURI,
MIMEType: "text/html",
MIMEType: MCPAppMIMEType,
Text: html,
},
},
Expand Down