Description
Problem
Currently, the GitHub MCP Server only supports single-user mode, requiring a single GitHub token to be configured at startup. This limits its usage in multi-tenant environments, shared services, and enterprise scenarios where different users need to authenticate with their own GitHub tokens.
Current State
- ✅ Single-user mode supports both stdio and streamable HTTP transports
- ❌ No multi-user mode exists - server requires one GitHub token per instance
- ❌ Cannot serve multiple users with different authentication contexts
- ❌ Limited scalability for shared or enterprise deployments
Proposed Solution
Add a new multi-user mode with streamable HTTP transport support, enabling the server to:
- Accept HTTP requests with per-request authentication tokens
- Serve multiple users simultaneously with their own GitHub tokens
- Run behind load balancers and reverse proxies
- Integrate with web applications and cloud services
- Support containerized deployments with proper port binding
Use Cases
- Enterprise Shared Services: One server instance serving multiple teams/users
- Cloud Deployments: Multi-tenant SaaS applications using GitHub integration
- Web Integration: Web applications where users authenticate with their own GitHub tokens
- Load Balancing: Distributing requests across multiple server instances
- Kubernetes Deployments: Enabling proper health checks and service discovery
- API Gateway Integration: Direct HTTP endpoints for API management platforms
Expected Implementation
Command Interface
# New multi-user mode with HTTP transport
./github-mcp-server multi-user --port 8080
# Existing single-user modes still work
./github-mcp-server stdio # Single-user stdio
./github-mcp-server streamable-http # Single-user HTTP
Configuration Options
- Configurable port binding via
--port
flag - Per-request authentication token extraction from request headers/context
- No global GitHub token required - tokens provided per request
- Backward compatibility with existing single-user modes
Technical Details
- Utilize existing
server.NewStreamableHTTPServer()
from mcp-go library - Implement per-request authentication model with auth tokens
- Create new multi-user toolsets that extract tokens from request context
- Proper error handling and logging for HTTP transport
- Support for standard HTTP headers and content types
Benefits
- 🌐 Production Ready: Enables production deployments in cloud environments
- 🔄 Scalable: Works seamlessly with load balancers and auto-scaling
- 🔌 Integration Friendly: Direct HTTP API for web applications and services
- 📦 Container Native: Proper port binding for containerized deployments
- 👥 Multi-Tenant: Support multiple users with their own GitHub authentication
- ⚡ Performance: HTTP transport optimized for distributed scenarios
Acceptance Criteria
- New
multi-user
command that starts HTTP server on configurable port - Per-request authentication tokens work correctly
- Multiple users can use the server simultaneously with their own tokens
- Backward compatibility with existing single-user modes
- Proper error handling and logging for multi-user scenarios
- Documentation for new multi-user mode
- Docker support for multi-user HTTP deployments
Additional Context
This enhancement would introduce a completely new operational mode to the GitHub MCP Server, making it suitable for enterprise and multi-tenant deployments. Unlike the current single-user model where one GitHub token is configured globally, this multi-user mode would extract authentication tokens from each individual request.
The implementation should leverage the existing mcp-go library's streamable HTTP capabilities while introducing a new multi-user authentication approach that differentiates this mode from the existing single-user implementations.