Skip to content

Commit f66279e

Browse files
committed
Refactor GitHub package tools: consolidate package-related functions under PackagesRead and PackagesWrite
- Updated test cases to reflect new function names and structures. - Replaced ListOrgPackages, GetOrgPackage, ListPackageVersions, and GetPackageVersion with PackagesRead. - Replaced ListUserPackages with PackagesWrite. - Adjusted input schema and annotations for read-only and write operations. - Enhanced deletion tests for organization and user packages and their versions.
1 parent eaf332c commit f66279e

16 files changed

+832
-1831
lines changed

README.md

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -868,58 +868,40 @@ Options are:
868868

869869
<summary>Packages</summary>
870870

871-
- **delete_org_package** - Delete organization package
872-
- `org`: Organization name (string, required)
873-
- `package_name`: Package name (string, required)
874-
- `package_type`: Package type (string, required)
875-
876-
- **delete_org_package_version** - Delete organization package version
877-
- `org`: Organization name (string, required)
878-
- `package_name`: Package name (string, required)
879-
- `package_type`: Package type (string, required)
880-
- `package_version_id`: Package version ID (number, required)
881-
882-
- **delete_user_package** - Delete user package
883-
- `package_name`: Package name (string, required)
884-
- `package_type`: Package type (string, required)
885-
886-
- **delete_user_package_version** - Delete user package version
887-
- `package_name`: Package name (string, required)
888-
- `package_type`: Package type (string, required)
889-
- `package_version_id`: Package version ID (number, required)
890-
891-
- **get_org_package** - Get organization package details
892-
- `org`: Organization name (string, required)
893-
- `package_name`: Package name (string, required)
894-
- `package_type`: Package type (string, required)
895-
896-
- **get_package_version** - Get package version details
897-
- `org`: Organization name (string, required)
898-
- `package_name`: Package name (string, required)
899-
- `package_type`: Package type (string, required)
900-
- `package_version_id`: Package version ID (number, required)
901-
902-
- **list_org_packages** - List organization packages
903-
- `org`: Organization name (string, required)
904-
- `package_type`: Filter by package type (string, optional)
871+
- **packages_read** - Read package information
872+
- `method`: Action to specify what package data needs to be retrieved from GitHub.
873+
Possible options:
874+
1. list_org_packages - List packages for a GitHub organization. Requires 'org' parameter. Supports optional 'package_type' and 'visibility' filters.
875+
2. get_org_package - Get details of a specific package for an organization. Requires 'org', 'package_type', and 'package_name' parameters.
876+
3. list_package_versions - List versions of a package for an organization. Requires 'org', 'package_type', and 'package_name' parameters. Supports optional 'state' filter.
877+
4. get_package_version - Get details of a specific package version. Requires 'org', 'package_type', 'package_name', and 'package_version_id' parameters.
878+
5. list_user_packages - List packages for a GitHub user. Requires 'username' parameter. Supports optional 'package_type' and 'visibility' filters.
879+
880+
Note: Download statistics are not available via the GitHub REST API. (string, required)
881+
- `org`: Organization name (required for org-related methods) (string, optional)
882+
- `package_name`: Package name (required for get_org_package, list_package_versions, and get_package_version methods) (string, optional)
883+
- `package_type`: Package type (string, optional)
884+
- `package_version_id`: Package version ID (required for get_package_version method) (number, optional)
905885
- `page`: Page number for pagination (min 1) (number, optional)
906886
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
907-
- `visibility`: Filter by package visibility (string, optional)
908-
909-
- **list_package_versions** - List package versions
910-
- `org`: Organization name (string, required)
911-
- `package_name`: Package name (string, required)
912-
- `package_type`: Package type (string, required)
913-
- `page`: Page number for pagination (min 1) (number, optional)
914-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
915-
- `state`: Filter by version state (string, optional)
916-
917-
- **list_user_packages** - List user packages
918-
- `package_type`: Filter by package type (string, optional)
919-
- `page`: Page number for pagination (min 1) (number, optional)
920-
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
921-
- `username`: GitHub username (string, required)
922-
- `visibility`: Filter by package visibility (string, optional)
887+
- `state`: Filter by version state (optional for list_package_versions method) (string, optional)
888+
- `username`: GitHub username (required for list_user_packages method) (string, optional)
889+
- `visibility`: Filter by package visibility (optional for list methods) (string, optional)
890+
891+
- **packages_write** - Delete operations on packages
892+
- `method`: The write operation to perform on packages.
893+
894+
Available methods:
895+
1. delete_org_package - Delete an entire package from an organization. This will delete all versions of the package. Requires 'org', 'package_type', and 'package_name' parameters.
896+
2. delete_org_package_version - Delete a specific version of a package from an organization. Requires 'org', 'package_type', 'package_name', and 'package_version_id' parameters.
897+
3. delete_user_package - Delete an entire package from the authenticated user's account. This will delete all versions of the package. Requires 'package_type' and 'package_name' parameters.
898+
4. delete_user_package_version - Delete a specific version of a package from the authenticated user's account. Requires 'package_type', 'package_name', and 'package_version_id' parameters.
899+
900+
All operations require delete:packages scope. (string, required)
901+
- `org`: Organization name (required for delete_org_package and delete_org_package_version methods) (string, optional)
902+
- `package_name`: Package name (required for all methods) (string, required)
903+
- `package_type`: Package type (required for all methods) (string, required)
904+
- `package_version_id`: Package version ID (required for delete_org_package_version and delete_user_package_version methods) (number, optional)
923905

