Skip to main content
Glama

GitHub MCP Assistant

A production-ready Model Context Protocol (MCP) server that gives Claude Desktop read and write access to GitHub repositories.

Built with FastMCP, this local integration allows Claude to analyze code, track issues, inspect pull requests, create issues, and post comments directly to GitHub through natural-language commands.

The server runs locally using stdio, so your GitHub credentials and repository interactions stay on your machine while communicating directly with the GitHub API.


✨ Features

GitHub MCP Assistant provides the following tools:

Tool

Description

get_latest_issues

Fetches the 5 most recent open issues from a GitHub repository.

get_pr_diff

Retrieves the code diff for a specific Pull Request. Responses are automatically truncated to 5,000 characters.

create_issue

Creates a new GitHub issue with a title and description.

comment_on_pr

Adds a comment to an existing Pull Request.

What You Can Do

With Claude Desktop connected to this MCP server, you can:

  • πŸ” Analyze GitHub repositories

  • πŸ› Fetch and understand open issues

  • πŸ”€ Review Pull Request changes

  • πŸ“ Create GitHub issues

  • πŸ’¬ Comment on Pull Requests

  • πŸ€– Perform AI-assisted code reviews

  • πŸ“Š Ask Claude to summarize repository activity


Related MCP server: GitHub MCP Server

πŸ› οΈ Tech Stack

  • Python 3.10+

  • FastMCP

  • Model Context Protocol (MCP)

  • GitHub API

  • Claude Desktop

  • stdio transport


πŸ“‹ Prerequisites

Before installing the project, make sure you have:

  • Python 3.10 or higher

  • Claude Desktop

  • A GitHub account

  • A GitHub Fine-grained Personal Access Token

You can verify your Python installation with:

python --version

πŸš€ Installation

1. Install the MCP Server

Install the package directly from GitHub using pip:

pip install git+https://github.com/DivyanshAgarwal7/github-mcp-server.git

After installation, the github-assistant command will be available globally.

You can verify the installation with:

github-assistant

πŸ” Configuration

To connect the MCP server to Claude Desktop, you need to provide a GitHub Personal Access Token.

2. Generate a GitHub Personal Access Token

Go to:

GitHub β†’ Settings β†’ Developer settings β†’ Personal access tokens β†’ Fine-grained tokens

Create a new token and configure:

Repository Access

Select:

Only select repositories

Then choose the repositories that Claude should be allowed to access.

Repository Permissions

Grant the required permissions for:

  • Issues β€” Read and Write

  • Pull requests β€” Read and Write

Generate the token and copy it immediately.

⚠️ Security: Never commit your GitHub token to a Git repository or share it publicly.


πŸ–₯️ Claude Desktop Configuration

3. Locate the Claude Desktop Configuration File

Windows

The standard configuration file is:

%APPDATA%\Claude\claude_desktop_config.json

For the Microsoft Store version of Claude Desktop, it may be located at:

%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

4. Add the MCP Server

Open claude_desktop_config.json and add:

{
  "mcpServers": {
    "github-assistant": {
      "command": "github-assistant",
      "args": [],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN_HERE"
      }
    }
  }
}

Replace:

YOUR_GITHUB_TOKEN_HERE

with your actual GitHub Personal Access Token.

Existing MCP Servers

If you already have other MCP servers configured, do not replace the entire file.

Simply add the github-assistant entry inside the existing mcpServers object.

For example:

{
  "mcpServers": {
    "another-server": {
      "command": "another-server"
    },
    "github-assistant": {
      "command": "github-assistant",
      "args": [],
      "env": {
        "GITHUB_TOKEN": "YOUR_GITHUB_TOKEN_HERE"
      }
    }
  }
}

πŸ”„ Restart Claude Desktop

After modifying the configuration:

  1. Completely quit Claude Desktop.

  2. Make sure Claude is also closed from the system tray.

  3. Start Claude Desktop again.

  4. Open a new conversation.

  5. Check whether the MCP server/tools are available.

If the server is configured correctly, Claude should be able to access the GitHub MCP tools.


πŸ’‘ Usage Examples

Once the MCP server is connected, you can interact with GitHub using natural language.

Get Latest Issues

Use github-assistant to fetch the latest issues in microsoft/vscode and summarize them.

Review a Pull Request

Pull the diff for PR #123 in my DivyanshAgarwal7/Demo repository.

What is the core logic change?

Create an Issue

Create a new issue in DivyanshAgarwal7/Demo titled
"Update Database Schema"

Write a brief description of the required changes.

Comment on a Pull Request

Comment on PR #45 in my repository saying:

"Looks good, but please add unit tests for the new API endpoint."

AI-Assisted Code Review

You can also ask Claude to analyze a Pull Request and provide feedback:

Review PR #25 in my repository.

Check for:
- Bugs
- Security issues
- Code quality problems
- Missing tests
- Potential performance issues

πŸ”’ Security & Privacy

GitHub MCP Assistant is designed to run as a local stdio MCP server.

Local Execution

The MCP server runs directly on your computer rather than being hosted on a third-party server.

Direct GitHub API Communication

Your machine communicates directly with the GitHub API.

No Cloud Hosting

The MCP server does not require a separate cloud backend to operate.

Token Handling

Your GitHub Personal Access Token is supplied through the Claude Desktop configuration as an environment variable.

Important: Your claude_desktop_config.json contains sensitive credentials. Do not upload it to GitHub or share it publicly.


πŸ—οΈ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude Desktop  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β”‚ MCP / stdio
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ GitHub MCP        β”‚
β”‚ Assistant         β”‚
β”‚                   β”‚
β”‚ FastMCP Server    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β”‚ GitHub API
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      GitHub       β”‚
β”‚                   β”‚
β”‚ Repositories      β”‚
β”‚ Issues            β”‚
β”‚ Pull Requests     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Claude sends MCP tool requests to the local server.

The server then communicates with GitHub using the configured GitHub token and returns the results to Claude.


πŸ“ Project Structure

github-mcp-server/
β”‚
β”œβ”€β”€ src/
β”‚   └── ...
β”‚
β”œβ”€β”€ README.md
└── pyproject.toml

πŸ§ͺ Troubleshooting

MCP Server Is Not Appearing in Claude

Check the following:

  1. Verify that github-assistant is installed.

  2. Run:

github-assistant
  1. Verify that your GitHub token is correct.

  2. Check the Claude Desktop configuration file for JSON syntax errors.

  3. Completely restart Claude Desktop.

  4. Make sure the command value matches the installed executable.


GitHub API Authentication Fails

Verify that:

  • Your token has not expired.

  • The token has access to the requested repository.

  • Issues and Pull Requests have the required permissions.

  • The token is correctly placed in the configuration.

Example:

"env": {
  "GITHUB_TOKEN": "github_pat_xxxxxxxxxxxxx"
}

Claude Cannot Access a Repository

For fine-grained GitHub tokens, make sure the repository is included under:

Repository access
β†’ Only select repositories

Then verify that the required repository permissions have been granted.


🀝 Contributing

Contributions are welcome!

To contribute:

  1. Fork the repository.

  2. Clone your fork.

git clone https://github.com/DivyanshAgarwal7/github-mcp-server.git
  1. Create a new branch.

git checkout -b feature/your-feature
  1. Make your changes.

  2. Test the changes locally.

  3. Commit your changes.

git add .
git commit -m "Add your feature"
  1. Push your branch.

git push origin feature/your-feature
  1. Open a Pull Request.


πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Divyansh Agarwal

GitHub:
https://github.com/DivyanshAgarwal7


⭐ Support

If you find this project useful, consider giving the repository a ⭐ on GitHub.

If you encounter a bug or have a feature request, open an Issue in the repository.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Connects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.
    442 npm
    -
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Connects Claude Desktop directly to GitHub repositories and git commands, enabling users to clone repos, check status, commit changes, push code, create repositories, and manage GitHub resources through natural conversation.
    442 npm
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to query GitHub repositories in plain English, fetching recent activity, release notes, issue triage, and health summaries via the GitHub API.
    -