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
- 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 - kv.coder@gmail.com
Project Link: https://github.com/ksankaran/mcp-b2c-oauth
Metadata
Release files for iflow-mcp_ksankaran_mcp-b2c-oauth 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.5 kB
Release files / iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1.tar.gz
| Download URL | iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b79972b3287c263b6284db146fe64711c5ff2b8a0a9d670da37f976c6926209
|
|
BLAKE2b-256 checksum How to use checksums |
f9e21db73b4eb0ca0792d491404668ce417d00f9a4e67485048e115ef258baec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1-py3-none-any.whl
| Download URL | iflow_mcp_ksankaran_mcp_b2c_oauth-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9384486604d8be18fc672c1016c9ce20f7a3f4dcaa72072e51e32058ecc8575d
|
|
BLAKE2b-256 checksum How to use checksums |
6ce9c13a02c36862829c4a13c9a944467f132959c396ccc5e0f092f907869ed2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|