Content
# 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.

## 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:
```env
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
```bash
uv sync
source .venv/bin/activate
```
This will create a virtual environment and install all the required packages.
```bash
python src/mcp_services/auth_mcp/server.py
```
## Testing the server
```bash
python src/test.py
```
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.