Loading video player...
In this video, I walk you through building a production-ready MCP (Model Context Protocol) server from scratch using Next.js 16, Prisma, and Vercel ā so AI agents like Claude, Cursor, and Windsurf can interact directly with your app. By the end of this tutorial, your AI agent will be able to: ā List all contacts from a PostgreSQL database ā Create new contacts with validation šļø Delete contacts by email š All protected with API Key authentication š§° Tech Stack: - Next.js 16 (App Router) - Prisma ORM + PostgreSQL (Neon or Supabase) - mcp-handler + @modelcontextprotocol/sdk - Zod for input validation - Vercel (with Fluid Compute) š What You'll Learn: - What MCP (Model Context Protocol) is and why it matters for AI agents - How to scaffold a Next.js 16 API-only project - Setting up Prisma with PostgreSQL - Building MCP tools: list_contacts, create_contact, delete_contact - Securing your server with Bearer token authentication - Seeding your database for local testing - Testing locally with curl and Claude Desktop - Deploying to Vercel and connecting AI clients (Claude Desktop & Cursor) š Full Blog Post / Written Guide: https://jb.desishub.com/blog/building-mcp-server-contacts š Chapters: 0:00 - Intro & What is MCP? 2:00 - Project Setup (Next.js 16) 5:00 - Installing Dependencies 7:30 - Prisma Setup & Database Schema 12:00 - Creating the Prisma Singleton 14:00 - API Key Authentication 16:00 - Building the MCP Server Route 25:00 - Seeding the Database 28:00 - Testing Locally with Claude Desktop 33:00 - Deploying to Vercel 38:00 - Connecting Claude Desktop & Cursor to Production 42:00 - What's Next? š¬ Drop a comment if you have questions or want me to cover OAuth or multi-tenant MCP servers next! š Like, Subscribe & hit the bell to stay updated on more full-stack and AI tutorials. --- š Links & Resources: - Neon (Free PostgreSQL): https://neon.tech - Supabase: https://supabase.com - Vercel: https://vercel.com - MCP Handler Docs: https://github.com/modelcontextprotocol/sdk --- #MCP #NextJS #Prisma #Vercel #AIAgents #Claude #ModelContextProtocol #FullStack #WebDevelopment #TypeScript