Skip to content

Commit a34d6cd

Browse files
Fix test helper to set UI extension capabilities on known UI clients
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 36603de commit a34d6cd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/github/helper_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,20 @@ func createMCPRequestWithSession(t *testing.T, clientName string, args any) mcp.
306306

307307
srv := mcp.NewServer(&mcp.Implementation{Name: "test"}, nil)
308308

309+
caps := &mcp.ClientCapabilities{}
310+
// If the client is a known UI-supporting client, add the UI extension
311+
if clientName == "Visual Studio Code - Insiders" || clientName == "Visual Studio Code" {
312+
caps.AddExtension("io.modelcontextprotocol/ui", map[string]any{
313+
"mimeTypes": []string{"text/html;profile=mcp-app"},
314+
})
315+
}
316+
309317
st, _ := mcp.NewInMemoryTransports()
310318
session, err := srv.Connect(context.Background(), st, &mcp.ServerSessionOptions{
311319
State: &mcp.ServerSessionState{
312320
InitializeParams: &mcp.InitializeParams{
313-
ClientInfo: &mcp.Implementation{Name: clientName},
321+
ClientInfo: &mcp.Implementation{Name: clientName},
322+
Capabilities: caps,
314323
},
315324
},
316325
})

0 commit comments

Comments
 (0)