About Fastmcp Google Oauth Template
Fastmcp Google Oauth Template is an MCP server in the Security category.
Install
git clone https://github.com/glazec/fastmcp-google-oauth-templateThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Fastmcp Google Oauth Template
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
FastMCP Google OAuth Template
A minimal FastMCP server template with:
- Google OAuth authentication
- Encrypted persistent storage (survives Railway deploys)
- Ready to deploy on Railway
Quick Start
1. Copy the template
cp .env.example .env
Edit .env with your values.
2. Install dependencies
uv sync
3. Run locally
uv run python main.py
OAuth data is persisted to ./oauth_data/ automatically.
Google OAuth Setup
- Go to Google Cloud Console → APIs & Services → Credentials
- Create an OAuth 2.0 Client ID (Web application)
- Add authorized redirect URIs:
https://your-service.up.railway.app/auth/callbackhttp://localhost:8000/auth/callback(for local dev)
- Copy the Client ID and Client Secret into your
.env
Railway Deployment
First-time setup
-
Create a Railway service pointing to this repo.
-
Add a Volume to the service:
- Mount path:
/data - Size: 1 GB (~$0.25/month)
- Mount path:
-
Set environment variables in Railway:
Variable Value FASTMCP_JWT_SIGNING_KEYLong random string — never change in production GOOGLE_CLIENT_IDFrom Google Cloud Console GOOGLE_CLIENT_SECRETFrom Google Cloud Console BASE_URLhttps://your-service.up.railway.appOAUTH_STORAGE_PATH/data/oauth -
Deploy. OAuth credentials will now persist across deploys.
Why the volume?
FastMCP stores OAuth client registrations and tokens on disk. Without a persistent volume, every Railway deploy creates a fresh filesystem — clients (e.g. Claude) would need to re-authenticate after every deploy.
Adding to Claude
In Claude's MCP settings, add:
https://your-service.up.railway.app/mcp
Adding Tools
Edit main.py and add tools below the marked section:
@mcp.tool
def my_tool(param: str) -> str:
"""Description shown to the AI."""
return f"Result for {param}"
Environment Variables Reference
| Variable | Required | Description |
|---|---|---|
FASTMCP_JWT_SIGNING_KEY |
Yes | Signs JWTs. Must be stable across deploys. |
GOOGLE_CLIENT_ID |
Yes | Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Yes | Google OAuth client secret |
BASE_URL |
Yes | Public URL of the deployed server |
OAUTH_STORAGE_PATH |
No | Storage path (default: ./oauth_data) |
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.