How to Build a Custom MCP Server with TypeScript - A Handbook for Developers
by freeCodeCamp (Sumit Saha)
Build a real MCP server that hands your AI editor your actual calendar.
Overview
A long-form freeCodeCamp handbook of roughly 7,500 words, published 25 June 2025 by Sumit Saha, a Bangladeshi software engineer and programming educator who founded Learn with Sumit and logicBase Labs. It takes a web developer from "what is MCP" to a working custom server. It opens with the USB-C-port analogy the protocol's own documentation uses, then spends real space on why MCP exists and how it differs from RAG before reaching architecture: how an AI application talks to an MCP server, what happens inside the server, and how host, client, server and transport fit together. The build is deliberately not a toy. The server exposes Google Calendar through a `getMyCalendarDataByDate` tool, so you handle real API credentials, the `googleapis` client and a `.env` file rather than a hard-coded array. The stack is `@modelcontextprotocol/sdk` for the protocol itself, `zod` for tool input schemas and `dotenv` for configuration, communicating over the local stdio transport, and the finished server is connected to the Cursor editor to prove it works end to end. A section on opportunities for web developers frames MCP as a career surface rather than a curiosity. The source lives in a companion GitHub repository, logicbaselabs/mcp-tutorial, which also backs a YouTube crash course; prerequisites are listed honestly up front, including the optional ones.
At a Glance
- Topic
- MCP
- Level
- Beginner
- Format
- Tutorial
- Cost
- Free
- Duration
- ~2 hours hands-on (roughly 7,500-word handbook)
- Provider
- freeCodeCamp (Sumit Saha)
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Scaffold a TypeScript MCP server on the official @modelcontextprotocol/sdk package
- ✓Define tool input schemas with zod so the model calls your tools correctly
- ✓Expose a real third-party API, Google Calendar, as a callable MCP tool
- ✓Wire API credentials and .env configuration into a local stdio server
- ✓Understand how host, client, server and transport fit together in MCP
- ✓Connect a finished server to the Cursor editor and verify it responds
- ✓Tell when MCP is the right answer and when RAG still is
Highlights
- •Builds against a real API (Google Calendar) rather than a hello-world echo tool
- •Roughly 7,500 words, with a companion GitHub repo and a YouTube crash course behind it
- •Explains RAG versus MCP explicitly, the confusion most MCP posts skip entirely
- •Free, no signup and no course platform, published through freeCodeCamp's editorial process
- •Prerequisites are listed honestly up front, separated into required and optional
Who It’s For
Best For
- ✓Web and Node developers writing their first MCP server
- ✓Engineers who learn by building one complete working thing end to end
- ✓Anyone deciding between RAG and MCP for a data-access problem
Prerequisites
- •Working TypeScript or JavaScript, plus Node.js and npm
- •Comfort with the terminal, .env files and REST/HTTP basics
- •A Google Cloud console account to issue the Calendar API credentials
FAQ
What is How to Build a Custom MCP Server with TypeScript - A Handbook for Developers?
A long-form freeCodeCamp handbook that takes a web developer from what MCP is to a working custom server in TypeScript. It explains the protocol and its architecture, contrasts MCP with RAG, then builds a server exposing Google Calendar data through a real tool, wired into the Cursor editor. Free, no signup, with a companion GitHub repository.
Is How to Build a Custom MCP Server with TypeScript - A Handbook for Developers free?
How to Build a Custom MCP Server with TypeScript - A Handbook for Developers is free to access.
What level is How to Build a Custom MCP Server with TypeScript - A Handbook for Developers for?
How to Build a Custom MCP Server with TypeScript - A Handbook for Developers is aimed at a beginner audience. Recommended background: Working TypeScript or JavaScript, plus Node.js and npm, Comfort with the terminal, .env files and REST/HTTP basics, A Google Cloud console account to issue the Calendar API credentials.
How long does How to Build a Custom MCP Server with TypeScript - A Handbook for Developers take?
Expect roughly ~2 hours hands-on (roughly 7,500-word handbook). Most learners work through it at their own pace.
What will I learn from How to Build a Custom MCP Server with TypeScript - A Handbook for Developers?
You'll learn: Scaffold a TypeScript MCP server on the official @modelcontextprotocol/sdk package; Define tool input schemas with zod so the model calls your tools correctly; Expose a real third-party API, Google Calendar, as a callable MCP tool; Wire API credentials and .env configuration into a local stdio server; Understand how host, client, server and transport fit together in MCP; Connect a finished server to the Cursor editor and verify it responds; Tell when MCP is the right answer and when RAG still is.
Topics
Sources
This page was written from 3 sources, 2 on domains other than freecodecamp.org.