GnistAI GnistAI
Log in

Getting Started with GitHub

Public GitHub data — repositories, issues, pull requests, and user profiles.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Software

Data source: GitHub API

Overview

GitHub wraps GitHub API, handling authentication, pagination, and rate limits for you. This tutorial covers all 5 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-github": {
      "url": "https://context.gnist.ai/mcp/github/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (5)

search_repos

Search public GitHub repositories by keyword. Returns up to 10 repositories ranked by star count. Args: query: Search terms (e.g. "machine learning framework", "http client"). language: Filter by programming language (e.g. "python", "typescript"). Optional. stars_min: Minimum star count filter (e.g. 100). Optional. Returns: List of repositories with full_name, description, stars, forks, language, license (SPDX id), last_pushed (ISO 8601), topics, and url.

ParameterTypeRequiredDescription
querystringrequiredSearch terms (e.g. "machine learning framework", "http client").
languageanyoptionalFilter by programming language (e.g. "python", "typescript"). Optional.
stars_minanyoptionalMinimum star count filter (e.g. 100). Optional.
curl -X POST "https://context.gnist.ai/mcp/github/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_repos", "arguments": {"query": "machine learning framework"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/github/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'machine learning framework'},
            'name': 'search_repos'}},
)
print(resp.json())

get_readme

Fetch and decode the README for a GitHub repository. Useful for understanding what a project does before recommending it. Args: owner: Repository owner (user or org), e.g. "fastapi". repo: Repository name, e.g. "fastapi". Returns: Object with owner, repo, and content (raw README text, typically Markdown).

ParameterTypeRequiredDescription
ownerstringrequiredRepository owner (user or org), e.g. "fastapi".
repostringrequiredRepository name, e.g. "fastapi".
curl -X POST "https://context.gnist.ai/mcp/github/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_readme", "arguments": {"owner": "fastapi", "repo": "fastapi"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/github/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'owner': 'fastapi', 'repo': 'fastapi'},
            'name': 'get_readme'}},
)
print(resp.json())

list_open_issues

List open issues for a public GitHub repository. Pull requests are excluded. Returns up to 30 issues, newest first. Args: owner: Repository owner (user or org), e.g. "django". repo: Repository name, e.g. "django". labels: Filter by label names (e.g. ["bug", "help wanted"]). Optional. Returns: List of issues with number, title, state, author, labels, created_at, updated_at, and url.

ParameterTypeRequiredDescription
ownerstringrequiredRepository owner (user or org), e.g. "django".
repostringrequiredRepository name, e.g. "django".
labelsanyoptionalFilter by label names (e.g. ["bug", "help wanted"]). Optional.
curl -X POST "https://context.gnist.ai/mcp/github/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_open_issues", "arguments": {"owner": "django", "repo": "django"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/github/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'owner': 'django', 'repo': 'django'},
            'name': 'list_open_issues'}},
)
print(resp.json())

get_repo_stats

Get metadata and statistics for a specific public GitHub repository. Args: owner: Repository owner (user or org), e.g. "astral-sh". repo: Repository name, e.g. "ruff". Returns: Repository metadata: full_name, description, stars, forks, language, license (SPDX id), last_pushed (ISO 8601), topics, and url.

ParameterTypeRequiredDescription
ownerstringrequiredRepository owner (user or org), e.g. "astral-sh".
repostringrequiredRepository name, e.g. "ruff".
curl -X POST "https://context.gnist.ai/mcp/github/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_repo_stats", "arguments": {"owner": "astral-sh", "repo": "ruff"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/github/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'owner': 'astral-sh', 'repo': 'ruff'},
            'name': 'get_repo_stats'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/github/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/github/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_repos to find items, then get_readme to get full details. This two-step pattern is common for exploring data before drilling down.

FAQ

What data does GitHub provide?

Public GitHub data — repositories, issues, pull requests, and user profiles. It exposes 5 tools: search_repos, get_readme, list_open_issues, get_repo_stats, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the GitHub API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials