add support for GraphQL
Describe the feature or problem you’d like to solve
Adding support for GraphQL could close many feature gaps and allow for constructing versatile queries without the need to implement each REST endpoint separately.
Also, it would allow for access to the latest API features since REST API is usually the last one to get updated.
+1 to this, I need GraphQL support, some APIs are exclusively available only through graphql
cc. @williammartin - saw you've been working on https://github.com/github/github-mcp-server/issues/343 here: https://github.com/github/github-mcp-server/commit/1e9fbbcf9731a24974542488d399bd0c904b10e7
Is this officially endorsed library to use for GraphQL endpoints? would love to contribute some more endpoints, once your PR is merged.
@0xRaduan no decision made yet, sorry. It will likely either be shurcooL/githubv4 or the underlying shurcooL/graphql. I hope that #343 will be our first introduction of tools backed by graphql and then we'll be able to go from there. I definitely want to make sure we've fleshed out the testing patterns before we open it up to contributions. I will definitely leave a message here once I'm happy.
We now have a couple of tools that are using GQL, for example https://github.com/github/github-mcp-server/blob/7e026fc43828fdd41c24969784ee92e4f9f0b2ae/pkg/github/issues.go#L747-L904
I expect that over time we will discover new patterns and make adjustments but I don't think there's anything specifically blocking usage of GQL now. I would expect the existing patterns of using shurcooL and githubv4mock to be followed. I'll call out that I just wrote an MVP implementation of the latter, so you are likely to run into frustrations as we massage it into something ergonomic (as much as possible given Go's bad support for anonymous structs).
@williammartin this is closed as completed but I don't see graphql query as a tool in mcp. Was graphql actually added and usable by an agent?
I think I misunderstood the original ask in retrospect. I understood it as "bring in the necessary patterns so that tools can be built that use the GQL API", which did happen in pull request reviews and copilot. However, on re-reading I think this might be a request for a generalised GQL tool, which does not exist. I'm not working on this anymore right now, so I'll just reopen and someone from the team can have a look. Cheers for the nudge.
This issue is stale because it has been open for 30 days with no activity. Leave a comment to avoid closing this issue in 60 days.
However, on re-reading I think this might be a request for a generalised GQL tool, which does not exist.
Just to clarify, I wanted to be able to ask copilot for data and make it use GraphQL to get it.
Eg: "How many open issues do I have?" or "Give a list of pull requests assigned to me for a review."
It should be a fairly simple thing to implement because there's just one endpoint.