Tutorial: Auth for Remote MCP Servers (Step by Step) | OAuth 2.1 with ScaleKit
About
No channel description available.
Latest Posts
Video Description
In this tutorial, I’ll show you how to secure your MCP (Model Context Protocol) servers with OAuth 2.1 authentication, using FastAPI and ScaleKit. You’ll learn step by step how to implement authentication, configure scopes and permissions, and validate tokens—so your MCP server is protected and ready to integrate with AI tools and agents. --- 🔗 *Links* - 🐱 Code from the video: https://github.com/alejandro-ao/mcp-fastapi-auth - 🔒 Scalekit: https://www.scalekit.com/ - 🚀 MCP Course Waitlist: https://link.alejandro-ao.com/join-mcp - 🚀 Full Stack AI Engineering Bootcamp: https://aibootcamp.dev - ❤️ Buy me a coffee... or a beer (thanks): https://link.alejandro-ao.com/l83gNq - 💬 Join the Discord Help Server: https://link.alejandro-ao.com/HrFKZn --- 🤓 *Description* We’ll cover the OAuth 2.1 workflow inside the MCP ecosystem, set up the required endpoints and middleware, and use ScaleKit as the authentication layer. By the end, your MCP server will: - Require authentication for tool calls - Support scope-based permissions - Work with MCP-compatible clients and applications Whether you’re building AI agents, integrating external APIs, or securing your MCP tools, this guide gives you everything you need to add modern, standards-compliant authentication. --- 🔑 *What You’ll Learn* - What OAuth 2.1 is and why it matters for MCP servers - The MCP authentication workflow (with diagrams & examples) - How to set up an MCP server with FastAPI + FastMCP - Creating and configuring a ScaleKit account - Defining scopes & permissions in ScaleKit - Implementing OAuth discovery (.well-known endpoints) - Writing authentication middleware in FastAPI - Validating JWT access tokens using the ScaleKit Python SDK - Handling unauthorized requests gracefully - Testing the auth flow with MCP clients (including Google login) - Best practices for secure AI server development --- ⏰ *Timestamps* 0:00:00 - Intro 0:02:10 - MCP Server without Auth 0:05:22 - What is OAuth 2.1 0:15:47 - Create ScaleKit Account 0:19:51 - Endpoint Discovery 0:21:21 - Auth Middleware with 401 Unauthorized 0:27:39 - Validate JWT on MCP Server 0:35:37 - Try It Out
Secure Server Setup Essentials
AI-recommended products based on this video

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

TP-Link 5 Port Gigabit Ethernet Network Switch (TL-SG1005D) - Plug and Play, Desktop or Wall Mount, Plastic Case, Ethernet Splitter, Fanless, Traffic Optimization, Unmanaged (TL-SG1005D)

BOSGAME Linux Mini PC, Intel 12th N100 16GB DDR4 RAM 512GB SSD Linux Server Computers Preinstalled Ubuntu 22.04,Support 4K Triple Display/USB3.2/WiFi 5/2.5GbE

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R660XS R760XS

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge XE9680

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R6625 R760 R7615 R7625

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge HS5610 HS5620
![Zennova [2 Pack] 12V Dual USB Quick Charger 3.0 Port Waterproof Power Outlet With Power Switch for Car, Golf Cart, Boat, Marine, Bus, Truck, RV, Motorcycle](https://m.media-amazon.com/images/I/71Tw7vsDFgL._AC_UL960_FMwebp_QL65_.jpg)
Zennova [2 Pack] 12V Dual USB Quick Charger 3.0 Port Waterproof Power Outlet With Power Switch for Car, Golf Cart, Boat, Marine, Bus, Truck, RV, Motorcycle

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

INIU USB C Charger Block, 100W 3-Port PD Fast Charging, Advanced GaN Power Adapter, Foldable Charger with USB C Cable for MacBook Air 13 Pro, iPad, iPhone 17 16 Pro Max, Samsung S25 S24, Switch 2 etc ClimatePartner certified

15.6’ Touchscreen Portable Monitor, Full HD 1080P Ultra-Thin Metal Frame 100% sRGB USB C External Monitor for Laptop PC Mobile Mac Xbox PS5/PS4 Switch with Stand and Bag

Tenda AC1200 WiFi Router, Dual Band Wireless Router 4 x 100 Mbps Ethernet Ports, Supports APP, Guest WiFi, Access Point Mode, IPv6, Parental Control(AC6)

TP-Link EAP225-Outdoor | Omada AC1200 Wireless Gigabit Outdoor Access Point | Business WiFi Solution w/ Mesh Support, Seamless Roaming & MU-MIMO | PoE Powered | SDN Integrated | Cloud Access & App White

TP-Link Omada AC1750 Gigabit Wireless Access Point (EAP245 V3) - Business WiFi Solution w/Mesh Support, Seamless Roaming & MU-MIMO, PoE Powered, SDN Integrated, Cloud Access & Omada App, White















![Advanced RAG with LlamaIndex - Metadata Extraction [2025]](https://imgz.pc97.com/?width=500&fit=cover&image=https://i.ytimg.com/vi/yzPQaNhuVGU/hqdefault.jpg)



