Explore GitHub GraphQL API MCP for efficient schema exploration, query execution, and data retrieval optimization
The GitHub GraphQL API MCP Server is a specialized tool leveraging the Model Context Protocol (MCP) to explore and query the GitHub GraphQL API. This server allows developers to effectively interact with the GitHub API through an intuitive interface, designed for AI applications like Claude Desktop, Continue, Cursor, and more. By providing detailed schema documentation and precise data retrieval capabilities, it significantly optimizes token usage in AI models, making it a powerful component in modern software development workflows.
The GitHub GraphQL API MCP Server offers an array of features that make it indispensable for developers working with GitHub's GraphQL API through MCP clients. It provides the following core functionalities:
The server is built using the Model Context Protocol (MCP), a protocol designed for standardized interactions between AI applications and their underlying data sources. The architecture integrates seamlessly with popular AI clients, providing a robust platform for executing GraphQL queries.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This diagram illustrates the flow where AI applications communicate with MCP servers, which in turn interact with data sources like GitHub's GraphQL API.
First, clone the repository from GitHub:
git clone https://github.com/wanzunz/github_graphql_api_mcp.git
cd github_graphql_api_mcp
Install the required dependencies using Poetry or a traditional virtual environment setup:
# Using Poetry (recommended)
poetry install
# Or, traditional method
python -m venv .venv
source .venv/bin/activate # Linux/MacOS
# or
.venv\Scripts\activate # Windows
pip install -e .
Set up the necessary environment variables in a .env
file:
cp .env.example .env
Edit the .env
file, replacing your_github_token_here
with your actual GitHub token.
print_type_field
tool to query fields such as name, description, stars, branches, etc.Use the print_type_field tool, parameters type_name="QUERY", type_fields_name="repository"
call_github_graphql
to execute queries such as fetching issue lists and comments.Use the call_github_graphql tool, parameter:
graphql="""
query {
repository(owner: "octocat", name: "Hello-World") {
issues(states: [OPEN]) {
nodes {
title
body
}
}
}
}
"""
Integrating the GitHub GraphQL API MCP Server with the Claude desktop app involves setting up the MCP server configuration:
{
"mcpServers": {
"github_mcp": {
"command": "/usr/bin/python3",
"args": [
"--directory",
"/home/user/projects/github_graphql_api_mcp/",
"run",
"github_graphql_api_mcp_server.py"
]
}
}
}
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
{
"mcpServers": {
"github_mcp": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"]
}
}
}
Ensure the GitHub token in your .env
file is secure and not committed to version control.
The server optimizes data retrieval, reducing API calls and improving efficiency in token usage, which is crucial for AI models.
Yes, while primary focus is on Claude Desktop, the server is compatible with any MCP client that supports GitHub GraphQL integration.
GitHub API has rate limits. Make sure these are respected and consider the impact of frequent queries.
Check the environment variables for correct paths and tokens, ensuring network connectivity is stable, and the MCP protocol configurations match those expected by the client.
Yes, with minor modifications to the codebase, you can extend its functionality to other Git platforms like GitLab or Bitbucket using similar MCP protocols.
Contributions are welcome. Please follow these guidelines when contributing:
For more detailed information, see the CONTRIBUTING.md file in the repository.
Explore additional resources within the MCP ecosystem:
By leveraging the GitHub GraphQL API MCP Server, developers can build robust AI workflows that are both efficient and flexible.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration