Skip to content

Commit bdc71e2

Browse files
committed
make it a const
1 parent dd44305 commit bdc71e2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pkg/github/ui_capability.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
// advertise MCP Apps UI support.
1212
const mcpAppsExtensionKey = "io.modelcontextprotocol/ui"
1313

14+
// MCPAppMIMEType is the MIME type for MCP App UI resources.
15+
const MCPAppMIMEType = "text/html;profile=mcp-app"
16+
1417
// clientSupportsUI reports whether the MCP client that sent this request
1518
// supports MCP Apps UI rendering.
1619
// It checks the context first (set by HTTP/stateless servers from stored

pkg/github/ui_resources.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ func RegisterUIResources(s *mcp.Server) {
1717
URI: GetMeUIResourceURI,
1818
Name: "get_me_ui",
1919
Description: "MCP App UI for the get_me tool",
20-
MIMEType: "text/html;profile=mcp-app",
20+
MIMEType: MCPAppMIMEType,
2121
},
2222
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
2323
html := MustGetUIAsset("get-me.html")
2424
return &mcp.ReadResourceResult{
2525
Contents: []*mcp.ResourceContents{
2626
{
2727
URI: GetMeUIResourceURI,
28-
MIMEType: "text/html;profile=mcp-app",
28+
MIMEType: MCPAppMIMEType,
2929
Text: html,
3030
// MCP Apps UI metadata - CSP configuration to allow loading GitHub avatars
3131
// See: https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx
@@ -49,15 +49,15 @@ func RegisterUIResources(s *mcp.Server) {
4949
URI: IssueWriteUIResourceURI,
5050
Name: "issue_write_ui",
5151
Description: "MCP App UI for creating and updating GitHub issues",
52-
MIMEType: "text/html;profile=mcp-app",
52+
MIMEType: MCPAppMIMEType,
5353
},
5454
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
5555
html := MustGetUIAsset("issue-write.html")
5656
return &mcp.ReadResourceResult{
5757
Contents: []*mcp.ResourceContents{
5858
{
5959
URI: IssueWriteUIResourceURI,
60-
MIMEType: "text/html;profile=mcp-app",
60+
MIMEType: MCPAppMIMEType,
6161
Text: html,
6262
},
6363
},
@@ -71,15 +71,15 @@ func RegisterUIResources(s *mcp.Server) {
7171
URI: PullRequestWriteUIResourceURI,
7272
Name: "pr_write_ui",
7373
Description: "MCP App UI for creating GitHub pull requests",
74-
MIMEType: "text/html;profile=mcp-app",
74+
MIMEType: MCPAppMIMEType,
7575
},
7676
func(_ context.Context, _ *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) {
7777
html := MustGetUIAsset("pr-write.html")
7878
return &mcp.ReadResourceResult{
7979
Contents: []*mcp.ResourceContents{
8080
{
8181
URI: PullRequestWriteUIResourceURI,
82-
MIMEType: "text/html;profile=mcp-app",
82+
MIMEType: MCPAppMIMEType,
8383
Text: html,
8484
},
8585
},

0 commit comments

Comments
 (0)