Adding Authentication to your MCP Server Tools @DevLeonardo
Adding Authentication to your MCP Server Tools  @DevLeonardo
Uploaded July 2025 | Updated September 2026, 3 weeks ago
Not all MCP servers shall be public so here's a guide on how to protect a tool on your custom MCP Server via oauth. With the user data you can either answer with personalized data... or not answer at all for unauthorized users!

The stack in this video is TanStack Start, better-auth and drizzle and I'm using GitHub Copilot to use the MCP server.

Code here: github.com/Balastrong/confhub/tree/c3882203651ec3276d1eb1237cb1c868372b9d9a
Notice this is the commit where I shot the video as main might be different now :)

_______________________________
Subscribe to my newsletter: https://leonardomontini.dev/newsletter
Support my work: github.com/sponsors/Balastrong ❤️

Hit like and subscribe for more content! :D

You can also follow me on the other platforms:
Discord Community: discord.gg/bqwyEa6We6
Twitter: twitter.com/Balastrong
dev.to: dev.to/balastrong
GitHub: github.com/Balastrong
Home: https://leonardomontini.dev/
TikTok: tiktok.com/@balastrong
Instagram: instagram.com/devbalastrong

_______________________________
TIMESTAMPS
00:00 Demo MCP with Authentication
01:37 Setup auth plugin
03:02 Create OAuth tables
04:17 OAuth Metadata
05:37 Get user session in the MCP tool
07:07 Using the MCP official SDK
08:09 Debugging this setup and development tricks

#MCP #Copilot #AI
Adding Authentication to your MCP Server ToolsYour First Valid Pull Request - Hacktoberfest 2024What makes Smart Working SuccesfulTanStack Router: Go to Previous page after Sign InCreate a Pull Request from Visual Studio Code [1/3]Hacktoberfest 2023 Sign Up is Open! #hacktoberfest #programmingCreate a Custom GitHub ActionWRONG Package Manager, Again?Dark/Light/System Theme on TanStack StartTanStack Router: Authenticated Routes (Guards)How well measure performance of our DevRel activitiesFantastic JSON Schemas and where to find them
Dev Leonardo |

Adding Authentication to your MCP Server Tools

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER