github / github/github-mcp-server

Add support for raw GraphQL queries

Open
#2,437 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
33k
Forks
5k
Avg merge
2d 1h
Merged PRs (30d)
52

Description

## Feature Request: Raw GraphQL Query Tool

### Problem

The current MCP server exposes a rich set of REST-based tools but has no way to execute arbitrary GraphQL queries against the GitHub API. This is a significant gap because several important GitHub operations are only available — or significantly richer — via GraphQL.

A concrete example that motivated this request: resolving pull request review threads requires the `PRRT_xxx` node ID, which is only returned by GraphQL. With the current MCP server there is no way to resolve review threads programmatically, even though `pull_request_review_write` supports the `resolve_thread` method and accepts a `threadId`.

### Proposed Solution

Add a `graphql` tool that executes a raw GraphQL query or mutation against `https://api.github.com/graphql`, e.g.:

```json
{
"name": "graphql",
"description": "Execute a raw GraphQL query or mutation against the GitHub API.",
"parameters": {
"query": "string — the GraphQL query or mutation",
"variables": "object (optional) — variables to pass to the query"
}
}
```

### Use Cases

- Fetching pull request review thread node IDs (`PRRT_xxx`) to resolve threads
- Querying `suggestedActors` to discover the Copilot bot handle before assigning
- Using `assignCopilotToIssue` mutation (currently only available via GraphQL)
- Any operation that returns richer data via GraphQL than the equivalent REST endpoint

### Notes

- The existing `list_issues` tool already uses GraphQL under the hood, so the infrastructure is there
- A raw query tool would unlock the full GitHub GraphQL API surface without requiring a new dedicated tool for every GraphQL-only feature

Thanks for the great work on the MCP server!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.