MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

MCP server enabling AI assistants to interact with GitHub

Created 1/27/2026
Updated about 7 hours ago
Repository documentation and setup instructions

GitHub MCP Server

An open-source Model Context Protocol (MCP) server that enables AI assistants to interact with GitHub through natural language. Automate repository management, issue tracking, pull requests, branch operations, and file management.

🌟 Features

15 Powerful Tools

Repository Management (3 tools):

  • list_repositories - List all repositories
  • get_repository - Get detailed repository info
  • create_repository - Create new repository

Issue Management (4 tools):

  • list_issues - List issues in repository
  • get_issue - Get issue details
  • create_issue - Create new issue
  • close_issue - Close issue with optional comment

Pull Request Management (4 tools):

  • list_pull_requests - List pull requests
  • get_pull_request - Get PR details
  • create_pull_request - Create new PR
  • merge_pull_request - Merge a PR

Branch Management (2 tools):

  • list_branches - List all branches
  • create_branch - Create new branch

File Operations (2 tools):

  • get_file_contents - Read file from repository
  • create_or_update_file - Create or update file

🚀 Quick Start

Installation

git clone https://github.com/afrah123456/github-mcp-server.git
cd github-mcp-server
pip install -r requirements.txt

Configuration

  1. Get a GitHub Personal Access Token:

    • Go to https://github.com/settings/tokens
    • Generate new token (classic)
    • Select scopes: repo, user, delete_repo
  2. Create .env file:

cp .env.example .env
  1. Add your token to .env:
GITHUB_TOKEN=your_github_token_here
GITHUB_USERNAME=your_username

Run the Server

python run_server.py

The server will start and wait for MCP protocol messages from AI assistants.

💡 Usage Examples

With AI Assistants (Claude, ChatGPT, etc.):

User: "List all my GitHub repositories"
AI → GitHub MCP Server → Returns list

User: "Create issue: Fix login bug"
AI → GitHub MCP Server → Creates issue

User: "Show me all open PRs in my repo"  
AI → GitHub MCP Server → Lists PRs

User: "Create branch 'feature-dark-mode' from main"
AI → GitHub MCP Server → Creates branch

🧪 Testing

# Run all tests
pytest tests/ -v

# Test connection
python test_connection.py

# Test all features
python test_mvp.py

Test Results:

  • ✅ 6/6 tests passing
  • ✅ 100% success rate
  • ✅ All 15 tools functional

📁 Project Structure

github-mcp-server/
├── src/github_mcp/
│   ├── server.py          # Main MCP server
│   ├── github_client.py   # GitHub API client
│   └── config.py          # Configuration
├── tests/
│   └── test_github_client.py
├── examples/
│   └── basic_usage.md
├── run_server.py
├── requirements.txt
└── README.md

🛠️ Tech Stack

  • Python 3.11+
  • PyGithub - GitHub API client
  • MCP SDK - Model Context Protocol
  • OAuth - Secure authentication
  • pytest - Testing framework

🤝 Contributing

Contributions welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests
  • Improve documentation

👤 Author

Afrah Fathima S

  • GitHub: @afrah123456
  • LinkedIn: [https://www.linkedin.com/in/afrah-fathima-b98090241/]

🙏 Acknowledgments

Built using the Model Context Protocol specification and PyGithub library.

📊 Stats

  • Tools: 15
  • Test Coverage: 100%
  • Language: Python
  • Status: ✅ Production Ready

Star this repo if you find it useful!

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/afrah123456/Github-mcp-server
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "afrah123456-github-mcp-server": { "command": "git", "args": [ "clone", "https://github.com/afrah123456/Github-mcp-server" ] } } }