Skip to content

feat: implement get_repository_discussions tool with GraphQL support #261

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sridharavinash
Copy link

@sridharavinash sridharavinash commented Apr 13, 2025

New Feature: Fetch GitHub Discussions

  • pkg/github/discussions.go: Added a new tool to fetch discussions from a specific GitHub repository using the GraphQL API. This includes defining structures for Comment and Discussion, and implementing the GetRepositoryDiscussions function.

Server Setup Updates

  • cmd/github-mcp-server/main.go: Updated the server setup to create and use a GraphQL client alongside the REST API client. This includes changes to the runStdioServer function to handle OAuth2 token creation and GraphQL client initialization. [1] [2] [3]

Dependency Modifications

  • go.mod: Added dependencies for githubv4 and oauth2 to support the new GraphQL functionality. [1] [2]

Additional Changes

Open questions

Debating if the client should be an interface rather than passing it in another function to the server .

Locked bool `json:"locked"`
UpvoteCount int `json:"upvoteCount"`
CommentCount int `json:"commentCount"`
Comments []Comment `json:"comments,omitempty"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really glad we would be able to also have access to the comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants