GitHub MCP Server
Connects Claude directly to GitHub repositories for reading code, making changes, committing, and managing branches and pull requests.
README
GitHub MCP Server
Connect Claude directly to your GitHub repositories as an intelligent copilot for code changes, commits, and PRs.
Use Claude to:
- ✅ Read & explore code
- ✅ Update files with auto-commits
- ✅ Create branches & manage PRs
- ✅ Commit multiple files at once
- ✅ Search & analyze code patterns
- ✅ All with proper git messages & co-author attribution
Works anywhere: Claude Desktop → Web Dashboard → Mobile → Local VPS
🎯 What This Does
Before (Manual)
"Claude, how do I fix this error?"
→ Claude explains in chat
→ You manually edit files
→ You manually commit & push
After (GitHub MCP)
"Claude, fix the MACD signal calculation and commit"
→ Claude reads the code
→ Makes the fix
→ Commits with a proper message
→ Shows you the commit link
🚀 Quick Start
1. One-Time Setup (5 min)
# Clone the MCP server
git clone https://github.com/techybiky/github-mcp.git
cd github-mcp
# Install dependencies
npm install
# Build for production
npm run build
2. Get GitHub Token
- Go to https://github.com/settings/tokens/new
- Create "Personal Access Token (Classic)"
- Select scopes:
repo,read:user,workflow - Copy the token (you won't see it again)
3. Configure Claude Desktop
macOS/Linux:
cat > ~/.config/Claude/claude_desktop_config.json << 'EOF'
{
"mcpServers": {
"github": {
"command": "node",
"args": ["/path/to/github-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_paste_your_token",
"GITHUB_OWNER": "techybiky",
"GITHUB_REPO": "niftybot"
}
}
}
}
EOF
Windows:
Create %APPDATA%\Claude\claude_desktop_config.json with the same content above.
4. Restart Claude Desktop
Close and reopen Claude. GitHub tools appear in the sidebar.
💡 Usage Examples
Read Code
YOU: "Show me the current trading signal logic"
CLAUDE: ✓ Fetches src/signals.js
✓ Explains the MACD/RSI calculation
✓ Points out potential improvements
Update & Commit
YOU: "Update MACD threshold to 0.35 and commit"
CLAUDE: ✓ Reads current file (gets SHA)
✓ Updates the threshold
✓ Commits with message: "refactor: adjust MACD threshold to 0.35"
✓ Shows commit link
Create Feature Branch
YOU: "Create a branch for fixing the Groww API symbol mapping"
CLAUDE: ✓ Creates branch: feature/groww-symbol-fix
✓ Switches you there
✓ Ready to make changes
Batch Commit
YOU: "Add error handling to both index.js and api.js"
CLAUDE: ✓ Reads both files
✓ Adds error handling to both
✓ Single commit: "feat: add comprehensive error handling"
Create PR
YOU: "Create a PR for the telegram-alerts branch"
CLAUDE: ✓ Opens PR with auto-generated title & description
✓ Links to Telegram implementation details
✓ Shows PR URL
🛠 Tools Available
| Tool | Purpose |
|---|---|
| read_file | Read file contents (get SHA for editing) |
| write_file | Create/update file (auto-commits) |
| delete_file | Delete file (auto-commits) |
| list_files | Browse repo structure |
| create_branch | Create new branch from main/other |
| list_branches | List all branches |
| get_branch_info | Branch details & protection status |
| commit_multiple | Batch commit multiple files |
| create_pull_request | Open PR (auto-description) |
| list_commits | View commit history |
| get_repo_info | Repo metadata (stars, language, etc) |
| search_files | Find files by pattern/name |
📋 Multi-Repo Setup
Manage multiple repos in one Claude instance:
{
"mcpServers": {
"github-niftybot": {
"command": "node",
"args": ["/path/to/github-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_xxx",
"GITHUB_REPO": "niftybot"
}
},
"github-coexist": {
"command": "node",
"args": ["/path/to/github-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_xxx",
"GITHUB_REPO": "coexist"
}
}
}
}
Then in Claude: "Switch to github-coexist and show me the migrations"
🐳 Deployment
Docker
docker build -t github-mcp .
docker run -e GITHUB_TOKEN=ghp_xxx \
-e GITHUB_REPO=niftybot \
-e GITHUB_OWNER=techybiky \
github-mcp
Vercel
vercel --env GITHUB_TOKEN=ghp_xxx --env GITHUB_REPO=niftybot
Railway
railway link
railway up
Local VPS
git clone https://github.com/techybiky/github-mcp.git
cd github-mcp
npm install && npm run build
GITHUB_TOKEN=ghp_xxx GITHUB_REPO=niftybot npm start
🌐 HTTP Server (Optional)
If you want to access this from web/mobile (not just Claude):
npm run http
# Runs on http://localhost:3000
# API Key printed to console
Example API call:
curl -X POST http://localhost:3000/api/call \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"tool": "read_file",
"params": {"path": "package.json"}
}'
🔐 Security
Token Management
- Create token: https://github.com/settings/tokens/new
- Scopes needed:
repo,read:user,workflow - Storage: Keep in
~/.config/Claude/(not committed to git) - Rotation: Regenerate monthly in Settings
Best Practices
- ✅ Use environment variables (never hardcode)
- ✅ Store config in
~/.config/(local machine only) - ✅ Use fine-grained tokens for enterprise
- ✅ Rotate tokens regularly
- ✅ Never commit
claude_desktop_config.jsonwith real tokens
🚨 Troubleshooting
GitHub tools not showing in Claude
Solution 1: Check config file syntax
# macOS/Linux
cat ~/.config/Claude/claude_desktop_config.json | jq .
# Windows - open in text editor and validate JSON
Solution 2: Verify node path
which node # macOS/Linux
where node # Windows
# Use full path in config: /usr/bin/node or /opt/homebrew/bin/node
Solution 3: Restart Claude Desktop
- Close completely
- Reopen
- Check sidebar for tools
"401 Unauthorized"
- Token is invalid/expired → Generate new at https://github.com/settings/tokens
- Token missing scopes → Regenerate with
repo+read:user+workflow
"404 Not Found"
- Wrong repo name → Check
GITHUB_REPOin config - Wrong owner → Check
GITHUB_OWNERin config (default:techybiky) - Token can't access repo → Must have
reposcope
"409 Conflict"
- File SHA is stale → Claude auto-retries by re-reading file
- Branch was updated → Try again
📦 Project Structure
github-mcp/
├── src/
│ ├── index.js # MCP server entry (stdio transport)
│ ├── mcp-server.js # Tool definitions & handlers
│ ├── github.js # GitHub REST API wrapper
│ └── http-server.js # Optional HTTP server
├── dist/ # Built files (generated)
├── package.json
├── Dockerfile # For containerized deployment
├── .env.example # Environment variables template
├── claude_desktop_config.template.json
├── SETUP.md # Detailed setup instructions
└── README.md # This file
🎓 How It Works
- You talk to Claude in Claude Desktop
- Claude calls tools from this MCP server (via stdio)
- MCP server calls GitHub API to read/write code
- Results come back as text to Claude
- Claude shows you what was changed + commit links
Claude Desktop
↓ (stdio)
GitHub MCP Server (this repo)
↓ (HTTP)
GitHub REST API
📚 Learning Resources
- Model Context Protocol: https://modelcontextprotocol.io
- GitHub REST API: https://docs.github.com/en/rest
- Claude Documentation: https://docs.claude.com
💬 Support & Feedback
- Issues: https://github.com/techybiky/github-mcp/issues
- Discussions: https://github.com/techybiky/github-mcp/discussions
- Claude Help: https://support.claude.com
📄 License
MIT
🙏 Thanks
Built for KK Das (@techybiky) — SDET, Test Automation Architect, Open Source Builder
Your repos made easier: niftybot • coexist • youtube-bot • job-tracker
Ready to get started? → SETUP.md 🚀
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。