Skip to main content
Glama
JainamDosi

mcp-server

by JainamDosi

mcp-server

FastMCP server with pluggable multi-provider authentication (Google OAuth + custom JWT).

Setup

cd mcp-server
uv venv
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate

uv add fastmcp authlib pyjwt python-dotenv google-auth fastapi uvicorn

Copy .env and fill in your credentials:

GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
JWT_SECRET=...
JWT_ALGORITHM=HS256

Related MCP server: SENTRA MCP

Run

uv run src/server.py

Tools

Tool

Description

echo(text)

Returns the text as-is

add(a, b)

Returns a + b

get_server_time()

Returns current UTC time

Auth

Pass a Authorization: Bearer <token> header. The server tries all registered providers in order:

  1. Google — verifies Google ID tokens via google-auth

  2. JWT — verifies JWTs signed with JWT_SECRET

Extending

Add a new provider:

  1. Implement AuthProvider in src/auth/your_provider.py

  2. Register it in server.py: registry.register("name", YourProvider())

No other changes needed.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A minimal fastmcp demonstration server that provides a simple addition tool through the MCP protocol, supporting deployment via Docker with multiple transport modes.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal FastAPI-based MCP server that provides basic utility tools like ping and time functions. Designed for easy deployment with Docker support, authentication, and extensible architecture for future tool additions.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal FastMCP server implementation that provides basic mathematical and greeting tools. Enables users to perform simple operations like adding numbers and greeting people by name through a lightweight MCP interface.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A simple MCP server implementation in Python using FastMCP and FastAPI, providing streamable HTTP transport with optional OAuth authorization for tools like echo and math.
    8
    MIT