Sandbox
@microsoft/mcp-for-beginners

MCP learning curriculum for builders and hosts

This repository is a hands-on course for learning Model Context Protocol from the ground up. It walks you through MCP basics, security, client and server builds, testing, deployment, and advanced integrations with examples in several languages. The lessons are grouped into modules and labs, with sample code and case studies you can follow directly. It also points builders to MCP hosts like Claude Desktop, Cursor, and VS Code, so you can see how the protocol fits into real workflows.

17,188 starsβ€’5.6k forksβ€’Jupyter Notebookβ€’Updated 6d ago
Who it's for

Builders who want to learn MCP through guided lessons, examples, and labs in their own tooling.

What it delivers

You can build and connect MCP servers and clients with a clearer path from basics to production use.

What it does

Core MCP lessons

Introductory modules explain MCP concepts, client-server flow, and the latest 2026-07-28 protocol changes.

Security guidance

Dedicated chapters cover MCP security threats, best practices, auth patterns, and control examples.

Getting started labs

Step-by-step guides show how to build a first server, a client, an LLM client, and host integrations.

Advanced topic modules

Later sections cover routing, scaling, realtime streaming, context engineering, multi-modality, and protocol features.

Hands-on database track

A 13-lab path shows how to build an MCP server with PostgreSQL, tools, semantic search, testing, monitoring, and deployment.

Multi-language samples

Examples are provided across C#, Java, JavaScript, Rust, Python, and TypeScript.

Host and tooling support

The curriculum includes guidance for VS Code, Claude Desktop, Cursor, Copilot, and MCP Inspector.

How to get it

  1. 1Bash / macOS / Linux
    git clone --filter=blob:none --sparse https://github.com/microsoft/mcp-for-beginners.git
    cd mcp-for-beginners
    git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'
  2. 2CMD (Windows)
    git clone --filter=blob:none --sparse https://github.com/microsoft/mcp-for-beginners.git
    cd mcp-for-beginners
    git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"

README

MCP-for-beginners

GitHub contributors GitHub issues GitHub pull-requests PRs Welcome MCP Toplist

GitHub watchers GitHub forks GitHub stars

Microsoft Foundry Discord

Follow these steps to get started using these resources:

  1. Fork the Repository: Click GitHub forks
  2. Clone the Repository: git clone https://github.com/microsoft/mcp-for-beginners.git
  3. Join The Microsoft Foundry Discord

🌐 Multi-Language Support

Supported via GitHub Action (Automated & Always Up-to-Date)

Arabic | Bengali | Bulgarian | Burmese (Myanmar) | Chinese (Simplified) | Chinese (Traditional, Hong Kong) | Chinese (Traditional, Macau) | Chinese (Traditional, Taiwan) | Croatian | Czech | Danish | Dutch | Estonian | Finnish | French | German | Greek | Hebrew | Hindi | Hungarian | Indonesian | Italian | Japanese | Kannada | Khmer | Korean | Lithuanian | Malay | Malayalam | Marathi | Nepali | Nigerian Pidgin | Norwegian | Persian (Farsi) | Polish | Portuguese (Brazil) | Portuguese (Portugal) | Punjabi (Gurmukhi) | Romanian | Russian | Serbian (Cyrillic) | Slovak | Slovenian | Spanish | Swahili | Swedish | Tagalog (Filipino) | Tamil | Telugu | Thai | Turkish | Ukrainian | Urdu | Vietnamese

Prefer to Clone Locally?

This repository includes 50+ language translations which significantly increases the download size. To clone without translations, use sparse checkout:

Bash / macOS / Linux:

git clone --filter=blob:none --sparse https://github.com/microsoft/mcp-for-beginners.git
cd mcp-for-beginners
git sparse-checkout set --no-cone '/*' '!translations' '!translated_images'

CMD (Windows):

git clone --filter=blob:none --sparse https://github.com/microsoft/mcp-for-beginners.git
cd mcp-for-beginners
git sparse-checkout set --no-cone "/*" "!translations" "!translated_images"

This gives you everything you need to complete the course with a much faster download.

πŸš€ Model Context Protocol (MCP) Curriculum for Beginners

Learn MCP with Hands-on Code Examples in C#, Java, JavaScript, Rust, Python, and TypeScript

🧠 Overview of the Model Context Protocol Curriculum

Welcome to your journey into the Model Context Protocol! If you've ever wondered how AI applications communicate with different tools and services, you're about to discover the elegant solution that's transforming how developers build intelligent systems.

