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.1.tar.gz (10.9 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.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 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.1.tar.gz
Algorithm Hash digest
SHA256 3b79972b3287c263b6284db146fe64711c5ff2b8a0a9d670da37f976c6926209
MD5 3ee51315eb3593cf9138ab8fec03ac05
BLAKE2b-256 f9e21db73b4eb0ca0792d491404668ce417d00f9a4e67485048e115ef258baec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9384486604d8be18fc672c1016c9ce20f7a3f4dcaa72072e51e32058ecc8575d
MD5 4d2bb3124a4bc0a0ff4aba82f36cb263
BLAKE2b-256 6ce9c13a02c36862829c4a13c9a944467f132959c396ccc5e0f092f907869ed2

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