KM

ksankaran/mcp-b2c-oauth

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

11 stars 3 forks 品質 30 トレンド 8

MCPの特長 B2C Google OAuth によって保護されたサーバー

概要

MCPプラットフォーム用のGoogle OAuth2クライアントアプリB2C認証を実装するためのプロジェクト。 このプロジェクトは、MCP(Model Context Protocol)プラットフォーム内で認証および認可を行うGoogle OAuth2と連携します。 Google の ID プラットフォームを通じて安全なユーザ認証を有効にします。 - Google OAuth2の統合 - OAuth 2.0認証フロー - トークン管理 - ユーザープロファイル検索 - ロールベースのアクセス制御 .env ファイルを root ディレクトリに次の変数を変更します。 1。 ユーザーは、Google OAuth2ログインページ2にリダイレクトされます。 認証後、GoogleはコールバックURL3にリダイレクトします。 アプリケーションは、受け取ったトークン4を検証します。 ユーザセッションの確立 - GET /callback - OAuth コールバック - GET / を処理します.

概要(AI 翻訳)

MCPプラットフォーム用のGoogle OAuth2クライアントアプリB2C認証を実装するためのプロジェクト。

概要

このプロジェクトは、MCP(Model Context Protocol)プラットフォーム内で認証および認可を行うGoogle OAuth2と連携します。 Google の ID プラットフォームを通じて安全なユーザ認証を有効にします。

##特徴

  • Google OAuth2の統合
  • OAuth 2.0認証フロー
  • トークン管理
  • ユーザープロファイル検索
  • ロールベースのアクセス制御

インストール

設定

次の変数でrootディレクトリの[.env]ファイルを変更します。

使用法

開発サーバーを始めて下さい:

##認証フロー

1。 ユーザーは、Google OAuth2ログインページにリダイレクトされます 2。 認証を成功させた後、GoogleはコールバックURLにリダイレクトします 3. 適用は受け取られたトークンを検証します 4. ユーザーセッションの確立

API リファレンス

##認証エンドポイント

  • GET /callback - OAuth コールバックの処理
  • [GET /.well-known/oauth-authorization-server - Auth サーバーの詳細
    • [[GET /authorize] - MCP クライアントがサーバーを認証するために使用されます
    • [GET /token - MCPクライアントがコードからトークンを取得するために使用される

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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

  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

API Reference

Authentication Endpoints

  • GET /callback - Handles the OAuth callback
  • GET /.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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →