mcp_oauth_server_web

mcp_oauth_server_web

3.3

This project implements a Streamable HTTP MCP Server with browser-based OAuth for GitHub.

The Streamable HTTP MCP Server is designed to facilitate client authorization through GitHub's OAuth, enabling secure and efficient handling of client requests. The server verifies access tokens and manages transport connections based on session IDs. It supports authorization through specific endpoints, utilizing a custom OAuthServerProvider to interact with GitHub's OAuth system. The server generates PKCE verifiers and challenges, redirects clients to GitHub for authorization, and manages access tokens to ensure secure communication.

Features

  • Streamable HTTP Server for efficient client request handling.
  • Browser-based client authorization using GitHub's OAuth.
  • Custom OAuthServerProvider for managing GitHub OAuth interactions.
  • Session-based transport connection management.
  • Secure access token verification and management.

Usage with Different Platforms

Node.js

bash
# Clone the repository
git clone <repository-url>

# Navigate to the project directory
cd <project-directory>

# Install dependencies
npm install

# Set environment variables for GitHub OAuth
export GITHUB_CLIENT_ID=<your-client-id>
export GITHUB_CLIENT_SECRET=<your-client-secret>

# Start the MCP Server
npx tsx server/index_streamable.ts