The Hard Part of MCP Is Auth. Here’s How to Solve It @hamedbahram
The Hard Part of MCP Is Auth. Here’s How to Solve It  @hamedbahram
Uploaded October 2026 | Updated December 2026, 3 hours ago
What if your users could manage your app straight from Claude or ChatGPT? Building the MCP server is the easy part. The real challenge is making sure each user signs in and only touches their own data.

In this video I add an MCP server to a real Next.js app, a multi-tenant task tracker with organizations and paid plans, and secure it with Clerk OAuth. Users connect it to Claude or ChatGPT as a custom connector, sign in with their own account, and can list projects, create tasks, and move them across the board, all scoped to their own data.

You’ll see how to:
• Enable OAuth for MCP clients in the Clerk dashboard
• Choose between Client ID Metadata Documents (CIMD) and legacy dynamic client registration
• Configure client admission, default scopes, and PKCE
• Verify tokens with Clerk so access can be revoked instantly
• Add the well-known endpoints MCP clients use to discover auth
• Wrap your MCP route with Clerk so every tool call knows which user it’s acting for

Your business rules carry over too. A free-plan user who asks Claude to create a second project gets a clear “that’s a Pro feature” response, so paid features stay paid even through MCP. I also cover how my implementation differs from Clerk’s docs: the newer mcp-handler version, Streamable HTTP only, no SSE.

The app is live, so you can create an account, connect it to your own Claude or ChatGPT, and try it yourself. Links below.

⏱️ Chapters
00:00 – The app we’re connecting to Claude & ChatGPT
01:00 – Why auth is the hard part of MCP
01:15 – Enabling OAuth for MCP clients in Clerk
01:45 – CIMD vs. legacy dynamic client registration
02:22 – Client admission, default scopes & PKCE
03:00 – Verifying tokens: JWT vs. Clerk (instant revocation)
03:30 – Packages: mcp-handler, MCP SDK, Clerk MCP tools
04:00 – Well-known endpoints for auth discovery
04:42 – Code walkthrough: MCP route, auth & tools
05:50 – Connecting as a custom connector in Claude
06:50 – Demo: listing projects & moving tasks
07:10 – Paid features enforced through MCP
08:00 – Differences from Clerk’s docs
09:26 – Wrap-up

🔗 Links
Try the live app → https://task-tracker-board.vercel.app
Source code (GitHub) → github.com/HamedBahram/multi-tenant-saas
Clerk MCP docs → clerk.com/docs/nextjs/guides/ai/mcp/build-mcp-server
How I built this task tracker → youtu.be/nl0YSP8Pdm4?si=g4MSjeJOBjOtFu1c
The Hard Part of MCP Is Auth. Here’s How to Solve ItHow to Add Page Transitions in NextJs 14How I would learn AI in 2025Basic role based access control in Clerk [S2 E6]If you like Tailwind & shadcn/ui watch thisTables in NextJs Using shadcn/ui and TanStack TableUsing shadcn/ui with NextJs 15 and React 19Data fetching in NextJs using SWRHow to Setup Shadcn UI + Themes in NextJs 14Schema validation using ValibotBuild a Multistep Form in NextJs Using react-hook-form and ZODI Have A Special Guest | Episode 1
Hamed Bahram |

The Hard Part of MCP Is Auth. Here’s How to Solve It

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER