From dd443055e776e8543013a137f10930e40e50178a Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Tue, 24 Feb 2026 16:19:55 +0000 Subject: [PATCH 1/2] update MIME types for UI resources to include profile for MCP Apps --- pkg/github/ui_resources.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/github/ui_resources.go b/pkg/github/ui_resources.go index 3fdb4a935..71f3d1cf6 100644 --- a/pkg/github/ui_resources.go +++ b/pkg/github/ui_resources.go @@ -17,7 +17,7 @@ func RegisterUIResources(s *mcp.Server) { URI: GetMeUIResourceURI, Name: "get_me_ui", Description: "MCP App UI for the get_me tool", - MIMEType: "text/html", + MIMEType: "text/html;profile=mcp-app", }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("get-me.html") @@ -25,7 +25,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: GetMeUIResourceURI, - MIMEType: "text/html", + MIMEType: "text/html;profile=mcp-app", 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 @@ -49,7 +49,7 @@ 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: "text/html;profile=mcp-app", }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("issue-write.html") @@ -57,7 +57,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: IssueWriteUIResourceURI, - MIMEType: "text/html", + MIMEType: "text/html;profile=mcp-app", Text: html, }, }, @@ -71,7 +71,7 @@ func RegisterUIResources(s *mcp.Server) { URI: PullRequestWriteUIResourceURI, Name: "pr_write_ui", Description: "MCP App UI for creating GitHub pull requests", - MIMEType: "text/html", + MIMEType: "text/html;profile=mcp-app", }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("pr-write.html") @@ -79,7 +79,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: PullRequestWriteUIResourceURI, - MIMEType: "text/html", + MIMEType: "text/html;profile=mcp-app", Text: html, }, }, From bdc71e2bc6ff0c85a1a7abc02dbff8987cb956ca Mon Sep 17 00:00:00 2001 From: Matt Holloway Date: Tue, 24 Feb 2026 16:22:04 +0000 Subject: [PATCH 2/2] make it a const --- pkg/github/ui_capability.go | 3 +++ pkg/github/ui_resources.go | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/github/ui_capability.go b/pkg/github/ui_capability.go index 8b06dd455..f237df842 100644 --- a/pkg/github/ui_capability.go +++ b/pkg/github/ui_capability.go @@ -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 diff --git a/pkg/github/ui_resources.go b/pkg/github/ui_resources.go index 71f3d1cf6..c41d2ac3f 100644 --- a/pkg/github/ui_resources.go +++ b/pkg/github/ui_resources.go @@ -17,7 +17,7 @@ func RegisterUIResources(s *mcp.Server) { URI: GetMeUIResourceURI, Name: "get_me_ui", Description: "MCP App UI for the get_me tool", - MIMEType: "text/html;profile=mcp-app", + MIMEType: MCPAppMIMEType, }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("get-me.html") @@ -25,7 +25,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: GetMeUIResourceURI, - MIMEType: "text/html;profile=mcp-app", + 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 @@ -49,7 +49,7 @@ func RegisterUIResources(s *mcp.Server) { URI: IssueWriteUIResourceURI, Name: "issue_write_ui", Description: "MCP App UI for creating and updating GitHub issues", - MIMEType: "text/html;profile=mcp-app", + MIMEType: MCPAppMIMEType, }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("issue-write.html") @@ -57,7 +57,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: IssueWriteUIResourceURI, - MIMEType: "text/html;profile=mcp-app", + MIMEType: MCPAppMIMEType, Text: html, }, }, @@ -71,7 +71,7 @@ func RegisterUIResources(s *mcp.Server) { URI: PullRequestWriteUIResourceURI, Name: "pr_write_ui", Description: "MCP App UI for creating GitHub pull requests", - MIMEType: "text/html;profile=mcp-app", + MIMEType: MCPAppMIMEType, }, func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { html := MustGetUIAsset("pr-write.html") @@ -79,7 +79,7 @@ func RegisterUIResources(s *mcp.Server) { Contents: []*mcp.ResourceContents{ { URI: PullRequestWriteUIResourceURI, - MIMEType: "text/html;profile=mcp-app", + MIMEType: MCPAppMIMEType, Text: html, }, },