Mitchel-BT/MCPnD
3.1
If you are the rightful owner of MCPnD and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A FastAPI-based MCP server with PostgreSQL and Google OAuth authentication.
MCP Server with Authentication
A FastAPI-based MCP server with PostgreSQL and Google OAuth authentication.
Setup
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Copy
.env.exampleto.envand fill in your credentials:
cp .env.example .env
- Generate a secret key:
openssl rand -hex 32
-
Set up Google OAuth credentials at https://console.cloud.google.com/
-
Configure your PostgreSQL database in pgAdmin
-
Run the server:
python main.py
Testing
Visit http://localhost:8000/docs for the interactive API documentation.
Authentication Flow
- GET
/auth/login- Get Google OAuth URL - User authenticates with Google
- GET
/auth/callback- Handles OAuth callback and creates JWT - Use JWT token in Authorization header for protected endpoints