Think of MCP as a universal translator for AI applications - just like how USB ports let you connect any device to your computer, MCP lets AI models connect to any tool or service in a standardized way. Whether you're building your first chatbot or working on complex AI workflows, understanding MCP will give you the power to create more capable and flexible applications.

This curriculum is designed with patience and care for your learning journey. We'll start with simple concepts you already understand and gradually build your expertise through hands-on practice in your favorite programming language. Every step includes clear explanations, practical examples, and plenty of encouragement along the way.

By the time you complete this journey, you'll have the confidence to build your own MCP servers, integrate them with popular AI platforms, and understand how this technology is reshaping the future of AI development. Let's begin this exciting adventure together!

Official Documentation and Specifications

The current protocol revision is MCP Specification 2026-07-28. The MCP specification uses date-based versioning (YYYY-MM-DD format) to make protocol compatibility explicit.

Version note: this curriculum teaches the current 2026-07-28 concepts, including stateless requests, the Extensions framework, and the deprecation of Roots, Sampling, and Logging. Some hands-on examples remain explicitly versioned to 2025-11-25 while SDK support catches up. See What's Changed in MCP: The 2026-07-28 Specification for the changes and migration guidance.

These resources become more valuable as your understanding grows, but don't feel pressured to read everything immediately. Start with the areas that interest you most!

  • πŸ“˜ MCP Documentation – This is your go-to resource for step-by-step tutorials and user guides. The documentation is written with beginners in mind, providing clear examples you can follow along with at your own pace.
  • πŸ“œ MCP Specification – Think of this as your comprehensive reference manual. As you work through the curriculum, you'll find yourself returning here to look up specific details and explore advanced features.
  • πŸ“œ MCP Specification Versioning – This contains information about protocol version history and how MCP uses date-based versioning (YYYY-MM-DD format).
  • πŸ§‘β€πŸ’» MCP GitHub Repository – Here you'll find SDKs, tools, and code samples in multiple programming languages. It's like a treasure trove of practical examples and ready-to-use components.
  • 🌐 MCP Community – Join fellow learners and experienced developers in discussions about MCP. It's a supportive community where questions are welcome and knowledge is shared freely.

Learning Objectives

By the end of this curriculum, you'll feel confident and excited about your new abilities. Here's what you'll achieve:

β€’ Understand MCP fundamentals: You'll grasp what the Model Context Protocol is and why it's revolutionizing how AI applications work together, using analogies and examples that make sense.

β€’ Build your first MCP server: You'll create a working MCP server in your preferred programming language, starting with simple examples and growing your skills step by step.

β€’ Connect AI models to real tools: You'll learn how to bridge the gap between AI models and actual services, giving your applications powerful new capabilities.

β€’ Implement security best practices: You'll understand how to keep your MCP implementations safe and secure, protecting both your applications and your users.

β€’ Deploy with confidence: You'll know how to take your MCP projects from development to production, with practical deployment strategies that work in the real world.

β€’ Join the MCP community: You'll become part of a growing community of developers who are shaping the future of AI application development.

Essential Background

Before we dive into MCP specifics, let's make sure you feel comfortable with some foundational concepts. Don't worry if you're not an expert in these areas - we'll explain everything you need to know as we go!

Understanding Protocols (The Foundation)

Think of a protocol like the rules for a conversation. When you call a friend, you both know to say "hello" when you answer, take turns speaking, and say "goodbye" when you're done. Computer programs need similar rules to communicate effectively.

MCP is a protocol - a set of agreed-upon rules that help AI models and applications have productive "conversations" with tools and services. Just like how having conversation rules makes human communication smoother, having MCP makes AI application communication much more reliable and powerful.

Client-Server Relationships (How Programs Work Together)

You already use client-server relationships every day! When you use a web browser (the client) to visit a website, you're connecting to a web server that sends you the page content. The browser knows how to ask for information, and the server knows how to respond.

In MCP, we have a similar relationship: AI models act as clients that request information or actions, while MCP servers provide those capabilities. It's like having a helpful assistant (the server) that the AI can ask to perform specific tasks.

Why Standardization Matters (Making Things Work Together)

Imagine if every car manufacturer used different shaped gas pumps - you'd need a different adapter for each car! Standardization means agreeing on common approaches so things work together seamlessly.

MCP provides this standardization for AI applications. Instead of every AI model needing custom code to work with every tool, MCP creates a universal way for them to communicate. This means developers can build tools once and have them work with many different AI systems.

🧭 Your Learning Path Overview

Your MCP journey is carefully structured to build your confidence and skills progressively. Each phase introduces new concepts while reinforcing what you've already learned.

🌱 Foundation Phase: Understanding the Basics (Modules 0-2)

