Lesson 2 of 3•Building MCP Servers: Connect AI to Everything0 of 3 complete (0%)
Build Your First MCP Server
15 min
What you will learn
- Set up a Node.js MCP server project with the official TypeScript SDK
- Define tools with input schemas and implement request handlers
- Test your MCP server locally with Claude Code
- Build a practical example: a weather API MCP server
# Build Your First MCP Server
Setting Up the Project
mkdir my-weather-mcp && cd my-weather-mcp
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install -D typescript @types/node
npx tsc --initUpdate tsconfig.json to use "module": "NodeNext" and "moduleResolution": "NodeNext".
The Minimal MCP Server
Here is the simplest possible MCP server — it exposes one tool:
Unlock this lesson
Upgrade to Pro to access the full content
What you'll learn:
- Set up a Node.js MCP server project with the official TypeScript SDK
- Define tools with input schemas and implement request handlers
- Test your MCP server locally with Claude Code