LearnNewsExamplesServices
Frontmatter
id7590
titleEpic: Migrate GitHub MCP Services from GH CLI to GraphQL API
stateClosed
labels
enhancementepicairefactoring
assigneestobiu
createdAtOct 21, 2025, 1:02 PM
updatedAtOct 23, 2025, 4:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/7590
authortobiu
commentsCount1
parentIssuenull
subIssues
7591 Implement GraphQL Client & Auth Service
7592 Migrate Label & Issue Services to GraphQL
7593 Migrate PullRequestService to GraphQL
7594 Migrate SyncService to GraphQL
7595 Finalize GraphQL Migration & Cleanup
7598 Finalize MCP Server Config Refactoring
7599 Externalize GraphQL Queries for Label and PullRequest Services
7600 Update OpenAPI Specification to Reflect GraphQL Data Models
subIssuesCompleted8
subIssuesTotal8
blockedBy[]
blocking[]
closedAtOct 23, 2025, 4:58 PM

Epic: Migrate GitHub MCP Services from GH CLI to GraphQL API

Closed v11.0.0 enhancementepicairefactoring
tobiu
tobiu commented on Oct 21, 2025, 1:02 PM

To overcome the limitations of the gh CLI and build a more scalable and performant foundation for our GitHub integration, this epic outlines the complete migration of our MCP services' data access layer. All remote data-fetching and mutation operations currently using gh subprocess calls will be refactored to use direct calls to the official GitHub GraphQL API.

While the gh CLI provided a rapid path to a working prototype, it lacks support for critical features (e.g., issue relationships) and is less performant for complex queries. A direct GraphQL implementation will give us full, typed access to the GitHub API, improve performance by consolidating queries, and provide a single, robust data layer for all current and future features.

Operations that perform local Git repository manipulations (e.g., gh pr checkout) will be explicitly excluded from this migration and will continue to use the gh CLI.

Key Sub-Tasks

  1. #7591 - Implement GraphQL Client & Auth Service:

    • Add a lightweight HTTP client (node-fetch) to package.json.
    • Create a new GraphqlService to encapsulate all API calls.
    • Implement a method within the service to fetch the GitHub auth token from the gh CLI (gh auth token) and manage the required HTTP headers.
  2. #7592 - Migrate Label & Issue Services to GraphQL:

    • Refactor LabelService.listLabels to use a GraphQL query.
    • Refactor IssueService.addLabels and IssueService.removeLabels to use GraphQL mutations.
  3. #7593 - Migrate PullRequestService to GraphQL:

    • Refactor listPullRequests, createComment, and getConversation to use GraphQL queries and mutations.
    • Investigate and refactor getPullRequestDiff. Note that checkoutPullRequest will remain a gh CLI call.
  4. #7594 - Migrate SyncService to GraphQL:

    • Rewrite #pullFromGitHub to use a single, comprehensive GraphQL query that fetches issues, comments, and their relationships (parent, children, etc.).
    • Rewrite #pushToGitHub to use a GraphQL mutation for updating issues.
    • Rewrite #fetchAndCacheReleases to use a GraphQL query.
  5. #7595 - Finalize Migration & Cleanup:

    • Remove the generic #ghCommand helper method from SyncService.
    • Review all services to ensure no unnecessary gh calls remain.
    • Update all relevant JSDoc comments and documentation to reflect the new GraphQL data access patterns.
tobiu assigned to @tobiu on Oct 21, 2025, 1:02 PM
tobiu added the enhancement label on Oct 21, 2025, 1:02 PM
tobiu added the epic label on Oct 21, 2025, 1:02 PM
tobiu added the ai label on Oct 21, 2025, 1:02 PM
tobiu added the refactoring label on Oct 21, 2025, 1:02 PM
tobiu added sub-issue #7591 on Oct 21, 2025, 1:04 PM
tobiu added sub-issue #7592 on Oct 21, 2025, 1:06 PM
tobiu added sub-issue #7593 on Oct 21, 2025, 1:07 PM
tobiu added sub-issue #7594 on Oct 21, 2025, 1:08 PM
tobiu added sub-issue #7595 on Oct 21, 2025, 1:09 PM
tobiu referenced in commit 07585d7 - "#7590 tickets as md files" on Oct 21, 2025, 1:12 PM
tobiu referenced in commit df9a3bb - "#7590 PullRequestService imports formatting" on Oct 21, 2025, 1:55 PM
tobiu added sub-issue #7598 on Oct 22, 2025, 10:49 AM
tobiu added sub-issue #7599 on Oct 22, 2025, 11:02 AM
tobiu added sub-issue #7600 on Oct 22, 2025, 11:17 AM
tobiu
tobiu Oct 23, 2025, 4:58 PM

resolved.

tobiu closed this issue on Oct 23, 2025, 4:58 PM