GitHub-MCP

NgoSon3868-Quas/GitHub-MCP

3.2

If you are the rightful owner of GitHub-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This repository provides a configuration for setting up an MCP Server for GitHub, enabling interaction with GitHub's API through a model context protocol.

Cấu hình MCP Server GitHub

Repository này chứa cấu hình MCP Server GitHub để sử dụng trên nhiều máy tính.

⚠️ Lưu ý Bảo mật Quan trọng

KHÔNG commit token thật lên public repository!

File mcp.json trong repository này sử dụng placeholder YOUR_GITHUB_TOKEN_HERE. Bạn PHẢI thay thế bằng token thật của bạn trước khi sử dụng.

Cấu hình

File mcp.json chứa cấu hình để thêm vào .cursor/mcp.json hoặc ~/.cursor/mcp.json:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN_HERE"
      }
    }
  }
}

Tạo GitHub Personal Access Token

  1. Truy cập: https://github.com/settings/tokens
  2. Click "Generate new token" > "Generate new token (classic)"
  3. Đặt tên token (ví dụ: "Cursor MCP GitHub Server")
  4. Chọn quyền:
    • repo (Full control of private repositories) - Bắt buộc
    • read:org (Read org and team membership) - Tùy chọn
    • user (Update user data) - Tùy chọn
  5. Click "Generate token"
  6. Copy token ngay (chỉ hiển thị một lần!)

Sử dụng

  1. Clone repository này:

    git clone https://github.com/NgoSon3868-Quas/GitHub-MCP.git
    cd GitHub-MCP
    
  2. QUAN TRỌNG: Chỉnh sửa file mcp.json và thay thế YOUR_GITHUB_TOKEN_HERE bằng token thật của bạn

  3. Copy nội dung từ mcp.json (đã thay token) vào file cấu hình MCP của bạn:

    • Windows: C:\Users\<username>\.cursor\mcp.json
    • Mac/Linux: ~/.cursor/mcp.json

    Hoặc merge vào file mcpServers hiện có của bạn.

  4. Khởi động lại Cursor IDE

Yêu cầu

  • Node.js và npm đã được cài đặt
  • Package @modelcontextprotocol/server-github sẽ được tự động tải khi sử dụng
  • GitHub Personal Access Token hợp lệ với quyền repo

Tính năng

MCP Server GitHub cung cấp các công cụ để:

  • Tạo và quản lý repositories
  • Đọc và ghi files trên GitHub
  • Quản lý issues và pull requests
  • Tìm kiếm code và repositories
  • Và nhiều tính năng GitHub API khác

Bảo mật

⚠️ QUAN TRỌNG:

  • Không bao giờ commit token thật lên Git
  • Không chia sẻ token công khai
  • Nếu token bị lộ, hãy revoke ngay trên GitHub Settings
  • Sử dụng placeholder token trong file cấu hình public

Kiểm tra cấu hình

Sau khi thêm cấu hình và khởi động lại Cursor:

  1. Vào Settings > Tools & MCP
  2. Kiểm tra trong danh sách "Installed MCP Servers" có github với trạng thái "Ready"