GitHub MCP Server

GitHub MCP Server

Enables AI agents to interact with GitHub repositories through the GitHub REST API for managing files, issues, and repository metadata. It supports both read operations like searching code and write operations such as creating repositories and updating issue comments.

Category
Visit Server

README

GitHub MCP Server

Model Context Protocol server for GitHub repository management and interaction.

Overview

This MCP server enables AI agents to interact with GitHub repositories via the GitHub REST API. Built with TypeScript using the official MCP SDK and Octokit.

Version: 0.2.0 (Phase 2 Complete)
Author: Pip (@pipseedai)
License: MIT

Features

Phase 1: Read Operations ✅

  • github_list_repos - List repositories for a user or organization
  • github_get_repo - Get detailed repository information
  • github_get_file - Read file contents from a repository
  • github_list_issues - List repository issues with filters
  • github_search_code - Search code across GitHub repositories

Phase 2: Write Operations ✅

  • github_create_repo - Create a new repository
  • github_create_issue - Create an issue with title, body, labels, assignees
  • github_update_issue - Update issue (title, body, state, labels, assignees)
  • github_create_comment - Add comments to issues or pull requests

Phase 3: Advanced Features (Future)

  • Pull request creation and management
  • Branch and commit operations
  • Repository forking and starring
  • Workflow and release management

Installation

cd ~/.openclaw/workspace/mcp-servers/github
npm install
npm run build

Authentication

Requires a GitHub Personal Access Token stored in ~/.openclaw/secrets/github.env:

GITHUB_TOKEN=ghp_your_token_here

Usage

Via mcporter CLI

# List repositories for authenticated user
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_list_repos()'

# Get repository information
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_get_repo(owner: "modelcontextprotocol", repo: "servers")'

# Read file contents
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_get_file(owner: "owner", repo: "repo", path: "README.md")'

# List repository issues
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_list_issues(owner: "owner", repo: "repo", state: "open")'

# Search code
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_search_code(query: "addClass in:file language:js")'

Available Tools

github_list_repos

List repositories for a user or organization.

Parameters:

  • username (optional) - GitHub username/org (defaults to authenticated user)
  • type (optional) - Filter: "all", "owner", "member" (default: "owner")
  • sort (optional) - Sort by: "created", "updated", "pushed", "full_name" (default: "updated")
  • per_page (optional) - Results per page (default: 30, max: 100)

github_get_repo

Get detailed information about a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name

Returns: Repository metadata including description, stars, forks, language, topics, etc.

github_get_file

Read file contents from a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • path (required) - File path in repository
  • ref (optional) - Branch, tag, or commit SHA (default: default branch)

Returns: Decoded file content as text

github_list_issues

List issues for a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • state (optional) - "open", "closed", "all" (default: "open")
  • labels (optional) - Comma-separated label names
  • per_page (optional) - Results per page (default: 30, max: 100)

github_search_code

Search for code across GitHub repositories.

Parameters:

  • query (required) - Search query (supports GitHub search syntax)
  • per_page (optional) - Results per page (default: 30, max: 100)

Example queries:

  • "addClass in:file language:js repo:owner/repo"
  • "function user:pipseedai"
  • "TODO extension:md"

github_create_repo

Create a new GitHub repository.

Parameters:

  • name (required) - Repository name
  • description (optional) - Repository description
  • private (optional) - Private repository (default: false)
  • auto_init (optional) - Initialize with README (default: false)

github_create_issue

Create a new issue in a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • title (required) - Issue title
  • body (optional) - Issue description (supports Markdown)
  • labels (optional) - Array of label names
  • assignees (optional) - Array of GitHub usernames
  • milestone (optional) - Milestone number

github_update_issue

Update an existing issue.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • issue_number (required) - Issue number
  • title (optional) - New title
  • body (optional) - New description
  • state (optional) - "open" or "closed"
  • labels (optional) - Array of label names (replaces existing)
  • assignees (optional) - Array of usernames (replaces existing)

github_create_comment

Add a comment to an issue or pull request.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • issue_number (required) - Issue or PR number
  • body (required) - Comment text (supports Markdown)

Rate Limits

  • Authenticated: 5,000 requests/hour
  • Search: 30 requests/minute
  • Errors (403/429) are caught and returned gracefully

Development

# Build
npm run build

# Watch mode
npm run watch

File Structure

mcp-servers/github/
├── package.json
├── tsconfig.json
├── README.md
├── src/
│   └── index.ts          # Main server implementation
└── dist/                 # Compiled JavaScript
    ├── index.js
    └── index.d.ts

Testing

Phase 1 (Read Operations):

  • ✅ Authentication with GitHub PAT
  • ✅ List repositories
  • ✅ Get repository details (tested on modelcontextprotocol/servers)
  • ✅ Read file contents (tested on README.md)
  • ✅ List issues with filters
  • ✅ Search code across repositories

Phase 2 (Write Operations):

  • ✅ Create repository (tested on pipseedai/mcp-test)
  • ✅ Create issues with labels
  • ✅ Update issue title, body, state, labels
  • ✅ Add comments to issues

Validation: All tools tested on https://github.com/pipseedai/mcp-test

Next Steps

  • [ ] Add Phase 3 advanced features (PRs, branches, commits, forks)
  • [ ] Add unit tests
  • [ ] Improve error handling and validation
  • [ ] Add response caching for frequently accessed data
  • [ ] Consider GraphQL API for complex queries
  • [ ] Add workflow and release management tools

References


Created: 2026-02-03
Last Updated: 2026-02-05
Repository: https://github.com/pipseedai/github-mcp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured