Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

Copilot
Copy link
Contributor

@CopilotCopilotAI commentedSep 11, 2025
edited by tonytrg
Loading

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 user

  • Optionalusername parameter to list starred repos for any user
  • Sorting options bycreated (when starred) orupdated (when repo was last pushed)
  • Standard pagination support
  • Returns repositories inMinimalRepository format with additionalstarred_at field

star_repository - Stars a repository

  • Requiresowner andrepo parameters
  • Returns success confirmation message

unstar_repository - Unstars a repository

  • Requiresowner andrepo parameters
  • Returns success confirmation message

Implementation Details

  • All tools follow existing patterns and use the same error handling approach
  • Addedstarred_at field toMinimalRepository struct to track when repositories were starred 🔴
  • Tools are registered in therepos toolset (read-only for listing, write tools for starring/unstarring)
  • Comprehensive test coverage with mocked HTTP clients following existing test patterns
  • Updated README documentation with complete parameter descriptions

Use Cases

This enables powerful agent workflows like:

"Show me my starred Python projects that have been updated recently""Star the facebook/react repository for future reference""List repositories that @transitive-bullshit has starred, sorted by star count""Find my starred machine learning repositories with more than 1000 stars"

API Coverage

Implements GitHub's starred repository REST API endpoints:

  • GET /user/starred - List starred repositories for authenticated user
  • GET /users/{username}/starred - List starred repositories for specific user
  • PUT /user/starred/{owner}/{repo} - Star a repository
  • DELETE /user/starred/{owner}/{repo} - Unstar a repository

The 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:

Please take the comments as example and find suitable api endpoints to build the tool from.

  • write tests
  • update the readme doc

Fixes#414


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.

CopilotAIand others added4 commitsSeptember 11, 2025 14:23
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>
@CopilotCopilotAI changed the title[WIP] Starred repo supportAdd starred repository support to GitHub MCP serverSep 11, 2025
@CopilotCopilotAI requested a review fromtonytrgSeptember 11, 2025 14:35
Copilot finished work on behalf oftonytrgSeptember 11, 2025 14:35
@nshaikh99
Copy link

Preparing review...

8 similar comments
@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@nshaikh99
Copy link

Preparing review...

@tonytrgtonytrg marked this pull request as ready for reviewSeptember 12, 2025 12:49
@tonytrgtonytrg requested a review froma team as acode ownerSeptember 12, 2025 12:49
@CopilotCopilotAI review requested due to automatic review settingsSeptember 12, 2025 12:49
Copy link
Contributor

@CopilotCopilotAI left a 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 theMinimalRepository 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
FileDescription
pkg/github/tools.goRegisters the new starred repository tools in the repos toolset
pkg/github/repositories.goImplements the three new starred repository functions with GitHub API integration
pkg/github/repositories_test.goAdds comprehensive test coverage for all three new tools
pkg/github/toolsnaps/*.snapCreates tool snapshots for testing and validation
README.mdDocuments the new tools with parameter descriptions

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

Comment on lines +1771 to +1796
// 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)
}
Copy link
Preview

CopilotAISep 12, 2025

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.

@tonytrg
Copy link
Contributor

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.

@tonytrgtonytrg merged commit010cf9b intomainSep 12, 2025
16 checks passed
@tonytrgtonytrg deleted the copilot/fix-8d6e5df9-0eeb-4cf4-8638-d63fe34060bb branchSeptember 12, 2025 14:11
@khowhom172-del
Copy link

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 user

  • Optionalusername parameter to list starred repos for any user
  • Sorting options bycreated (when starred) orupdated (when repo was last pushed)
  • Standard pagination support
  • Returns repositories inMinimalRepository format with additionalstarred_at field

star_repository - Stars a repository

  • Requiresowner andrepo parameters
  • Returns success confirmation message

unstar_repository - Unstars a repository

  • Requiresowner andrepo parameters
  • Returns success confirmation message

Implementation Details

  • All tools follow existing patterns and use the same error handling approach
  • Addedstarred_at field toMinimalRepository struct to track when repositories were starred 🔴
  • Tools are registered in therepos toolset (read-only for listing, write tools for starring/unstarring)
  • Comprehensive test coverage with mocked HTTP clients following existing test patterns
  • Updated README documentation with complete parameter descriptions

Use Cases

This enables powerful agent workflows like:

"Show me my starred Python projects that have been updated recently""Star the facebook/react repository for future reference""List repositories that @transitive-bullshit has starred, sorted by star count""Find my starred machine learning repositories with more than 1000 stars"

API Coverage

Implements GitHub's starred repository REST API endpoints:

  • GET /user/starred - List starred repositories for authenticated user
  • GET /users/{username}/starred - List starred repositories for specific user
  • PUT /user/starred/{owner}/{repo} - Star a repository
  • DELETE /user/starred/{owner}/{repo} - Unstar a repository

The 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:

Please take the comments as example and find suitable api endpoints to build the tool from.

  • write tests
  • update the readme doc

Fixes#414

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.

@khowhom172-del
Copy link

vf

nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull requestOct 4, 2025
* 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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

+1 more reviewer

@tonytrgtonytrgtonytrg approved these changes

Reviewers whose approvals may not affect merge requirements
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Starred repo support
4 participants
@Copilot@nshaikh99@tonytrg@khowhom172-del

[8]ページ先頭

©2009-2025 Movatter.jp