MCPInstall
fast_mcp_middleware logo

fast_mcp_middleware

by lloydhamilton 2 stars lloydhamilton/fast_mcp_middleware

FastMCP middleware for JWT-based user authentication using AWS Cognito.

READMEmain

FastMCP Authentication Middleware

This is a simple authentication middleware for FastMCP that uses JWT tokens for user authentication.

AWS Cognito is used as the identity provider, from which users authenticate and receive a JWT token. The requested token is then passed in the Authorization header of the request to the FastMCP server. The server then verifies the token using the public key from AWS Cognito.

oauth_flow.drawio.png

Pre-requisites

You will need to create a Cognito user pool and a user pool client in AWS then set the following environment variables:

Create a .env file in the root directory with the following variables:

USER_POOL_CLIENT_ID=<YOUR_USER_POOL_CLIENT_ID>
USER_POOL_CLIENT_SECRET=<YOUR_USER_POOL_CLIENT_SECRET>
COGNITO_USER_POOL_ID=<YOUR_USER_POOL_ID>

Starting the server

uv sync
source .venv/bin/activate

This will create a virtual environment and install all the required packages.

python src/mcp_services/auth_mcp/server.py

Testing the server

python src/test.py

More Security & Testing MCP servers

Similar servers from the same category.

Enables deepfake detection in images through Proofly API integration, providing detailed analysis results including real/fake probability scores and individual model results for each detected face.

Security & Testing

CASB provides comprehensive visibility and control over your SaaS applications, so you can easily eliminate the risk of compromise, prevent data loss, and avoid compliance violations.

Security & Testing

Audit logs summarize the history of changes made within your Cloudflare account. Audit logs include account level actions like zone configuration changes.

Security & Testing

YaraFlux

threatflux

Provides YARA-based malware scanning capabilities with support for local and MinIO storage backends, enabling security professionals to manage rules, scan files/URLs, and analyze results for threat detection.

filesystemstorage