924906
</details>
925907

docs/remote-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Below is a table of available toolsets for the remote GitHub MCP Server. Each to
1919
<!-- START AUTOMATED TOOLSETS -->
2020
| Name | Description | API URL | 1-Click Install (VS Code) | Read-only Link | 1-Click Read-only Install (VS Code) |
2121
|----------------|--------------------------------------------------|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
22-
| Default | ["Default" toolset](../README.md#default-toolset) | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Freadonly%22%7D) |
22+
| all | All available GitHub MCP tools | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2F%22%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Freadonly%22%7D) |
2323
| Actions | GitHub Actions workflows and CI/CD operations | https://api.githubcopilot.com/mcp/x/actions | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/actions/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-actions&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Factions%2Freadonly%22%7D) |
2424
| Code Security | Code security related tools, such as GitHub Code Scanning | https://api.githubcopilot.com/mcp/x/code_security | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/code_security/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-code_security&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fcode_security%2Freadonly%22%7D) |
2525
| Dependabot | Dependabot tools | https://api.githubcopilot.com/mcp/x/dependabot | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%22%7D) | [read-only](https://api.githubcopilot.com/mcp/x/dependabot/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-dependabot&config=%7B%22type%22%3A%20%22http%22%2C%22url%22%3A%20%22https%3A%2F%2Fapi.githubcopilot.com%2Fmcp%2Fx%2Fdependabot%2Freadonly%22%7D) |

pkg/github/__toolsnaps__/delete_org_package.snap

Lines changed: 0 additions & 38 deletions
This file was deleted.

pkg/github/__toolsnaps__/delete_org_package_version.snap

Lines changed: 0 additions & 43 deletions
This file was deleted.

pkg/github/__toolsnaps__/delete_user_package.snap

Lines changed: 0 additions & 33 deletions
This file was deleted.

pkg/github/__toolsnaps__/delete_user_package_version.snap

Lines changed: 0 additions & 38 deletions
This file was deleted.

pkg/github/__toolsnaps__/get_org_package.snap

Lines changed: 0 additions & 38 deletions
This file was deleted.

pkg/github/__toolsnaps__/get_package_version.snap

Lines changed: 0 additions & 43 deletions
This file was deleted.

pkg/github/__toolsnaps__/list_org_packages.snap

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)