Loading video player...
Learn how to build a custom MCP (Model Context Protocol) server from scratch and connect it to Claude Code. By the end of this tutorial, you'll know how to give Claude Code access to any REST API you want. We build a Hacker News MCP server as our example — 3 tools that let Claude fetch trending stories, search articles, and read comments in real time. The pattern works for any API: your company's internal tools, weather services, databases, anything with a REST endpoint. == Timestamps == 00:00 - What is MCP? 00:48 - How MCP Works 01:47 - Project Setup 03:36 - Building the Server 04:15 - Tool 1: Get Trending Stories 06:37 - Tool 2: Search Stories 08:10 - Tool 3: Get Story Details 09:52 - Connecting the Transport 10:39 - Adding MCP Server to Claude Code 13:04 - Demo: What's Trending on Hacker News? 14:58 - Demo: Search Stories 16:24 - Demo: Get Story Details 18:50 - Fixing the Story ID Issue (Live Debugging) 20:04 - Demo: Story Details with ID 21:22 - Demo: Chained Tool Usage 23:13 - Wrapping Up & What's Next == Source Code == https://github.com/ayyazzafar/hackernews-mcp-server == Links == MCP Documentation: https://modelcontextprotocol.io MCP TypeScript SDK: https://github.com/modelcontextprotocol/typescript-sdk Hacker News API: https://github.com/HackerNews/API Algolia HN Search API: https://hn.algolia.com/api == Related Videos == Claude Code Tutorial for Beginners (2026): https://youtu.be/9TP1EWtedpY YouTube Shorts Generator with AI (Remotion + Claude Code): https://www.youtube.com/watch?v=kfShcUHA4vY == Tech Stack == - Claude Code (Anthropic) - MCP TypeScript SDK (@modelcontextprotocol/sdk) - TypeScript + tsx - Zod (input validation) - Hacker News API (free, no auth required) #claudecode #mcp #modelcontextprotocol #typescript #ai #programming #tutorial