Repository navigation
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive GitHub Packages toolset to the GitHub MCP Server, enabling management and retrieval of package information for both organizations and users. The addition provides nine package-related operations including listing, retrieving details, and deletion capabilities for packages and their versions.
- Adds a new "packages" toolset with read/write operations for managing GitHub packages
- Implements comprehensive test coverage for all package operations with proper error handling scenarios
- Updates documentation to include the new packages toolset with detailed tool descriptions
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/tools.go | Adds packages toolset metadata and integrates it into the default toolset group |
| pkg/github/packages.go | Implements all package-related operations with proper error handling and API interactions |
| pkg/github/packages_test.go | Comprehensive test suite covering all package operations with success and error scenarios |
| pkg/github/toolsnaps/*.snap | Generated tool snapshots for all package operations with proper schema definitions |
| docs/remote-server.md | Documents the new packages toolset with installation links |
| README.md | Updates toolset list and adds detailed package tool documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Add the delete:packages scope to the supported OAuth scope catalog without requesting it by default, so it is only requested through a per-tool scope challenge when package deletion is used.
Add an opt-in "packages" toolset with two consolidated tools: - packages_read: list/get packages and package versions for organizations and users (the authenticated user when username is omitted), with package_type/visibility/state filters and pagination. - packages_write: delete packages or individual package versions for organizations and users. Marked destructive and requires read:packages and delete:packages. Closes github#1208
32e6b97 to
c8a0139
Compare
|
@SamMorrowDrums PTAL |
JoannaaKL
left a comment
There was a problem hiding this comment.
Thank you for your contribition @MayorFaj! A few things to address before we can merge this pr:
Blocking
- The build is broken after the latest
mainmerge, the imports inpackages.go/packages_test.goneed updating. - #3398 requires typed outputs, so
TestToolDefinitionsUseConcreteOutputTypesfails for both tools. SeeProjectsGetOutput/ProjectsWriteOutputfor the method-tagged pattern, then regenerate the toolsnaps. package_typeis required by all three list-packages endpoints (they return 422 without it), so it can't be optional forlist_org_packages/list_user_packages.
Additional asks
- Return trimmed package/version types instead of raw
github.Package, which embeds the fullownerandrepositoryobjects. Keepmetadata.container.tagson versions. delete_user_*silently ignoresorgand acts on the authenticated user. Reject mismatched owner args, or useowner+owner_typelikeprojects_*.- Nit: note in the descriptions that the Packages API only accepts classic PATs/OAuth app tokens, and that the
/users/{username}get/version endpoints are public-only.
… outputs, required package_type, and owner validation Signed-off-by: MayorFaj <mayorfaj@gmail.com>
|
Thanks @JoannaaKL All addressed:
Tests and lint pass, and I live-tested both tools against real packages. |

This PR adds an opt-in
packagestoolset for GitHub Packages, with two consolidated tools.Closes #1208
Tools
packages_read(read-only, requiresread:packages)list_org_packages,get_org_package,list_org_package_versions,get_org_package_versionorglist_user_packages,get_user_package,list_user_package_versions,get_user_package_versionusername, or the authenticated user when omittedThe list methods support the
package_typeandvisibilityfilters (packages), thestatefilter (versions), andpage/perPage.packages_write(destructiveHint: true, requiresread:packages+delete:packages)delete_org_package,delete_org_package_version,delete_user_package,delete_user_package_versionNotes for review
packagesis not added to the default toolset.delete:packagesscope topkg/scopes. It is not requested by default (same treatment asdelete_repo), so it is only requested through a per-tool scope challenge.delete_repositoryelicitation flow. Deleted packages and versions can be restored for 30 days, and the other delete operations here (issues, discussion comments) rely ondestructiveHint. Happy to add confirmation if you'd prefer.Users.ListUserPackageVersionsdoesn't accept list options, so listing another user's package versions builds the request directly to passstate/page/per_page. I verified that the endpoint honors them.pkg/ifc. I can add one as a follow-up if wanted.Testing
go test ./...andscript/lintpass. Toolsnaps and docs are regenerated withUPDATE_TOOLSNAPS=true/script/generate-docs.kgateway-dev, including pagination, filters, and slash-containing names likecharts/kgateway--read-only, which hidespackages_writeNote: Download statistics are not available through the GitHub REST API and are not included in responses, though they are visible on the GitHub web interface.
Closes: #1208
