
ksankaran/mcp-b2c-oauth
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP Server secured by B2C Google OAuth
Обзор
A project for implementing Google OAuth2 client app B2C authentication for the MCP platform. This project provides integration with Google OAuth2 for authentication and authorization within the MCP (Model Context Protocol) platform. It enables secure user authentication through Google's identity platform. - Google OAuth2 integration - OAuth 2.0 authentication flow - Token management - User profile retrieval - Role-based access control Modify .env file in the root directory with the following variables: 1. User is redirected to Google OAuth2 login page 2. After successful authentication, Google redirects to the callback URL 3. Application validates the received token 4. User session is established - GET /callback - Handles the OAuth callback - GET /.
README
MCP B2C OAuth
A project for implementing Google OAuth2 client app B2C authentication for the MCP platform.
Overview
This project provides integration with Google OAuth2 for authentication and authorization within the MCP (Model Context Protocol) platform. It enables secure user authentication through Google’s identity platform.
Features
- Google OAuth2 integration
- OAuth 2.0 authentication flow
- Token management
- User profile retrieval
- Role-based access control
Installation
uv sync
Configuration
Modify .env file in the root directory with the following variables:
MCP_CLIENT_ID=
MCP_CLIENT_SECRET=
Usage
Start the development server:
uv run .
Authentication Flow
- User is redirected to Google OAuth2 login page
- After successful authentication, Google redirects to the callback URL
- Application validates the received token
- User session is established
API Reference
Authentication Endpoints
GET /callback- Handles the OAuth callbackGET /.well-known/oauth-authorization-server- Auth Server Details-
GET /authorize- Used by MCP Clients to authorize with the server
-
GET /token- Used by MCP Clients to get token from code
-
GET /register- Used by MCP Clients to register themselves to server
Development
Prerequisites
- Python 3.13+
- Google Cloud Platform account with OAuth 2.0 client credentials
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
Name - [email protected]
Project Link: https://github.com/ksankaran/mcp-b2c-oauth
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →