Loading video player...
Learn how to build and scale stateful Model Context Protocol (MCP) servers using Node.js, Platformatic, and Fastify. In this practical guide, Matteo Collina (Co-Founder & CTO of Platformatic) demonstrates how to solve the complex challenges of scaling AI agents and securing them with Auth0. You'll move beyond simple STDIO servers to build HTTP streaming servers that are scalable and secure, using `@platformatic/mcp` to manage state externally with tools like Redis. Then, see a live demo of how to implement authentication using Auth0 to secure your MCP Server. 💡 What You'll Learn * What MCP (Model Context Protocol) is and how it works. * The architecture of "The Agentic Loop" for AI agents. * The critical problem with scaling stateful MCP servers. * How to use `@platformatic/mcp` and Redis to build scalable, distributed systems. * How to implement secure OAuth 2.0 authentication for your MCP servers using Auth0. ___________________________________________ ➡️ Related Videos & Resources * Build an MCP in Python https://youtu.be/0CWAzbduYZs * Auth0 MCP Server in VS Code https://youtu.be/z2vqwAA0byo ### 🛠️ Links & Tools * Platformatic MCP on GitHub: https://github.com/platformatic/mcp * Platformatic: https://platformatic.dev/ * Auth0: https://auth0.com/ * Fastify: https://fastify.dev/ ___________________________________________ ⏰ Timestamps 00:00 - Introduction to MCP Servers 00:18 - Meet the Speaker: Matteo Collina 00:54 - What is MCP (Model Context Protocol)? 01:49 - Understanding The Agentic Loop 02:30 - MCP & Server-Sent Events (SSE) 03:38 - Two Kinds of MCP Servers: STDIO vs HTTP Streaming 05:00 - The Core Scaling Problem (Stateful SDKs) 05:28 - Introducing @platformatic/mcp 06:04 - How to Implement Authentication? (Using Auth0) 06:37 - OAuth Integration for MCP (Dynamic Client Registration) 07:16 - Demo Part 1: Auth0 Tenant Setup 09:17 - Demo Part 2: Live Code Demo 09:27 - Code Review: oauth2-user-server.ts 10:19 - Live Demo: Running the Claude AI CLI 10:55 - Live Demo: Authenticating the AI Agent with Auth0 11:27 - Live Demo: AI successfully uses the secured tool 12:11 - Wrap-up & Final Thoughts Open DCR enables flexible MCP integrations but exposes your tenant to potential abuse if left unauthenticated. Without security controls, anyone can create applications in your tenant, potentially leading to resource exhaustion, unauthorized access attempts, or tenant misconfiguration. Read the documentation on Securing Open Dynamic Client Registration (DCR) here: https://a0.to/securing-open-dcr If you enjoy this content and want to learn more about identity, security, and access management, subscribe to our channel! Have a topic you'd like to see covered? Let us know if the comments below 👀 ___________________________________________ 🔵Try Auth0 for free - https://a0.to/auth0 🔵The Auth0 blog - https://a0.to/blog 🔵Ask questions on the Community Forum - https://a0.to/community ___________________________________________ Follow Us on Social 🔵 X / Twitter - https://a0.to/twitter 🔵LinkedIn - https://a0.to/linkedin #mcp #aiagents #nodejs #auth0 #platformatic