mcp-for-beginners README

The project's README from github.com/microsoft/mcp-for-beginners. As one markdown file: README.md.

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!

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

Module Topic Description Link
Module 0-3: Fundamentals
00 Introduction to MCP Overview of the Model Context Protocol and its significance in AI pipelines Read more
01 Core Concepts Explained In-depth exploration of core MCP concepts Read more
1.1 What's Changed in MCP (2026-07-28) Stateless protocol, Extensions framework, and feature deprecations in the current specification Guide
02 Security in MCP Security threats and best practices Read more
2.1 CIMD and DCR Authorization Compare preferred CIMD registration with deprecated DCR fallback using a protected MCP server Sample
03 Getting Started with MCP Environment setup, basic servers/clients, integration Read more
Module 3: Building Your First Server & Client
3.1 First Server Create your first MCP server Guide
3.2 First Client Develop a basic MCP client Guide
3.3 Client with LLM Integrate large language models Guide
3.4 VS Code Integration Consume MCP servers in VS Code Guide
3.5 stdio Server Create servers using stdio transport Guide
3.6 HTTP Streaming Implement HTTP streaming in MCP Guide
3.7 Microsoft Foundry Toolkit Use Microsoft Foundry Toolkit with MCP Guide
3.8 Testing Test your MCP server implementation Guide
3.9 Deployment Deploy MCP servers to production Guide
3.10 Advanced server usage Use advanced servers for advanced feature usage and improved architecture Guide
3.11 Simple auth A chapter showing you auth from the beginning and RBAC Guide
3.12 MCP Hosts Configure Claude Desktop, Cursor, Cline, and other MCP hosts Guide
3.13 MCP Inspector Debug and test MCP servers with the Inspector tool Guide
3.14 Sampling Use sampling to collaborate with the client Guide
3.15 MCP Apps Build MCP Apps Guide
Module 4-5: Practical & Advanced
04 Practical Implementation SDKs, debugging, testing, reusable prompt templates Read more
4.1 Pagination Handle large result sets with cursor-based pagination Guide
05 Advanced Topics in MCP Multi-modal AI, scaling, enterprise use Read more
5.1 Azure Integration MCP Integration with Azure Guide
5.2 Multi-modality Working with multiple modalities Guide
5.3 OAuth2 Demo Implement OAuth2 authentication Guide
5.4 Root Contexts Understand and implement root contexts Guide
5.5 Routing MCP routing strategies Guide
5.6 Sampling Sampling techniques in MCP Guide
5.7 Scaling Scale MCP implementations Guide
5.8 Security Advanced security considerations Guide
5.9 Web Search Implement web search capabilities Guide
5.10 Realtime Streaming Build realtime streaming functionality Guide
5.11 Realtime Search Implement realtime search Guide
5.12 Entra ID Auth Authentication with Microsoft Entra ID Guide
5.13 Foundry Integration Integrate with Microsoft Foundry Guide
5.14 Context Engineering Techniques for effective context engineering Guide
5.15 MCP Custom Transport Custom Transport implementations Guide
5.16 Protocol Features Progress notifications, cancellation, resource templates [Guide](./05-AdvancedTopics/mcp-protocol-feature

mcp-for-beginners (microsoft/mcp-for-beginners)

Searching Database…

这是什么?这是微软推出的一套免费开源课程,通过 C#、Java、TypeScript、JavaScript、Rust 和 Python 的动手代码示例,讲解模型上下文协议(MCP)。MCP 是让 AI 模型连接工具和服务的标准。
这是有结构的课程,还是只是参考文档?这是一套按模块组织的课程(模块 0 至 11),包含循序渐进的课程和动手实验,而不只是纯参考文档。仅顶点项目模块 11 就包含一条 13 个实验的路径,用于构建一个结合 PostgreSQL 的生产级 MCP 服务器。
我该怎么开始学习?Fork 该仓库,然后用 git clone 克隆,即可获得完整课程和所有代码示例。
跟着学需要掌握全部六种语言吗?不需要。每个动手模块都为每种语言(C#、Java、JavaScript、Rust、Python、TypeScript)提供单独的指南,你可以选择自己熟悉的语言跟着学。
克隆仓库会下载所有内容,包括翻译版本吗?默认会。仓库内置了 50 多个翻译版本,因此克隆体积会大很多;如果只想更快地获取英文课程内容,可以使用稀疏检出(sparse checkout)。
课程用什么类比来解释 MCP?它把 MCP 比作 USB:正如 USB 让任何设备都能插入任何电脑,MCP 也让 AI 模型通过一套标准化协议连接任何工具或服务。
课程会跟进 MCP 规范的最新变化吗?会。课程讲解的是当前的 2026-07-28 规范,包括无状态请求和 Extensions 扩展框架;不过部分动手示例仍固定在较旧的 2025-11-25 规范上,直到 SDK 支持跟上为止。
顶点项目模块包含什么内容?模块 11 是一条 13 个实验的动手路径,用于构建与 PostgreSQL 集成的生产级 MCP 服务器。
这个可以和 VS Code 一起用吗?可以,模块 3.4 是一篇专门讲解如何在 VS Code 中直接使用 MCP 服务器的指南。
Creator
microsoft
Size
2.8 GB
Stars
17.5K
Updated
CommitOct 17
Age
1y
Commits · 90 Days