Skip to content

Commit e3bf5fd

Browse files
authored
mcp: fix github public server tests after they renamed their tools (#1326)
1 parent 791036a commit e3bf5fd

File tree

5 files changed

+14
-27
lines changed

5 files changed

+14
-27
lines changed

examples/mcp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Then, you can use the MCP Inspector to interact with the MCP Proxy:
3939
$ npx @modelcontextprotocol/inspector --cli http://localhost:1975/mcp --transport http --method 'tools/list' | jq '.tools[] | .name'
4040
"context7__resolve-library-id"
4141
"context7__get-library-docs"
42-
"github__get_pull_request"
42+
"github__pull_request_read"
4343
"kiwi__search-flight"
4444
```
4545

4646
### Accessing GitHub Pull Request Info
4747

4848
```
49-
$ npx @modelcontextprotocol/inspector --cli http://localhost:1975/mcp --transport http --method tools/call --tool-name github__get_pull_request --tool-arg owner="envoyproxy" --tool-arg repo="ai-gateway" --tool-arg pullNumber=1 | jq '.content[0] | .text'
49+
$ npx @modelcontextprotocol/inspector --cli http://localhost:1975/mcp --transport http --method tools/call --tool-name github__pull_request_read --tool-arg method="get" --tool-arg owner="envoyproxy" --tool-arg repo="ai-gateway" --tool-arg pullNumber=1 | jq '.content[0] | .text'
5050
"{\"id\":2136495058,\"number\":1,\"state\":\"closed\",\"locked\":false,\"title\":\"Initial README.md update with one-liner description.\",\"body\":\"Adding a one liner description to the project.\",\"created_at\":\"2024-10-21T16:05:59Z\",\"updated_at\":\"2024-10-21T16:08:23Z\",\"closed_at\":\"2024-10-21T16:08:23Z\",\"merged_at\":\"2024-10-21T16:08:23Z\",\"user\":{\"login\":\"missBerg\",\"id\":17533717,\"node_id\":\"MDQ6VXNlcjE3NTMzNzE3\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/17533717?v=4\",\"html_url\":\"https://github.com/missBerg\",\"gravatar_id\":\"\",\"type\":\"User\",\"site_admin\":false,\"url\":\"https://api.github.com/users/missBerg\",\"events_url\":\"https://api.github.com/users/missBerg/events{/privacy}\",\"following_url\":\"https://api.github.com/users/missBerg/following{/other_user}\",\"followers_url\":\"https://api.github.com/users/missBerg/followers\",\"gists_url\":\"https://api.github.com/users/missBerg/gists{/gist_id}\",\"organizations_url\":\"https://api.github.com/users/missBerg/orgs\",\"received_events_url\":\"https://api.github.com/users/missBerg/received_events\",\"repos_url\":\"https://api.github.com/users/missBerg/repos\",\"starred_url\":\"https://api.github.com/users/missBerg/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/missBerg/subscriptions\"},\"draft\":false,\"url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1\",\"html_url\":\"https://github.com/envoyproxy/ai-gateway/pull/1\",\"issue_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/issues/1\",\"statuses_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/statuses/eed3f2d3cca88b405d8dc289e56cc2f3477b7dbf\",\"diff_url\":\"https://github.com/envoyproxy/ai-gateway/pull/1.diff\",\"patch_url\":\"https://github.com/envoyproxy/ai-gateway/pull/1.patch\",\"commits_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1/commits\",\"comments_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/issues/1/comments\",\"review_comments_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1/comments\",\"review_comment_url\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/comments{/number}\",\"author_association\":\"MEMBER\",\"node_id\":\"PR_kwDONDTgas5_WFPS\",\"merged\":true,\"mergeable_state\":\"unknown\",\"merged_by\":{\"login\":\"mathetake\",\"id\":13513977,\"node_id\":\"MDQ6VXNlcjEzNTEzOTc3\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/13513977?v=4\",\"html_url\":\"https://github.com/mathetake\",\"gravatar_id\":\"\",\"type\":\"User\",\"site_admin\":false,\"url\":\"https://api.github.com/users/mathetake\",\"events_url\":\"https://api.github.com/users/mathetake/events{/privacy}\",\"following_url\":\"https://api.github.com/users/mathetake/following{/other_user}\",\"followers_url\":\"https://api.github.com/users/mathetake/followers\",\"gists_url\":\"https://api.github.com/users/mathetake/gists{/gist_id}\",\"organizations_url\":\"https://api.github.com/users/mathetake/orgs\",\"received_events_url\":\"https://api.github.com/users/mathetake/received_events\",\"repos_url\":\"https://api.github.com/users/mathetake/repos\",\"starred_url\":\"https://api.github.com/users/mathetake/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/mathetake/subscriptions\"},\"merge_commit_sha\":\"6ac636f42549f6166821f06f3127051c56d3f366\",\"comments\":0,\"commits\":0,\"additions\":0,\"deletions\":0,\"changed_files\":0,\"maintainer_can_modify\":false,\"review_comments\":0,\"_links\":{\"self\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1\"},\"html\":{\"href\":\"https://github.com/envoyproxy/ai-gateway/pull/1\"},\"issue\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/issues/1\"},\"comments\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/issues/1/comments\"},\"review_comments\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1/comments\"},\"review_comment\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/comments{/number}\"},\"commits\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/pulls/1/commits\"},\"statuses\":{\"href\":\"https://api.github.com/repos/envoyproxy/ai-gateway/statuses/eed3f2d3cca88b405d8dc289e56cc2f3477b7dbf\"}},\"head\":{\"label\":\"missBerg:main\",\"ref\":\"main\",\"sha\":\"eed3f2d3cca88b405d8dc289e56cc2f3477b7dbf\",\"repo\":{\"id\":876227501,\"node_id\":\"R_kgDONDorrQ\",\"owner\":{\"login\":\"missBerg\",\"id\":17533717,\"node_id\":\"MDQ6VXNlcjE3NTMzNzE3\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/17533717?v=4\",\"html_url\":\"https://github.com/missBerg\",\"gravatar_id\":\"\",\"type\":\"User\",\"site_admin\":false,\"url\":\"https://api.github.com/users/missBerg\",\"events_url\":\"https://api.github.com/users/missBerg/events{/privacy}\",\"following_url\":\"https://api.github.com/users/missBerg/following{/other_user}\",\"followers_url\":\"https://api.github.com/users/missBerg/followers\",\"gists_url\":\"https://api.github.com/users/missBerg/gists{/gist_id}\",\"organizations_url\":\"https://api.github.com/users/missBerg/orgs\",\"received_events_url\":\"https://api.github.com/users/missBerg/received_events\",\"repos_url\":\"https://api.github.com/users/missBerg/repos\",\"starred_url\":\"https://api.github.com/users/missBerg/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/missBerg/subscriptions\"},\"name\":\"ai-gateway-old\",\"full_name\":\"missBerg/ai-gateway-old\",\"default_branch\":\"main\",\"created_at\":\"2024-10-21T15:58:25Z\",\"pushed_at\":\"2025-07-29T20:21:41Z\",\"updated_at\":\"2025-07-29T20:26:19Z\",\"html_url\":\"https://github.com/missBerg/ai-gateway-old\",\"clone_url\":\"https://github.com/missBerg/ai-gateway-old.git\",\"git_url\":\"git://github.com/missBerg/ai-gateway-old.git\",\"ssh_url\":\"[email protected]:miss
5151
```
5252

examples/mcp/mcp_example.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ spec:
2222
path: "/mcp/readonly"
2323
toolSelector:
2424
includeRegex:
25-
- .*_pull_requests?.*
26-
- .*_issues?.*
25+
- .*pull_requests?.*
26+
- .*issues?.*
2727
securityPolicy:
2828
apiKey:
2929
secretRef:

site/blog/2025/2025-10-02-mcp-implementation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ spec:
147147
# Only expose certain tools
148148
toolSelector:
149149
includeRegex:
150-
- .*_pull_requests?.*
151-
- .*_issues?.*
150+
- .*pull_requests?.*
151+
- .*issues?.*
152152
# Configure upstream authentication
153153
securityPolicy:
154154
apiKey:

tests/e2e-aigw/examples_test.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,11 @@ var (
3737
allGithubTools = []string{
3838
"github__get_issue",
3939
"github__get_issue_comments",
40-
"github__get_pull_request",
41-
"github__get_pull_request_diff",
42-
"github__get_pull_request_files",
43-
"github__get_pull_request_review_comments",
44-
"github__get_pull_request_reviews",
45-
"github__get_pull_request_status",
4640
"github__list_issue_types",
4741
"github__list_issues",
4842
"github__list_pull_requests",
4943
"github__list_sub_issues",
44+
"github__pull_request_read",
5045
"github__search_issues",
5146
"github__search_pull_requests",
5247
}
@@ -67,16 +62,11 @@ var (
6762
"context7__resolve-library-id",
6863
"github__get_issue",
6964
"github__get_issue_comments",
70-
"github__get_pull_request",
71-
"github__get_pull_request_diff",
72-
"github__get_pull_request_files",
73-
"github__get_pull_request_review_comments",
74-
"github__get_pull_request_reviews",
75-
"github__get_pull_request_status",
7665
"github__list_issue_types",
7766
"github__list_issues",
7867
"github__list_pull_requests",
7968
"github__list_sub_issues",
69+
"github__pull_request_read",
8070
"github__search_issues",
8171
"github__search_pull_requests",
8272
"kiwi__feedback-to-devs",
@@ -160,10 +150,11 @@ func TestMCP_standalone(t *testing.T) {
160150
}
161151
if githubConfigured {
162152
tests = append(tests, callToolTest{
163-
toolName: "github__get_pull_request",
153+
toolName: "github__pull_request_read",
164154
params: map[string]any{
165155
"owner": "envoyproxy",
166156
"repo": "ai-gateway",
157+
"method": "get",
167158
"pullNumber": 1,
168159
},
169160
})

tests/extproc/mcp/publicmcp_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestPublicMCPServers(t *testing.T) {
4343
Name: "github",
4444
Path: "/mcp/readonly",
4545
ToolSelector: &filterapi.MCPToolSelector{
46-
IncludeRegex: []string{".*_pull_requests?.*", ".*_issues?.*"},
46+
IncludeRegex: []string{".*pull_requests?.*", ".*issues?.*"},
4747
},
4848
},
4949
)
@@ -90,12 +90,7 @@ func TestPublicMCPServers(t *testing.T) {
9090
if githubConfigured {
9191
exps = append(exps, "github__get_issue")
9292
exps = append(exps, "github__get_issue_comments")
93-
exps = append(exps, "github__get_pull_request")
94-
exps = append(exps, "github__get_pull_request_diff")
95-
exps = append(exps, "github__get_pull_request_files")
96-
exps = append(exps, "github__get_pull_request_review_comments")
97-
exps = append(exps, "github__get_pull_request_reviews")
98-
exps = append(exps, "github__get_pull_request_status")
93+
exps = append(exps, "github__pull_request_read")
9994
exps = append(exps, "github__list_issue_types")
10095
exps = append(exps, "github__list_issues")
10196
exps = append(exps, "github__list_pull_requests")
@@ -151,10 +146,11 @@ func TestPublicMCPServers(t *testing.T) {
151146
}
152147
if githubConfigured {
153148
tests = append(tests, callToolTest{
154-
toolName: "github__get_pull_request",
149+
toolName: "github__pull_request_read",
155150
params: map[string]any{
156151
"owner": "envoyproxy",
157152
"repo": "ai-gateway",
153+
"method": "get",
158154
"pullNumber": 1,
159155
},
160156
})

0 commit comments

Comments
 (0)