GitHub SSH MCP Server - 智能访问检测版

by pyz11

342 downloads
Not rated
GitHub

About

This is an enhanced GitHub MCP (Model Context Protocol) server designed for Cursor IDE and other MCP-compatible tools. It adds a smart SSH access detection feature that automatically detects and selects the best method (SSH or HTTPS) for connecting to GitHub.

Details

Author
pyz11
Downloads
342
Categories
Developer Tools

- Automatic SSH key detection (RSA, Ed25519, ECDSA, DSA)
- SSH configuration verification and real‑time connection testing
- Smart access switching: SSH preferred, fallback to HTTPS
- 5‑minute result caching to avoid repeated checks
- Dedicated MCP tools for access info, testing, and URL conversion
- Full GitHub operations: repos, issues, PRs, code scanning, notifications, files

Install Go 1.21+, Git, and a GitHub Personal Access Token. Compile the server from source using go build then configure it in Cursor IDE’s MCP settings by specifying the executable path, the stdio argument, and the GITHUB_PERSONAL_ACCESS_TOKEN environment variable. Use the built‑in tools such as get_github_access_info, test_github_access, and convert_github_url to manage access or convert URLs.

GitHub SSH MCP Server - 智能访问检测版

🚀 项目简介

这是一个增强版的GitHub MCP (Model Context Protocol) Server,专门为Cursor IDE和其他支持MCP的工具设计。本项目在原有GitHub MCP Server基础上,添加了智能SSH访问检测功能,能够自动检测并选择最佳的GitHub访问方式。

✨ 核心功能特性

🔐 智能SSH访问检测

- 自动SSH密钥检测: 扫描常见SSH密钥文件(id_rsa, id_ed25519, id_ecdsa, id_dsa) - SSH配置验证: 检查SSH客户端和Git配置 - 实时连接测试: 测试GitHub SSH连接(端口22)的可用性 - 智能访问切换: 优先使用SSH,不可用时自动切换到HTTPS - 结果缓存机制: 5分钟缓存避免频繁检测,提高性能

🛠️ 新增MCP工具

1. get_github_access_info: 获取当前GitHub访问方式信息 2. test_github_access: 测试GitHub访问方式并强制刷新缓存 3. convert_github_url: 在SSH和HTTPS URL格式之间转换

🔧 完整的GitHub操作支持

- 仓库管理(创建、搜索、分支操作) - Issue和Pull Request管理 - 代码扫描和安全警报 - 通知管理 - 用户和组织信息获取 - 文件操作(读取、创建、更新、删除)

🏗️ 技术架构

访问检测流程

`` SSH密钥检测 → SSH配置验证 → 连接测试 → 结果缓存 → 智能选择访问方式 `

核心组件

- GitHubAccessDetector: 核心检测器,负责SSH可用性检测 - SSHClient: SSH客户端,处理Git SSH操作 - AccessTools: MCP工具集,提供访问检测相关功能

📦 安装和配置

前置要求

- Go 1.21+ - Git客户端 - GitHub Personal Access Token - SSH密钥(可选,用于SSH访问)

编译安装

``bash
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.