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.
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
Execute arbitrary GraphQL queries against the GitHub API.
Retrieve repository, user, and other GitHub resource data.
Support for GraphQL variables for dynamic query construction.
Handle GitHub API rate limits and authentication.
Install
Add it to your toolbox
Capabilities
Tools your agent gets
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
Reviews
What people say after installing
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.