diff --git a/go.mod b/go.mod index 908d3e7f7a..e47cb7d1e2 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/josephburnett/jd/v2 v2.5.0 github.com/lithammer/fuzzysearch v1.1.8 github.com/microcosm-cc/bluemonday v1.0.27 - github.com/modelcontextprotocol/go-sdk v1.8.0 + github.com/modelcontextprotocol/go-sdk v1.9.0 github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 github.com/segmentio/encoding v0.5.4 github.com/shurcooL/githubv4 v0.0.0-20260209031235-2402fdf4a9ed @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.12.1 github.com/yosida95/uritemplate/v3 v3.0.2 go.yaml.in/yaml/v3 v3.0.6 - golang.org/x/net v0.61.0 + golang.org/x/net v0.63.0 golang.org/x/oauth2 v0.38.0 ) @@ -39,8 +39,8 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.6.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/sys v0.49.0 // indirect - golang.org/x/text v0.43.0 // indirect + golang.org/x/sync v0.25.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/text v0.44.0 // indirect golang.org/x/time v0.15.0 // indirect ) diff --git a/go.sum b/go.sum index 8bbe7be1c8..a8351dcb87 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8 github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= -github.com/modelcontextprotocol/go-sdk v1.8.0 h1:KIvahhYqwtbeniWVPs3TcXEA7b8jEtwfBpOTAI+Urx4= -github.com/modelcontextprotocol/go-sdk v1.8.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= +github.com/modelcontextprotocol/go-sdk v1.9.0 h1:XVjBrIMg82x7ff2bqwSPgRThLp4TC1lGTX74Ofaie1g= +github.com/modelcontextprotocol/go-sdk v1.9.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 h1:31Y+Yu373ymebRdJN1cWLLooHH8xAr0MhKTEJGV/87g= github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021/go.mod h1:WERUkUryfUWlrHnFSO/BEUZ+7Ns8aZy7iVOGewxKzcc= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= @@ -86,23 +86,23 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.61.0 h1:RR+6j/BTBCrggOLugxa+66R8FvoN6MHlzDlZIbN9YFw= -golang.org/x/net v0.61.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= +golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0= +golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig= golang.org/x/oauth2 v0.38.0 h1:uW7XQbcu1eoiQS7uMJvLOjPMl04bTbmY1VeRPxvbspI= golang.org/x/oauth2 v0.38.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs= +golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= @@ -111,15 +111,15 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= -golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI= -golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA= +golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= +golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/ghmcp/oauth_typed_test.go b/internal/ghmcp/oauth_typed_test.go index e91e2f45aa..0ea7c10db2 100644 --- a/internal/ghmcp/oauth_typed_test.go +++ b/internal/ghmcp/oauth_typed_test.go @@ -334,8 +334,12 @@ func TestOAuthTypedHTTPHeaderBoundary(t *testing.T) { req.Header.Set("Mcp-Protocol-Version", inventory.ProtocolVersionMultiRoundTrip) req.Header.Set("Mcp-Method", "tools/call") req.Header.Set("Mcp-Name", probeToolName) - req.Header.Set("Mcp-Param-owner", tc.owner) - req.Header.Set("Mcp-Param-repo", tc.repo) + if tc.name != "missing-required" && tc.name != "null-owner" { + req.Header.Set("Mcp-Param-owner", tc.owner) + } + if tc.name != "missing-required" { + req.Header.Set("Mcp-Param-repo", tc.repo) + } rec := httptest.NewRecorder() handler.ServeHTTP(rec, req) return rec diff --git a/pkg/github/context_tools_test.go b/pkg/github/context_tools_test.go index 041f2d168c..025c5896a8 100644 --- a/pkg/github/context_tools_test.go +++ b/pkg/github/context_tools_test.go @@ -364,7 +364,7 @@ func TestContextToolsTypedRegistration(t *testing.T) { legacyResult, err := getMeTool.Handler(deps)(ContextWithDeps(context.Background(), deps), &request) require.NoError(t, err) assert.Equal(t, `{"login":"testuser","profile_url":"https://github.com/testuser","details":{"public_repos":0,"public_gists":0,"followers":0,"following":0,"created_at":"2020-01-02T03:04:05Z","updated_at":"0001-01-01T00:00:00Z"}}`, getTextResult(t, legacyResult).Text) - require.NoError(t, outputSchemas["get_me"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["get_me"].Validate(mustJSONValue(t, result.StructuredContent))) result, err = clientSession.CallTool(context.Background(), &mcp.CallToolParams{ Name: "get_teams", @@ -381,7 +381,7 @@ func TestContextToolsTypedRegistration(t *testing.T) { legacyResult, err = getTeamsTool.Handler(deps)(ContextWithDeps(context.Background(), deps), &request) require.NoError(t, err) assert.Equal(t, `[{"org":"testorg","teams":[{"name":"team1","slug":"team1","description":"Team 1"}]}]`, getTextResult(t, legacyResult).Text) - require.NoError(t, outputSchemas["get_teams"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["get_teams"].Validate(mustJSONValue(t, result.StructuredContent))) assert.Equal(t, 2, graphQLCalls) result, err = clientSession.CallTool(context.Background(), &mcp.CallToolParams{ @@ -399,7 +399,7 @@ func TestContextToolsTypedRegistration(t *testing.T) { legacyResult, err = teamMembersTool.Handler(deps)(ContextWithDeps(context.Background(), deps), &request) require.NoError(t, err) assert.Equal(t, `["user1","user2"]`, getTextResult(t, legacyResult).Text) - require.NoError(t, outputSchemas["get_team_members"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["get_team_members"].Validate(mustJSONValue(t, result.StructuredContent))) assert.Equal(t, 4, graphQLCalls) result, err = clientSession.CallTool(context.Background(), &mcp.CallToolParams{ @@ -450,7 +450,7 @@ func TestContextToolsTypedRegistration(t *testing.T) { require.NoError(t, err) assert.JSONEq(t, tc.structured, string(structuredJSON)) assert.JSONEq(t, string(structuredJSON), getTextResult(t, result).Text) - require.NoError(t, outputSchemas[tc.name].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas[tc.name].Validate(mustJSONValue(t, result.StructuredContent))) } failGetMe = true diff --git a/pkg/github/issue_artifacts_test.go b/pkg/github/issue_artifacts_test.go index 0797b835e4..c2ae9c8621 100644 --- a/pkg/github/issue_artifacts_test.go +++ b/pkg/github/issue_artifacts_test.go @@ -170,9 +170,7 @@ func TestIssueArtifactRequests(t *testing.T) { require.False(t, result.IsError, "%s", getTextResult(t, result).Text) assert.Equal(t, 1, calls) text := getTextResult(t, result).Text - var structured any - require.NoError(t, json.Unmarshal([]byte(text), &structured)) - assert.Equal(t, structured, result.StructuredContent) + assert.JSONEq(t, text, mustMarshalJSON(t, result.StructuredContent)) switch tc.index { case 2: assert.JSONEq(t, `{"deleted":{"issue_number":12,"artifact_number":3,"message":"artifact deleted"}}`, text) diff --git a/pkg/github/repository_tool_types.go b/pkg/github/repository_tool_types.go index 4f3b584983..edd1084121 100644 --- a/pkg/github/repository_tool_types.go +++ b/pkg/github/repository_tool_types.go @@ -356,7 +356,7 @@ func repositoryContentOutput(result *mcp.CallToolResult) (*RepositoryContentsOut if block.Resource.Blob != nil { blob := base64.StdEncoding.EncodeToString(block.Resource.Blob) resource.Blob = &blob - } else if block.Resource.Text != "" { + } else { resource.Text = &block.Resource.Text } out.Content = append(out.Content, RepositoryContentBlock{Resource: &RepositoryResourceBlock{Type: "resource", Resource: resource}}) diff --git a/pkg/github/typed_consolidated_issue_enrichment_test.go b/pkg/github/typed_consolidated_issue_enrichment_test.go index 2e02dcf09c..9c7d386cac 100644 --- a/pkg/github/typed_consolidated_issue_enrichment_test.go +++ b/pkg/github/typed_consolidated_issue_enrichment_test.go @@ -35,7 +35,7 @@ func TestTypedIssueReadIFCLabels(t *testing.T) { assert.Equal(t, "public", label["confidentiality"]) if schema := schemas["issue_read"]; schema != nil { require.NotNil(t, result.StructuredContent) - require.NoError(t, schema.Validate(result.StructuredContent)) + require.NoError(t, schema.Validate(mustJSONValue(t, result.StructuredContent))) } else { assert.Nil(t, result.StructuredContent) } diff --git a/pkg/github/typed_consolidated_pull_request_outputs_test.go b/pkg/github/typed_consolidated_pull_request_outputs_test.go index 4c0a76aa8f..2fdfb53c30 100644 --- a/pkg/github/typed_consolidated_pull_request_outputs_test.go +++ b/pkg/github/typed_consolidated_pull_request_outputs_test.go @@ -225,7 +225,8 @@ func runTypedPullRequestCases(t *testing.T, session *mcp.ClientSession, schemas if tc.text == "null" { assert.Equal(t, "null", text) // Explicit wire presence is checked by the session middleware. - assert.Nil(t, result.StructuredContent, "%s %v", tc.tool, tc.args) + assert.NotNil(t, result.StructuredContent, "%s %v", tc.tool, tc.args) + assert.JSONEq(t, "null", mustMarshalJSON(t, result.StructuredContent)) require.NoError(t, schema.Validate(nil)) continue } @@ -507,7 +508,7 @@ func TestTypedPullRequestContentParity(t *testing.T) { require.NotNil(t, result.Meta["ifc"]) if protocol == inventory.ProtocolVersionMultiRoundTrip { assert.JSONEq(t, mustMarshalJSON(t, result.StructuredContent), text) - require.NoError(t, schemas["pull_request_read"].Validate(result.StructuredContent)) + require.NoError(t, schemas["pull_request_read"].Validate(mustJSONValue(t, result.StructuredContent))) } else { assert.Nil(t, result.StructuredContent) assert.Equal(t, `{"number":1,"title":"Subject","body":"body","state":"open","draft":false,"merged":false,"html_url":"https://github.com/owner/repo/pull/1","user":{"login":"octocat"}}`, text) diff --git a/pkg/github/typed_granular_issue_outputs_test.go b/pkg/github/typed_granular_issue_outputs_test.go index d2b833d650..1729fbcaf2 100644 --- a/pkg/github/typed_granular_issue_outputs_test.go +++ b/pkg/github/typed_granular_issue_outputs_test.go @@ -261,7 +261,7 @@ func TestTypedGranularIssueWireOutputs(t *testing.T) { assert.JSONEq(t, expected, mustMarshalJSON(t, result.StructuredContent)) assert.JSONEq(t, expected, getTextResult(t, result).Text) assert.JSONEq(t, getTextResult(t, result).Text, mustMarshalJSON(t, result.StructuredContent)) - require.NoError(t, schema.Validate(result.StructuredContent)) + require.NoError(t, schema.Validate(mustJSONValue(t, result.StructuredContent))) if strings.Contains(tc.name, "sub_issue") { var output map[string]json.RawMessage require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, result.StructuredContent)), &output)) @@ -426,7 +426,7 @@ func TestTypedGranularIssueWireErrors(t *testing.T) { } if schema := schemas[tc.name]; schema != nil { assert.JSONEq(t, expectedText, mustMarshalJSON(t, result.StructuredContent)) - require.NoError(t, schema.Validate(result.StructuredContent)) + require.NoError(t, schema.Validate(mustJSONValue(t, result.StructuredContent))) } else { assert.Nil(t, result.StructuredContent) } diff --git a/pkg/github/typed_issue_outputs_test.go b/pkg/github/typed_issue_outputs_test.go index 698abdf01a..6e063143d2 100644 --- a/pkg/github/typed_issue_outputs_test.go +++ b/pkg/github/typed_issue_outputs_test.go @@ -259,7 +259,8 @@ func TestTypedIssueNullOutput(t *testing.T) { require.False(t, result.IsError) assert.Equal(t, "null", getTextResult(t, result).Text) if protocol == inventory.ProtocolVersionMultiRoundTrip { - assert.Nil(t, result.StructuredContent, "the SDK omits structuredContent when the typed output is null") + assert.NotNil(t, result.StructuredContent) + assert.JSONEq(t, "null", mustMarshalJSON(t, result.StructuredContent)) } else { assert.Nil(t, result.StructuredContent) } diff --git a/pkg/github/typed_search_outputs_test.go b/pkg/github/typed_search_outputs_test.go index b92d3c6a59..c617196cc3 100644 --- a/pkg/github/typed_search_outputs_test.go +++ b/pkg/github/typed_search_outputs_test.go @@ -121,7 +121,7 @@ func TestTypedProjectedReadToolOutputSchemas(t *testing.T) { assert.JSONEq(t, mustMarshalJSON(t, ifc.LabelRepoMetadata(false)), mustMarshalJSON(t, branches.Meta["ifc"])) if protocolVersion == inventory.ProtocolVersionMultiRoundTrip { assert.Equal(t, "[]", mustMarshalJSON(t, branches.StructuredContent)) - require.NoError(t, outputSchemas["list_branches"].Validate(branches.StructuredContent)) + require.NoError(t, outputSchemas["list_branches"].Validate(mustJSONValue(t, branches.StructuredContent))) } else { assert.Nil(t, branches.StructuredContent) } @@ -140,7 +140,7 @@ func TestTypedProjectedReadToolOutputSchemas(t *testing.T) { structured, err := json.Marshal(result.StructuredContent) require.NoError(t, err) assert.JSONEq(t, getTextResult(t, result).Text, string(structured)) - require.NoError(t, outputSchemas["list_tags"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["list_tags"].Validate(mustJSONValue(t, result.StructuredContent))) } result, err = session.CallTool(context.Background(), &mcp.CallToolParams{ @@ -163,7 +163,7 @@ func TestTypedProjectedReadToolOutputSchemas(t *testing.T) { structured, err := json.Marshal(result.StructuredContent) require.NoError(t, err) assert.JSONEq(t, getTextResult(t, result).Text, string(structured)) - require.NoError(t, outputSchemas["search_code"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["search_code"].Validate(mustJSONValue(t, result.StructuredContent))) } result, err = session.CallTool(context.Background(), &mcp.CallToolParams{ @@ -177,7 +177,7 @@ func TestTypedProjectedReadToolOutputSchemas(t *testing.T) { } if protocolVersion == inventory.ProtocolVersionMultiRoundTrip { assert.JSONEq(t, `{"total_count":1,"incomplete_results":false,"items":[{"name":"main.go","path":"cmd/main.go","sha":"abc123","repository":"owner/repo","text_matches":[{"object_type":"FileContent","property":"content","fragment":"func main()","matches":[{"text":"main","indices":[5,9]}]}]}]}`, getTextResult(t, result).Text) - require.NoError(t, outputSchemas["search_code"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["search_code"].Validate(mustJSONValue(t, result.StructuredContent))) assert.JSONEq(t, getTextResult(t, result).Text, mustMarshalJSON(t, result.StructuredContent)) } @@ -193,7 +193,7 @@ func TestTypedProjectedReadToolOutputSchemas(t *testing.T) { } else { assert.JSONEq(t, `{"total_count":1,"incomplete_results":false,"items":[{"number":42,"title":"A title","body":"A body","state":"open"}]}`, getTextResult(t, result).Text) assert.JSONEq(t, getTextResult(t, result).Text, mustMarshalJSON(t, result.StructuredContent)) - require.NoError(t, outputSchemas["search_issues"].Validate(result.StructuredContent)) + require.NoError(t, outputSchemas["search_issues"].Validate(mustJSONValue(t, result.StructuredContent))) } failure, err := session.CallTool(context.Background(), &mcp.CallToolParams{ @@ -397,3 +397,10 @@ func mustMarshalJSON(t *testing.T, value any) string { require.NoError(t, err) return string(encoded) } + +func mustJSONValue(t *testing.T, value any) any { + t.Helper() + var decoded any + require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, value)), &decoded)) + return decoded +} diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md index 002d5a25bf..315240c267 100644 --- a/third-party-licenses.darwin.md +++ b/third-party-licenses.darwin.md @@ -24,8 +24,8 @@ The following packages are included for the amd64, arm64 architectures. - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE)) - [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE)) - [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) - [github.com/muesli/cache2go](https://pkg.go.dev/github.com/muesli/cache2go) ([BSD-3-Clause](https://github.com/muesli/cache2go/blob/518229cd8021/LICENSE.txt)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.4/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.11.0/LICENSE)) @@ -42,11 +42,11 @@ The following packages are included for the amd64, arm64 architectures. - [github.com/subosito/gotenv](https://pkg.go.dev/github.com/subosito/gotenv) ([MIT](https://github.com/subosito/gotenv/blob/v1.6.0/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) - [go.yaml.in/yaml/v3](https://pkg.go.dev/go.yaml.in/yaml/v3) ([MIT](https://github.com/yaml/go-yaml/blob/v3.0.6/LICENSE)) - - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.61.0:LICENSE)) + - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.63.0:LICENSE)) - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://cs.opensource.google/go/x/oauth2/+/v0.38.0:LICENSE)) - - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.24.0:LICENSE)) - - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.49.0:LICENSE)) - - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.43.0:LICENSE)) + - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.25.0:LICENSE)) + - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.50.0:LICENSE)) + - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.44.0:LICENSE)) - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://cs.opensource.google/go/x/time/+/v0.15.0:LICENSE)) [github/github-mcp-server]: https://github.com/github/github-mcp-server diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md index 0b5cc2f591..94152ca40d 100644 --- a/third-party-licenses.linux.md +++ b/third-party-licenses.linux.md @@ -24,8 +24,8 @@ The following packages are included for the 386, amd64, arm64 architectures. - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE)) - [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE)) - [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) - [github.com/muesli/cache2go](https://pkg.go.dev/github.com/muesli/cache2go) ([BSD-3-Clause](https://github.com/muesli/cache2go/blob/518229cd8021/LICENSE.txt)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.4/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.11.0/LICENSE)) @@ -42,11 +42,11 @@ The following packages are included for the 386, amd64, arm64 architectures. - [github.com/subosito/gotenv](https://pkg.go.dev/github.com/subosito/gotenv) ([MIT](https://github.com/subosito/gotenv/blob/v1.6.0/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) - [go.yaml.in/yaml/v3](https://pkg.go.dev/go.yaml.in/yaml/v3) ([MIT](https://github.com/yaml/go-yaml/blob/v3.0.6/LICENSE)) - - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.61.0:LICENSE)) + - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.63.0:LICENSE)) - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://cs.opensource.google/go/x/oauth2/+/v0.38.0:LICENSE)) - - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.24.0:LICENSE)) - - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.49.0:LICENSE)) - - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.43.0:LICENSE)) + - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.25.0:LICENSE)) + - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.50.0:LICENSE)) + - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.44.0:LICENSE)) - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://cs.opensource.google/go/x/time/+/v0.15.0:LICENSE)) [github/github-mcp-server]: https://github.com/github/github-mcp-server diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md index 7f5e84a53d..67d0d716a0 100644 --- a/third-party-licenses.windows.md +++ b/third-party-licenses.windows.md @@ -25,8 +25,8 @@ The following packages are included for the 386, amd64, arm64 architectures. - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE)) - [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE)) - [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) - - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) + - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.9.0/LICENSE)) - [github.com/muesli/cache2go](https://pkg.go.dev/github.com/muesli/cache2go) ([BSD-3-Clause](https://github.com/muesli/cache2go/blob/518229cd8021/LICENSE.txt)) - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.4/LICENSE)) - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.11.0/LICENSE)) @@ -43,11 +43,11 @@ The following packages are included for the 386, amd64, arm64 architectures. - [github.com/subosito/gotenv](https://pkg.go.dev/github.com/subosito/gotenv) ([MIT](https://github.com/subosito/gotenv/blob/v1.6.0/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) - [go.yaml.in/yaml/v3](https://pkg.go.dev/go.yaml.in/yaml/v3) ([MIT](https://github.com/yaml/go-yaml/blob/v3.0.6/LICENSE)) - - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.61.0:LICENSE)) + - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.63.0:LICENSE)) - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://cs.opensource.google/go/x/oauth2/+/v0.38.0:LICENSE)) - - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.24.0:LICENSE)) - - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.49.0:LICENSE)) - - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.43.0:LICENSE)) + - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.25.0:LICENSE)) + - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.50.0:LICENSE)) + - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.44.0:LICENSE)) - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://cs.opensource.google/go/x/time/+/v0.15.0:LICENSE)) [github/github-mcp-server]: https://github.com/github/github-mcp-server