Title: Split PR review creation, commenting and submission, and deletion by williammartin · Pull Request #381 · github/github-mcp-server · GitHub
Open Graph Title: Split PR review creation, commenting and submission, and deletion by williammartin · Pull Request #381 · github/github-mcp-server
X Title: Split PR review creation, commenting and submission, and deletion by williammartin · Pull Request #381 · github/github-mcp-server
Description: Description Relates to: #343 @toby @SamMorrowDrums before I go any further cleaning up the new and old tools, handling edge cases and adding unit, I want to get your feedback on this approach, since there have been quite a few pain points along the way. The original issue suggested removing comments from create_pull_request_review and depending on add_pull_request_review_comment, however, add_pull_request_review_comment uses the REST API which is only able to create a single comment and only if a review is not already in progress. Thus, we need to lean on GraphQL here to: Create a pending review (mvp_create_pending_pull_request_review) Add a comment to that pending review (mvp_add_pull_request_review_comment_to_pending_review) Submit the pending review (mvp_submit_pull_request_review) The implicit requirement here is that a user may only have one pending review at a time, so if we get their most recent review on a PR, and it is pending, we can add a comment to that. This does not allow commenting on other reviews and it does not allow commenting on already submitted reviews, which could be further enhancements in the same or in different tools. There is an additional challenge since we are now using GraphQL which is that for the most part, queries and mutations operate on GraphQL IDs (node_id in the REST API). So for example, when we create a pending review, there is a reviewId that is required for commenting. Within a single session, it would be easy to return the id in the textContent but this: Leaks the API implementation (maybe not a big deal?) Would require new sessions to request the Id in some way in order to provide it the next time For now, I've decided with these very explicit tools (e.g. mvp_add_pull_request_review_comment_to_pending_review) to allow the model to be API implementation agnostic, and that the tool will internally do the lookup. For example, since we know there can only be one review for the user, knowing the owner, repo and pr number seems to be enough to look up the most recent review. The downside is that it's a bit more restrictive and requires more internal API lookups than an alternative which might be to expose a get_pending_review and allow the model to figure it out. If you asked me I would ship this and wait for feedback on when it sucks or should be enhanced later but I don't have much confidence in my intuition here. Cheers. Currently passes e2e tests: ➜ github-mcp-server git:(0ca07aa) ✗ GOMAXPROCS=1 GITHUB_MCP_SERVER_E2E_TOKEN=$(gh auth token) go test -v -count=1 --tags e2e ./e2e === RUN TestGetMe === PAUSE TestGetMe === RUN TestToolsets === PAUSE TestToolsets === RUN TestTags === PAUSE TestTags === RUN TestPullRequestReview === PAUSE TestPullRequestReview === CONT TestGetMe e2e_test.go:49: Building Docker image for e2e tests... e2e_test.go:123: Starting Stdio MCP client... --- PASS: TestGetMe (3.33s) === CONT TestPullRequestReview e2e_test.go:123: Starting Stdio MCP client... e2e_test.go:384: Getting current user... e2e_test.go:413: Creating repository williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:437: Creating branch in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:454: Creating commit with new file in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:482: Creating pull request in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:497: Creating pending review for pull request in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:518: Adding review comment to pull request in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:534: Submitting review for pull request in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:548: Getting reviews for pull request in williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... e2e_test.go:422: Deleting repository williammartin/github-mcp-server-e2e-TestPullRequestReview-1746631692347... --- PASS: TestPullRequestReview (9.26s) === CONT TestTags e2e_test.go:123: Starting Stdio MCP client... e2e_test.go:246: Getting current user... e2e_test.go:275: Creating repository williammartin/github-mcp-server-e2e-TestTags-1746631701637... e2e_test.go:292: Creating tag williammartin/github-mcp-server-e2e-TestTags-1746631701637:v0.0.1... e2e_test.go:322: Listing tags for williammartin/github-mcp-server-e2e-TestTags-1746631701637... e2e_test.go:355: Getting tag williammartin/github-mcp-server-e2e-TestTags-1746631701637:v0.0.1... e2e_test.go:284: Deleting repository williammartin/github-mcp-server-e2e-TestTags-1746631701637... --- PASS: TestTags (3.75s) === CONT TestToolsets e2e_test.go:123: Starting Stdio MCP client... --- PASS: TestToolsets (0.17s) PASS ok github.com/github/github-mcp-server/e2e 16.767s
Open Graph Description: Description Relates to: #343 @toby @SamMorrowDrums before I go any further cleaning up the new and old tools, handling edge cases and adding unit, I want to get your feedback on this approach, sinc...
X Description: Description Relates to: #343 @toby @SamMorrowDrums before I go any further cleaning up the new and old tools, handling edge cases and adding unit, I want to get your feedback on this approach, sinc...
Opengraph URL: https://github.com/github/github-mcp-server/pull/381
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a85f5119-ed74-e2bb-5cd9-0e73cd6fac61 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D1A6:F7C62:89B7BE:C1B067:6B06DABC |
| html-safe-nonce | 083db684fdb6c189353446d50e9d56f89b0333789ced59425820d9d38bbe03f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUE2OkY3QzYyOjg5QjdCRTpDMUIwNjc6NkIwNkRBQkMiLCJ2aXNpdG9yX2lkIjoiNjgwODA3Nzg2NTI3Njg1NzAyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | df5ef14a7590fd987754b97257988b1798dd3e81b72bdf0b1a164cdb6de1aa7d |
| hovercard-subject-tag | pull_request:2504835354 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/github-mcp-server/pull/381/files |
| twitter:image | https://avatars.githubusercontent.com/u/1611510?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1611510?s=400&v=4 |
| og:image:alt | Description Relates to: #343 @toby @SamMorrowDrums before I go any further cleaning up the new and old tools, handling edge cases and adding unit, I want to get your feedback on this approach, sinc... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06cadd0061c549662a50be90eb5baba7608f00f521574931eec01db0deb9e636 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 942771284 |
| octolytics-dimension-repository_nwo | github/github-mcp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 942771284 |
| octolytics-dimension-repository_network_root_nwo | github/github-mcp-server |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6953c712585a8d7406b7695e48fffcb670fd241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width