Joseph19820124/github-mcp-server-joseph
3.2
If you are the rightful owner of github-mcp-server-joseph and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for GitHub integration with real-time event streaming.
GitHub MCP Server
A Model Context Protocol (MCP) server for GitHub integration with real-time event streaming.
Features
- Real-time GitHub repository events via Server-Sent Events (SSE)
- RESTful API for GitHub data access
- Docker support with production-ready configuration
- Environment variable configuration for security
Quick Start
Using Docker Compose
- Clone the repository:
git clone https://github.com/Joseph19820124/github-mcp-server-joseph.git
cd github-mcp-server-joseph
- Set up environment variables:
cp .env.example .env
- Edit
.env
file and add your GitHub token:
GITHUB_TOKEN=your_github_personal_access_token
PORT=3000
- Start the server:
docker-compose up -d
Alternative: Direct Docker Run
You can also run the container directly with environment variables:
# Build the image
docker build -t github-mcp-server .
# Run with environment variable
docker run -d \
--name github-mcp-server \
-p 3000:3000 \
-e GITHUB_TOKEN=your_github_personal_access_token \
-e PORT=3000 \
github-mcp-server:latest
Local Development
# Install dependencies
npm install
# Set environment variables
export GITHUB_TOKEN=your_github_personal_access_token
export PORT=3000
# Start the server
npm start
GitHub Token Setup
- Go to GitHub Settings → Developer settings → Personal access tokens
- Generate a new token with these permissions:
repo
(for repository access)read:org
(for organization data)user
(for user information)
- Copy the token and use it in your environment configuration
API Endpoints
GET /health
- Health checkGET /sse/github/:owner/:repo
- SSE endpoint for real-time eventsGET /api/repos/:owner/:repo
- Get repository informationGET /api/repos/:owner/:repo/commits
- Get repository commits
Environment Variables
Variable | Description | Required | Default |
---|---|---|---|
GITHUB_TOKEN | GitHub Personal Access Token | Yes | - |
PORT | Server port | No | 3000 |
NODE_ENV | Environment (development/production) | No | development |
Security
- Never commit your GitHub token to version control
- Use environment variables for sensitive configuration
- The Docker image does not contain any hardcoded tokens
- All tokens are injected at runtime through environment variables
Health Check
The server includes a health check endpoint at /health
that returns:
{
"status": "healthy",
"timestamp": "2025-07-06T11:00:00.000Z"
}
Production Deployment
For production deployment, use the provided docker-compose.prod.yml
:
docker-compose -f docker-compose.prod.yml up -d
This includes:
- Nginx reverse proxy
- Health checks
- Log rotation
- Restart policies
Troubleshooting
Common Issues
- "Bad credentials" error: Check your GitHub token permissions
- Port already in use: Change the PORT environment variable
- Docker build fails: Ensure Docker is running and you have internet access
Logs
View container logs:
docker-compose logs -f github-mcp-server
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This project is open source and available under the MIT License.