GitHub GraphQL MCP Server

GitHub GraphQL MCP Server

A Model Context Protocol server for executing arbitrary GraphQL queries on GitHub's API.

9
Stars
4
Forks
9
Watchers
1
Issues
GitHub GraphQL MCP Server is a Model Context Protocol (MCP) server that enables interaction with GitHub's GraphQL API. It allows users to execute any GraphQL queries and mutations against GitHub, supporting variable injection and error handling. The server is designed to integrate with Claude for Desktop, providing tooling for AI environments to access or manipulate GitHub data. Detailed documentation and configuration examples are provided for rapid setup and use.

Key Features

Arbitrary GraphQL query execution against GitHub
Support for GraphQL variables
Comprehensive error handling and reporting
Integration with Claude for Desktop
Detailed example queries and documentation
Secure authentication using GitHub personal access tokens
Cross-platform support via Python virtual environments
Customizable environment and configuration
Supports both queries and mutations
API rate limit awareness and diagnostics

Use Cases

Automating repository insights extraction for dashboards
Generating user or repository data summaries for developer assistants
Integrating GitHub data access into conversational AI agents
Bulk analysis of repositories, issues, or users through programmable workflows
Enabling AI models to retrieve contextual information from GitHub in real-time
Supporting research by extracting and aggregating open source project metadata
Custom notification or report systems based on live GitHub data
Enhancing AI coding assistants with fresh repository and user information
Exploring and testing complex GraphQL queries against GitHub’s API
Running batch mutations to manage repositories or metadata at scale

README

GitHub GraphQL MCP Server

QuentinCody/github-graphql-mcp-server context

A Model Context Protocol (MCP) server that provides access to GitHub's GraphQL API. This server exposes a single tool that allows executing arbitrary GraphQL queries and mutations against GitHub's API.

Features

  • Execute any GraphQL query against GitHub's API
  • Comprehensive error handling and reporting
  • Detailed documentation with example queries
  • Support for variables in GraphQL operations

Prerequisites

  • Python 3.10 or higher
  • A GitHub Personal Access Token (PAT)

Installation

  1. Clone this repository
  2. Set up a virtual environment (recommended):
    bash
    # On macOS/Linux
    python3 -m venv .venv
    source .venv/bin/activate
    
    # On Windows
    python -m venv .venv
    .venv\Scripts\activate
    
  3. Install dependencies:
    bash
    pip install -r requirements.txt
    

Usage

Running the Server

bash
# If using a virtual environment, make sure it's activated
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Run the server with your GitHub token
GITHUB_TOKEN=your_github_token_here python github_graphql_mcp_server.py

Configuring with Claude for Desktop

Add the following to your Claude Desktop configuration file:

json
{
  "github-graphql": {
    "command": "/absolute/path/to/your/.venv/bin/python",
    "args": [
        "/absolute/path/to/github_graphql_mcp_server.py"
    ],
    "options": {
        "cwd": "/absolute/path/to/repository"
    },
    "env": {
        "GITHUB_TOKEN": "your_github_token_here"
    }
  }
}

Replace /absolute/path/to/ with the actual path to your server file and add your GitHub token.

Example Queries

Get Repository Information

graphql
query GetRepo($owner: String!, $name: String!) {
  repository(owner: $owner, name: $name) {
    name
    description
    stargazerCount
    url
    createdAt
    owner {
      login
      avatarUrl
    }
  }
}

Variables:

json
{
  "owner": "octocat",
  "name": "Hello-World"
}

Search Repositories

graphql
query SearchRepos($query: String!, $first: Int!) {
  search(query: $query, type: REPOSITORY, first: $first) {
    repositoryCount
    edges {
      node {
        ... on Repository {
          name
          owner { login }
          description
          stargazerCount
          url
        }
      }
    }
  }
}

Variables:

json
{
  "query": "language:python stars:1000",
  "first": 5
}

Get User Information

graphql
query GetUserInfo($login: String!) {
  user(login: $login) {
    name
    login
    bio
    avatarUrl
    followers {
      totalCount
    }
    repositories(first: 5, orderBy: {field: STARGAZERS, direction: DESC}) {
      nodes {
        name
        description
        stargazerCount
      }
    }
  }
}

Variables:

json
{
  "login": "octocat"
}

GitHub API Rate Limits

Be aware of GitHub's API rate limits:

  • Authenticated requests: 5,000 requests per hour
  • Unauthenticated requests: 60 requests per hour

Troubleshooting

If you encounter issues:

  1. Check your GitHub token has the correct permissions
  2. Verify your virtual environment is properly set up and activated
  3. Ensure your token is correctly set in the environment variables
  4. If using Claude Desktop, ensure the path to Python is correct (use absolute path to the virtual environment Python)
  5. Look at the server logs for error messages
  6. Ensure your GraphQL query is valid for GitHub's schema
  7. Restart Claude for Desktop after making config changes

Common Errors

spawn python ENOENT

  • This error means the Python executable wasn't found
  • Solution: Use the full path to your Python executable in the virtual environment (e.g., /path/to/your/.venv/bin/python)

ModuleNotFoundError: No module named 'httpx' (or other packages)

  • The Python environment doesn't have the required dependencies installed
  • Solution: Make sure you've activated the virtual environment and run pip install -r requirements.txt

Error: GitHub token not found in environment variables

  • The server couldn't find your GitHub token

  • Solution: Make sure you've set the GITHUB_TOKEN environment variable

License

MIT

Star History

Star History Chart

Repository Owner

Repository Details

Language Python
Default Branch main
Size 18 KB
Contributors 2
License Other
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mcp-graphql

    mcp-graphql

    Enables LLMs to interact dynamically with GraphQL APIs via Model Context Protocol.

    mcp-graphql provides a Model Context Protocol (MCP) server that allows large language models to discover and interact with GraphQL APIs. The implementation facilitates schema introspection, exposes the GraphQL schema as a resource, and enables secure query and mutation execution based on configuration. It supports configuration through environment variables, automated or manual installation options, and offers flexibility in using local or remote schema files. By default, mutation operations are disabled for security, but can be enabled if required.

    • 319
    • MCP
    • blurrah/mcp-graphql
  • gqai

    gqai

    Expose GraphQL operations as Model Context Protocol (MCP) tools for AI models.

    gqai is a lightweight proxy that converts GraphQL operations into MCP-compatible tools, enabling integration with AI systems such as ChatGPT, Claude, and Cursor. It automatically discovers and exposes GraphQL queries and mutations as callable tools via an MCP server, powered by your existing GraphQL backend. Configuration is managed via standard .graphqlrc.yml and .graphql files, with support for dynamic endpoints and environment variables.

    • 21
    • MCP
    • fotoetienne/gqai
  • mcp-graphql-forge

    mcp-graphql-forge

    Configuration-driven MCP server exposing modular GraphQL queries as tools.

    mcp-graphql-forge provides a lightweight, easily configurable Model Context Protocol (MCP) server that transforms any GraphQL endpoint into a set of modular API tools. Tools, defined in YAML, specify GraphQL queries and parameters to enable curated interactions via a standardized protocol. Written in Go, it emphasizes modularity, security, and extensibility without requiring code changes, and offers ready-to-run binaries for all major platforms.

    • 3
    • MCP
    • UnitVectorY-Labs/mcp-graphql-forge
  • Shopify Storefront MCP Server

    Shopify Storefront MCP Server

    Seamless Shopify Storefront API access for AI assistants via Model Context Protocol

    Enables AI assistants to interact with Shopify store data through standardized MCP tools. Offers endpoints for product discovery, inventory management, GraphQL queries, cart operations, and comprehensive customer data manipulation. Designed for easy integration with MCP-compatible AI and automated token handling. Simplifies secure connection to Shopify's Storefront API with minimal configuration.

    • 5
    • MCP
    • QuentinCody/shopify-storefront-mcp-server
  • Google Workspace MCP Server

    Google Workspace MCP Server

    A secure MCP server bridging Google Workspace and AI clients.

    Google Workspace MCP Server implements the Model Context Protocol to enable secure integration between Google Workspace services—such as Gmail, Calendar, and Drive—and any MCP-compatible AI client. It allows users to read, search, create, update, and delete Google Calendar events, emails, and Drive files directly through an AI agent interface. The tool ensures authentication via Google OAuth and provides a seamless setup process for both server and client sides. This makes it easier for AI-powered workflows to interact with Google Workspace data securely and contextually.

    • 20
    • MCP
    • giuseppe-coco/Google-Workspace-MCP-Server
  • Perplexity MCP Server

    Perplexity MCP Server

    MCP Server integration for accessing the Perplexity API with context-aware chat completion.

    Perplexity MCP Server provides a Model Context Protocol (MCP) compliant server that interfaces with the Perplexity API, enabling chat completion with citations. Designed for seamless integration with clients such as Claude Desktop, it allows users to send queries and receive context-rich responses from Perplexity. Environment configuration for API key management is supported, and limitations with long-running requests are noted. Future updates are planned to enhance support for client progress reporting.

    • 85
    • MCP
    • tanigami/mcp-server-perplexity
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results