MCPcopy
hub / github.com/github/github-mcp-server / TestForMCPRequest_ResourcesRead

Function TestForMCPRequest_ResourcesRead

pkg/inventory/registry_test.go:839–854  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

837}
838
839func TestForMCPRequest_ResourcesRead(t *testing.T) {
840 resources := []ServerResourceTemplate{
841 mockResource("res1", "repos", "repo://{owner}/{repo}"),
842 mockResource("res2", "repos", "branch://{owner}/{repo}/{branch}"),
843 }
844
845 reg := mustBuild(t, NewBuilder().SetResources(resources).WithToolsets([]string{"all"}))
846 // Pass a concrete URI - all resources remain registered, SDK handles matching
847 filtered := reg.ForMCPRequest(MCPMethodResourcesRead, "repo://owner/repo")
848
849 // All resources should be available - SDK handles URI template matching internally
850 available := filtered.AvailableResourceTemplates(context.Background())
851 if len(available) != 2 {
852 t.Fatalf("Expected 2 resources for resources/read (SDK handles matching), got %d", len(available))
853 }
854}
855func TestForMCPRequest_PromptsList(t *testing.T) {
856 tools := []ServerTool{
857 mockTool("tool1", "repos", true),

Callers

nothing calls this directly

Calls 7

mockResourceFunction · 0.85
mustBuildFunction · 0.85
NewBuilderFunction · 0.85
WithToolsetsMethod · 0.80
SetResourcesMethod · 0.80
ForMCPRequestMethod · 0.80

Tested by

no test coverage detected