This is where your adventure begins! We'll introduce you to MCP concepts using familiar analogies and simple examples. You'll understand what MCP is, why it exists, and how it fits into the larger world of AI development.

β€’ Module 0 - Introduction to MCP: We'll start by exploring what MCP is and why it's so important for modern AI applications. You'll see real-world examples of MCP in action and understand how it solves common problems developers face.

β€’ Module 1 - Core Concepts Explained: Here you'll learn the essential building blocks of MCP. We'll use plenty of analogies and visual examples to make sure these concepts feel natural and understandable.

β€’ Module 2 - Security in MCP: Security might sound intimidating, but we'll show you how MCP includes built-in safety features and teach you best practices that protect your applications from the start.

πŸ”¨ Building Phase: Creating Your First Implementations (Module 3)

Now the real fun begins! You'll get hands-on experience building actual MCP servers and clients. Don't worry - we'll start simple and guide you through every step.

This module includes multiple hands-on guides that let you practice in your preferred programming language. You'll create your first server, build a client to connect to it, and even integrate with popular development tools like VS Code.

Each guide includes complete code examples, troubleshooting tips, and explanations of why we make specific design choices. By the end of this phase, you'll have working MCP implementations you can be proud of!

πŸš€ Growing Phase: Advanced Concepts and Real-World Application (Modules 4-5)

With the basics mastered, you're ready to explore more sophisticated MCP features. We'll cover practical implementation strategies, debugging techniques, and advanced topics like multi-modal AI integration.

You'll also learn how to scale your MCP implementations for production use and integrate with cloud platforms like Azure. These modules prepare you to build MCP solutions that can handle real-world demands.

🌟 Mastery Phase: Community and Specialization (Modules 6-11)

The final phase focuses on joining the MCP community and specializing in areas that interest you most. You'll learn how to contribute to open-source MCP projects, implement advanced authentication patterns, and build comprehensive database-integrated solutions.

Module 11 deserves special mention - it's a complete 13-lab hands-on learning path that teaches you to build production-ready MCP servers with PostgreSQL integration. It's like a capstone project that brings together everything you've learned!

πŸ“š Complete Curriculum Structure

