Skip to main content

Add your description here

Project description

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=<YOUR_GOOGLE_CLIENT_ID>
MCP_CLIENT_SECRET=<YOUR_GOOGLE_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 - kv.coder@gmail.com

Project Link: https://github.com/ksankaran/mcp-b2c-oauth

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0.tar.gz
Algorithm Hash digest
SHA256 46dc88d096c17ab697908c541e5233212d1153e6129ec9a922bae4fbebd0dd48
MD5 b1eababc719742b9ca7f91757daa63a0
BLAKE2b-256 8a02897bd36fb6cd663ebb029438026ca5cedf0f56a4924dd9cf6cd8badcf90e

See more details on using hashes here.

File details

Details for the file iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb3ba9ec834053687537404d7c1b18ad44fd8dc871c41432a7850c421d22dd50
MD5 893e23fd04b11a728f0b818743a84275
BLAKE2b-256 c73ef44f8d9d8bebcefe0bc855b1823bf03fc374c54d983533239bca87a6bd7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page