mcpField
G
GitHub MCP Server Setup Guide

GitHub MCP Server Setup Guide

Local
github.com/sonadukane18Version Control0Updated 77w ago

About GitHub MCP Server Setup Guide

GitHub MCP Server Setup Guide is an experimental repository documenting setup of the GitHub MCP server for AI-assisted development. It is for developers who want an assistant to work with repositories, files, issues, and pull requests using a personal access token.

Key features

  1. 01Configure the GitHub MCP server
  2. 02Use a personal access token for permissions
  3. 03Access repository information and files
  4. 04Create and manage issues and pull requests

Use cases

  1. 01Set up GitHub access in an MCP-compatible assistant
  2. 02Fetch repository file contents
  3. 03Create a repository or issue
  4. 04Prepare and manage pull requests

MCP support

The guide explains how to configure `@modelcontextprotocol/server-github` so an MCP-compatible assistant can perform GitHub operations. The documented capabilities depend on the configured personal access token permissions.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"Experimental-MCP-Server-created-by-Github-MCP": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<GITHUB_PERSONAL_ACCESS_TOKEN>"
}
}
}
}
Run commandnpx -y @modelcontextprotocol/server-github
Environment variables to set
GITHUB_PERSONAL_ACCESS_TOKENSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@modelcontextprotocol/server-github

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

GitHub MCP Server Setup Guide

This repository demonstrates how to set up and use a GitHub Model Context Protocol (MCP) server for AI-assisted development workflows.

What is MCP?

Model Context Protocol (MCP) enables AI assistants to interact with external systems and APIs through standardized interfaces. The GitHub MCP server specifically allows AI models to perform GitHub operations like:

  • Creating/managing repositories
  • Managing files and content
  • Working with issues and pull requests
  • Accessing repository information
  • And more!

Setup Instructions

Prerequisites
  • Node.js installed on your system
  • A GitHub account
  • A GitHub Personal Access Token (PAT) with appropriate permissions
Step 1: Create a GitHub Personal Access Token
  1. Go to GitHub Settings → Developer Settings → Personal Access Tokens
  2. Create a new fine-grained token with the following permissions:
    • Repository: Read and write (Administration, Contents, Issues, Pull requests)
    • User: Read-only
  3. Save your token securely - you'll need it for the configuration
Step 2: Set Up MCP Configuration
  1. Create a configuration file named mcp.json in your user directory (e.g., ~/.cursor/mcp.json or C:\Users\YourUsername\.cursor\mcp.json)
  2. Add the following configuration:
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat_here"
      }
    }
  }
}
  1. Replace your_github_pat_here with your actual GitHub Personal Access Token
Step 3: Test Your MCP Server
  1. Install a compatible AI coding assistant that supports MCP (like Cursor)
  2. Ask the assistant to perform GitHub operations, such as:
    • Creating repositories
    • Fetching file contents
    • Creating issues
    • Making pull requests

Usage Examples

Here are some examples of operations you can perform with your GitHub MCP:

  • Create a new repository: Create a new GitHub repository named "my-project"
  • Push code to a repository: Push this file to my repository
  • Create an issue: Create an issue titled "Fix navigation bug" in my repository
  • Fetch repository contents: Show me the contents of the main.js file from my repository

Troubleshooting

  • Permission Errors: Ensure your GitHub PAT has the necessary permissions for the operations you're trying to perform
  • Connection Issues: Check that your MCP server is properly configured and running
  • Token Expiration: GitHub PATs can expire - check if you need to generate a new one

Resources


Note: Always keep your GitHub Personal Access Token secure and never commit it to public repositories.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.