MCP

Query GitHub Data with GraphQL

Connect to the GitHub GraphQL API to execute custom queries and mutations for retrieving and manipulating repository and user data.

Works with github

90
Spark score
out of 100
Updated 2 days ago
Version 1.0.0

Add to Favorites

Why it matters

Access and manipulate GitHub data programmatically using GraphQL. This asset enables executing custom queries and mutations to retrieve repository details, user information, and other GitHub resources.

Outcomes

What it gets done

01

Execute arbitrary GraphQL queries against the GitHub API.

02

Retrieve repository, user, and other GitHub resource data.

03

Support for GraphQL variables for dynamic query construction.

04

Handle GitHub API rate limits and authentication.

Install

Add it to your toolbox

Capabilities

Tools your agent gets

Extract
extract
Query a database
query-db
Generate code
generate-code
Audit access
audit-access

Overview

What this is, in full

What it does

An MCP server that provides access to the GitHub GraphQL API, allowing you to execute arbitrary GraphQL queries and mutations to retrieve repository data, user information, and other GitHub resources.

Installation

From Source

# Clone repository
# Set up virtual environment:
python3 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
# Install dependencies:
pip install -r requirements.txt

Running the Server

# Activate virtual environment
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
# Run with GitHub token
GITHUB_TOKEN=your_github_token_here python github_graphql_mcp_server.py

Configuration

Claude Desktop

{
  "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"
    }
  }
}

Features

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

Environment Variables

Required

  • GITHUB_TOKEN - GitHub Personal Access Token for API authentication

Usage Examples

Retrieve repository information, including name, description, stars, and owner data
Search repositories by programming language and star count
Get user information, including biography, followers, and top repositories
Query repository star count and creation dates
Search for Python repositories with more than 1,000 stars

Notes

Requires Python 3.10 or higher. Be aware of GitHub API rate limits: 5,000 requests per hour for authenticated requests, 60 for unauthenticated requests. Common issues include incorrect Python paths in the Claude Desktop config and failure to activate the virtual environment.

Trust

How it checks out

Spark score
90/100
Updated
2 days ago
Classification
90% confidence
Verification
Community

Reviews

What people say after installing

4.0
1 ratings

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.