Skip to main content
Glama
nitesh-kumar-pandey

GitHub MCP Server

README.md
# GitHub MCP Server v3

A production-ready **Remote MCP (Model Context Protocol) Server** for GitHub with full OAuth authentication.

This server allows Claude Desktop and Claude Web to securely access GitHub repositories using each user's own GitHub account.

---

# Features

- ✅ Remote MCP (HTTP Streamable Transport)
- ✅ GitHub OAuth Authentication
- ✅ OAuth 2.1 Authorization Code Flow
- ✅ PKCE (S256)
- ✅ Dynamic Client Registration
- ✅ OAuth Discovery Endpoints
- ✅ Bearer Token Authentication
- ✅ Encrypted GitHub Token Storage
- ✅ Personal API Keys
- ✅ JWT Browser Sessions
- ✅ SQLite (Development)
- ✅ PostgreSQL (Production)
- ✅ Claude Desktop Compatible
- ✅ Claude Web Compatible

---

# Architecture

```
Claude
    │
    ▼
Remote MCP Server
    │
OAuth 2.1
    │
GitHub OAuth
    │
GitHub API
```

Each user authenticates with **their own GitHub account**.

No GitHub Personal Access Token is required.

---

# Supported Authentication

- GitHub OAuth
- OAuth Access Tokens
- JWT Sessions
- Personal API Keys
- Shared MCP API Key (optional)

---

# Requirements

- Python 3.11+
- PostgreSQL (Production)
- SQLite (Development)

---

# Installation

Clone the repository

```bash
git clone https://github.com/<your-username>/github-mcp-server-v3.git

cd github-mcp-server-v3
```

Create virtual environment

```bash
python -m venv .venv
```

Activate

Windows

```bash
.venv\Scripts\activate
```

Linux/macOS

```bash
source .venv/bin/activate
```

Install dependencies

```bash
pip install -r requirements.txt
```

---

# Environment Variables

Create a `.env`

```env
APP_ENV=development

DATABASE_URL=sqlite:///./github_mcp.db

GITHUB_CLIENT_ID=YOUR_GITHUB_CLIENT_ID

GITHUB_CLIENT_SECRET=YOUR_GITHUB_CLIENT_SECRET

GITHUB_REDIRECT_URI=http://localhost:8000/auth/callback

JWT_SECRET_KEY=CHANGE_ME

ENCRYPTION_KEY=CHANGE_ME

MCP_API_KEY=

APP_PORT=8000
```

Production

```env
DATABASE_URL=postgresql://...
```

---

# Running

```bash
python -m app.main
```

or

```bash
uvicorn app.main:api --reload
```

---

# OAuth Endpoints

Authorization

```
GET /authorize
```

Token

```
POST /token
```

Dynamic Client Registration

```
POST /register
```

Protected Resource Metadata

```
GET /.well-known/oauth-protected-resource
```

Authorization Server Metadata

```
GET /.well-known/oauth-authorization-server
```

---

# MCP Endpoint

```
https://github-mcp-server-2.onrender.com/mcp
```

---

# Using with Claude

## MCP URL

```
https://github-mcp-server-2.onrender.com/mcp
```

---

## OAuth Client ID

If Claude asks for an OAuth Client ID, use:

```
p3FQ-WhAuYOtGbAp-8FPPJ8Q6cCQZiUqLR8xmTK9QTs
```

This is the public client ID for the GitHub MCP Server.

---

## Connection Steps

1. Add a new Remote MCP Server.

2. MCP URL

```
https://github-mcp-server-2.onrender.com/mcp
```

3. If prompted, enter the OAuth Client ID:

```
VKmg59kQfMxcWaeoPeXuSoYWphwU_Uiq83GMBu208QE
```

4. Click Connect.

5. Claude redirects you to GitHub.

6. Sign in using **your own GitHub account**.

7. Approve access.

8. You're ready to use GitHub tools.

---

# Important

The OAuth Client ID is **shared by all users**.

Each user authenticates with **their own GitHub account**.

Your GitHub account is **never shared**.

Your repositories remain private.

The server stores each user's encrypted GitHub access token separately.

Users can only access repositories they already have permission to access.

---

# Example Prompts

List my repositories.

```
List my GitHub repositories.
```

Show repository information.

```
Show details for my repository my-project.
```

List issues.

```
List open issues in my-project.
```

Create issue.

```
Create a GitHub issue titled "Bug Report" in my-project.
```

List pull requests.

```
Show pull requests in my-project.
```

Create branch.

```
Create a branch named feature/login.
```

---

# Security

- OAuth 2.1
- PKCE (S256)
- Encrypted GitHub Tokens
- Single-use Authorization Codes
- Expiring Access Tokens
- JWT Sessions
- Personal API Keys
- HTTPS Only
- Secure Cookies

---

# Development

Run locally

```bash
uvicorn app.main:api --reload
```

SQLite database

```
github_mcp.db
```

Production uses PostgreSQL.

---

# Deployment

Recommended platforms

- Render
- Railway
- Fly.io
- Azure
- AWS

---

# License

MIT

---

# Author

Developed by **Nitesh kumar Pandey**

GitHub:
https://github.com/nitesh-kumar-pandey