- Notifications
You must be signed in to change notification settings - Fork2.7k
Add starred repository support to GitHub MCP server#1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>
- Add ListStarredRepositories tool for listing starred repos- Add StarRepository tool for starring repositories- Add UnstarRepository tool for unstarring repositories- Update MinimalRepository struct with StarredAt field- Add comprehensive test coverage for all new functionality- Register new tools in the repos toolsetCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>
- Add list_starred_repositories tool documentation- Add star_repository tool documentation- Add unstar_repository tool documentation- Include comprehensive parameter descriptions for all new toolsCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>
Co-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>
nshaikh99 commentedSep 11, 2025
Preparing review... |
8 similar comments
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
nshaikh99 commentedSep 11, 2025
Preparing review... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR implements comprehensive starred repository functionality for the GitHub MCP server, enabling agents to search and manage starred repositories through natural language interactions.
- Adds three new tools:
list_starred_repositories
,star_repository
, andunstar_repository
- Enables listing starred repositories for authenticated users or specific users with pagination and sorting options
- Provides tools to star and unstar repositories with proper error handling
- Updates the
MinimalRepository
struct withstarred_at
field for tracking when repositories were starred
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/github/tools.go | Registers the new starred repository tools in the repos toolset |
pkg/github/repositories.go | Implements the three new starred repository functions with GitHub API integration |
pkg/github/repositories_test.go | Adds comprehensive test coverage for all three new tools |
pkg/github/toolsnaps/*.snap | Creates tool snapshots for testing and validation |
README.md | Documents the new tools with parameter descriptions |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
// Convert to minimal format | ||
minimalRepos:=make([]MinimalRepository,0,len(repos)) | ||
for_,starredRepo:=rangerepos { | ||
repo:=starredRepo.Repository | ||
minimalRepo:=MinimalRepository{ | ||
ID:repo.GetID(), | ||
Name:repo.GetName(), | ||
FullName:repo.GetFullName(), | ||
Description:repo.GetDescription(), | ||
HTMLURL:repo.GetHTMLURL(), | ||
Language:repo.GetLanguage(), | ||
Stars:repo.GetStargazersCount(), | ||
Forks:repo.GetForksCount(), | ||
OpenIssues:repo.GetOpenIssuesCount(), | ||
Private:repo.GetPrivate(), | ||
Fork:repo.GetFork(), | ||
Archived:repo.GetArchived(), | ||
DefaultBranch:repo.GetDefaultBranch(), | ||
} | ||
ifrepo.UpdatedAt!=nil { | ||
minimalRepo.UpdatedAt=repo.UpdatedAt.Format("2006-01-02T15:04:05Z") | ||
} | ||
minimalRepos=append(minimalRepos,minimalRepo) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
TheMinimalRepository
struct is missing aStarredAt
field that should be populated fromstarredRepo.StarredAt
. The PR description mentions adding astarred_at
field to track when repositories were starred, but this field is not being set in the conversion logic.
Copilot uses AI. Check for mistakes.
I removed the starred_at attribute from the minimal struct as i dont think this field is really needed often in 99% of all cases. |
010cf9b
intomainUh oh!
There was an error while loading.Please reload this page.
khowhom172-del commentedSep 16, 2025
|
khowhom172-del commentedSep 16, 2025
vf |
* Initial plan* Initial exploration and planning for starred repository supportCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>* Implement starred repository functionality with comprehensive tests- Add ListStarredRepositories tool for listing starred repos- Add StarRepository tool for starring repositories- Add UnstarRepository tool for unstarring repositories- Update MinimalRepository struct with StarredAt field- Add comprehensive test coverage for all new functionality- Register new tools in the repos toolsetCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>* Update README documentation with starred repository tools- Add list_starred_repositories tool documentation- Add star_repository tool documentation- Add unstar_repository tool documentation- Include comprehensive parameter descriptions for all new toolsCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>* Add starred repository support to GitHub MCP serverCo-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>* remove starredat from minimal view* update descriptions* remove bin* dont commit the binary---------Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>Co-authored-by: tonytrg <40869903+tonytrg@users.noreply.github.com>Co-authored-by: tonytrg <tonytrg@github.com>
Uh oh!
There was an error while loading.Please reload this page.
This PR implements comprehensive starred repository functionality for the GitHub MCP server, addressing the feature request to enable agents to search and manage starred repositories.
Also removes the github-mcp-server binary, which prob was accidentally commited.
What's Added
New Tools
list_starred_repositories
- Lists starred repositories for the authenticated user or a specified userusername
parameter to list starred repos for any usercreated
(when starred) orupdated
(when repo was last pushed)MinimalRepository
format with additionalstarred_at
fieldstar_repository
- Stars a repositoryowner
andrepo
parametersunstar_repository
- Unstars a repositoryowner
andrepo
parametersImplementation Details
starred_at
field toMinimalRepository
struct to track when repositories were starred 🔴repos
toolset (read-only for listing, write tools for starring/unstarring)Use Cases
This enables powerful agent workflows like:
API Coverage
Implements GitHub's starred repository REST API endpoints:
GET /user/starred
- List starred repositories for authenticated userGET /users/{username}/starred
- List starred repositories for specific userPUT /user/starred/{owner}/{repo}
- Star a repositoryDELETE /user/starred/{owner}/{repo}
- Unstar a repositoryThe implementation enables agents to leverage users' curated collections of starred repositories as a high-quality signal for dependency selection and project discovery, as mentioned in the original issue.
Additional instructions:
Fixes#414
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.