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. - Execute any GraphQL query against GitHub's API - Comprehensive error handling and reporting - Detailed documentation with example queries - Support for variables in GraphQL operations - Python 3.1
Add this skill
npx mdskills install QuentinCody/github-graphql-mcp-serverProvides flexible access to GitHub's GraphQL API with clear setup instructions and practical examples
1# GitHub GraphQL MCP Server23[](https://uithub.com/QuentinCody/github-graphql-mcp-server?accept=text%2Fhtml&maxTokens=50000&ext=py)45A 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.67## Features89- Execute any GraphQL query against GitHub's API10- Comprehensive error handling and reporting11- Detailed documentation with example queries12- Support for variables in GraphQL operations1314## Prerequisites1516- Python 3.10 or higher17- A GitHub Personal Access Token (PAT)1819## Installation20211. Clone this repository222. Set up a virtual environment (recommended):23 ```bash24 # On macOS/Linux25 python3 -m venv .venv26 source .venv/bin/activate2728 # On Windows29 python -m venv .venv30 .venv\Scripts\activate31 ```323. Install dependencies:33 ```bash34 pip install -r requirements.txt35 ```3637## Usage3839### Running the Server4041```bash42# If using a virtual environment, make sure it's activated43source .venv/bin/activate # On Windows: .venv\Scripts\activate4445# Run the server with your GitHub token46GITHUB_TOKEN=your_github_token_here python github_graphql_mcp_server.py47```4849### Configuring with Claude for Desktop5051Add the following to your Claude Desktop configuration file:5253```json54{55 "github-graphql": {56 "command": "/absolute/path/to/your/.venv/bin/python",57 "args": [58 "/absolute/path/to/github_graphql_mcp_server.py"59 ],60 "options": {61 "cwd": "/absolute/path/to/repository"62 },63 "env": {64 "GITHUB_TOKEN": "your_github_token_here"65 }66 }67}68```6970Replace `/absolute/path/to/` with the actual path to your server file and add your GitHub token.7172### Example Queries7374#### Get Repository Information7576```graphql77query GetRepo($owner: String!, $name: String!) {78 repository(owner: $owner, name: $name) {79 name80 description81 stargazerCount82 url83 createdAt84 owner {85 login86 avatarUrl87 }88 }89}90```9192Variables:93```json94{95 "owner": "octocat",96 "name": "Hello-World"97}98```99100#### Search Repositories101102```graphql103query SearchRepos($query: String!, $first: Int!) {104 search(query: $query, type: REPOSITORY, first: $first) {105 repositoryCount106 edges {107 node {108 ... on Repository {109 name110 owner { login }111 description112 stargazerCount113 url114 }115 }116 }117 }118}119```120121Variables:122```json123{124 "query": "language:python stars:1000",125 "first": 5126}127```128129#### Get User Information130131```graphql132query GetUserInfo($login: String!) {133 user(login: $login) {134 name135 login136 bio137 avatarUrl138 followers {139 totalCount140 }141 repositories(first: 5, orderBy: {field: STARGAZERS, direction: DESC}) {142 nodes {143 name144 description145 stargazerCount146 }147 }148 }149}150```151152Variables:153```json154{155 "login": "octocat"156}157```158159## GitHub API Rate Limits160161Be aware of GitHub's API rate limits:162- Authenticated requests: 5,000 requests per hour163- Unauthenticated requests: 60 requests per hour164165## Troubleshooting166167If you encounter issues:1681691. Check your GitHub token has the correct permissions1702. Verify your virtual environment is properly set up and activated1713. Ensure your token is correctly set in the environment variables1724. If using Claude Desktop, ensure the path to Python is correct (use absolute path to the virtual environment Python)1735. Look at the server logs for error messages1746. Ensure your GraphQL query is valid for GitHub's schema1757. Restart Claude for Desktop after making config changes176177### Common Errors178179**`spawn python ENOENT`**180- This error means the Python executable wasn't found181- Solution: Use the full path to your Python executable in the virtual environment (e.g., `/path/to/your/.venv/bin/python`)182183**`ModuleNotFoundError: No module named 'httpx'` (or other packages)**184- The Python environment doesn't have the required dependencies installed185- Solution: Make sure you've activated the virtual environment and run `pip install -r requirements.txt`186187**`Error: GitHub token not found in environment variables`**188- The server couldn't find your GitHub token189190- Solution: Make sure you've set the GITHUB_TOKEN environment variable191192## License193194[MIT](LICENSE)195=======196197
Full transparency — inspect the skill content before installing.