ModuleTopicDescriptionLink
Module 0-3: Fundamentals
00Introduction to MCPOverview of the Model Context Protocol and its significance in AI pipelinesRead more
01Core Concepts ExplainedIn-depth exploration of core MCP conceptsRead more
1.1What's Changed in MCP (2026-07-28)Stateless protocol, Extensions framework, and feature deprecations in the current specificationGuide
02Security in MCPSecurity threats and best practicesRead more
2.1CIMD and DCR AuthorizationCompare preferred CIMD registration with deprecated DCR fallback using a protected MCP serverSample
03Getting Started with MCPEnvironment setup, basic servers/clients, integrationRead more
Module 3: Building Your First Server & Client
3.1First ServerCreate your first MCP serverGuide
3.2First ClientDevelop a basic MCP clientGuide
3.3Client with LLMIntegrate large language modelsGuide
3.4VS Code IntegrationConsume MCP servers in VS CodeGuide
3.5stdio ServerCreate servers using stdio transportGuide
3.6HTTP StreamingImplement HTTP streaming in MCPGuide
3.7Microsoft Foundry ToolkitUse Microsoft Foundry Toolkit with MCPGuide
3.8TestingTest your MCP server implementationGuide
3.9DeploymentDeploy MCP servers to productionGuide
3.10Advanced server usageUse advanced servers for advanced feature usage and improved architectureGuide
3.11Simple authA chapter showing you auth from the beginning and RBACGuide
3.12MCP HostsConfigure Claude Desktop, Cursor, Cline, and other MCP hostsGuide
3.13MCP InspectorDebug and test MCP servers with the Inspector toolGuide
3.14SamplingUse sampling to collaborate with the clientGuide
3.15MCP AppsBuild MCP AppsGuide
Module 4-5: Practical & Advanced
04Practical ImplementationSDKs, debugging, testing, reusable prompt templatesRead more
4.1PaginationHandle large result sets with cursor-based paginationGuide
05Advanced Topics in MCPMulti-modal AI, scaling, enterprise useRead more
5.1Azure IntegrationMCP Integration with AzureGuide
5.2Multi-modalityWorking with multiple modalitiesGuide
5.3OAuth2 DemoImplement OAuth2 authenticationGuide
5.4Root ContextsUnderstand and implement root contextsGuide
5.5RoutingMCP routing strategiesGuide
5.6SamplingSampling techniques in MCPGuide
5.7ScalingScale MCP implementationsGuide
5.8SecurityAdvanced security considerationsGuide
5.9Web SearchImplement web search capabilitiesGuide
5.10Realtime StreamingBuild realtime streaming functionalityGuide
5.11Realtime SearchImplement realtime searchGuide
5.12Entra ID AuthAuthentication with Microsoft Entra IDGuide
5.13Foundry IntegrationIntegrate with Microsoft FoundryGuide
5.14Context EngineeringTechniques for effective context engineeringGuide
5.15MCP Custom TransportCustom Transport implementationsGuide
5.16Protocol FeaturesProgress notifications, cancellation, resource templatesGuide
5.17Adversarial Multi-Agent ReasoningTwo agents argue opposite sides using shared MCP tools, evaluated by a judge agentGuide
Module 6-10: Community & Best Practices
06Community ContributionsHow to contribute to the MCP ecosystemGuide
07Insights from Early AdoptionReal-world implementation storiesGuide
08Best Practices for MCPPerformance, fault-tolerance, resilienceGuide
09MCP Case StudiesPractical implementation examplesGuide
10Hands-on WorkshopBuilding an MCP Server with Microsoft Foundry ToolkitLab
Module 11: MCP Server Hands On Lab
11MCP Server Database IntegrationComprehensive 13-lab hands-on learning path for PostgreSQL integrationLabs
11.1IntroductionOverview of MCP with database integration and retail analytics use caseLab 00
11.2Core ArchitectureUnderstanding MCP server architecture, database layers, and security patternsLab 01
11.3Security & Multi-TenancyRow Level Security, authentication, and multi-tenant data accessLab 02
11.4Environment SetupSetting up development environment, Docker, Azure resourcesLab 03
11.5Database DesignPostgreSQL setup, retail schema design, and sample dataLab 04
11.6MCP Server ImplementationBuilding the FastMCP server with database integrationLab 05
11.7Tool DevelopmentCreating database query tools and schema introspectionLab 06
11.8Semantic SearchImplementing vector embeddings with Azure OpenAI and pgvectorLab 07
11.9Testing & DebuggingTesting strategies, debugging tools, and validation approachesLab 08
11.10VS Code IntegrationConfiguring VS Code MCP integration and AI Chat usageLab 09
11.11Deployment StrategiesDocker deployment, Azure Container Apps, and scaling considerationsLab 10
11.12MonitoringApplication Insights, logging, performance monitoringLab 11
11.13Best PracticesPerformance optimization, security hardening, and production tipsLab 12
Module 12: MCP Tooling
12.1ToolingMCP usage in Copilot App Guide

πŸ’» Sample Code Projects

One of the most exciting parts of learning MCP is seeing your code skills develop progressively. We've designed our code examples to start simple and grow more sophisticated as your understanding deepens. Here's how we introduce concepts - with code that's easy to understand but demonstrates real MCP principles, you'll understand not just what this code does, but why it's structured this way and how it fits into larger MCP applications.

Basic MCP Calculator Samples

LanguageDescriptionLink
C#MCP Server ExampleView Code
JavaMCP CalculatorView Code
JavaScrip

Files in the repo

Repository payloadβ€’28 top-level entries
  • .devcontainer
  • .github
  • 00-Introduction
  • 01-CoreConcepts
  • 02-Security
  • 03-GettingStarted
  • 04-PracticalImplementation
  • 05-AdvancedTopics
  • 06-CommunityContributions
  • 07-LessonsfromEarlyAdoption
  • 08-BestPractices
  • 09-CaseStudy
  • 10-StreamliningAIWorkflowsBuildingAnMCPServerWithAIToolkit
  • 11-MCPServerHandsOnLabs
  • 12-tooling
  • images
  • translated_images
  • translations
  • .dockerignore
  • .gitignore
  • AGENTS.md
  • changelog.md
  • CODE_OF_CONDUCT.md
  • LICENSE
  • README.md
  • SECURITY.md
  • study_guide.md
  • SUPPORT.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More tutorials & guides

shareAI-lab/
learn-claude-code

Bash is all you need - A nano claude code–like γ€Œagent harness」, built from 0 to 1

77k
luongnv89/
claude-howto
luongnv89/claude-howtoTutorials & Guides

A visual, example-driven guide to Claude Code β€” from basic concepts to advanced agents, with copy-paste templates that bring immediate value.

41k
agentskills/
agentskills
agentskills/agentskillsTutorials & Guides

Specification and documentation for Agent Skills

25k
datawhalechina/easy-vibeTutorials & Guides

πŸ’» vibe coding 101|The first course for AI-native product builders.

19k