lets-learn-mcp-python

MCP Python Tutorial

GitHub Stars

853

User Rating

Not Rated

Favorites

0

Views

2

Forks

148

Issues

0

README
Let's Learn MCP with Python - Tutorial Series

A comprehensive guide to understanding and building Model Context Protocol (MCP) Servers for Python developers through interactive learning experiences.

What You'll Build

By the end of this tutorial series, you'll have:

  1. 🐍 Python Study Buddy App - An interactive console application that uses a custom MCP server to help developers learn Python concepts at beginner, intermediate, and expert levels
  2. 🧠 AI Research Learning MCP Server - Your own advanced MCP server that helps AI assistants find the latest AI/ML research papers, highlight top discoveries, and create personalized study plans
Tutorial Structure
Part 1: Setup and Core Concepts
mcp-core-concepts

⏱️ Time: 15-20 minutes

Set up your development environment and understand MCP fundamentals:

  • Install VS Code, Python 3.12+, and Python extension
  • Learn what Model Context Protocol is and why it matters
  • Understand the client-server architecture
  • Note for a more in depth 'Getting Started' with MCP Demo check out mcp-python-demo

Part 2: Using MCP Servers - Python Study Buddy

⏱️ Time: 20-35 minutes

study-buddy-app

Key Learning Objectives:

  1. Create a basic MCP server in Python
  2. Use prompts with MCP
  3. Use basic tools with MCP

Outcomes:
Building an interactive Python learning companion:

  • Configure a custom Python Learning MCP server
  • Create Python models for learning concepts using dataclasses
  • Build an interactive study session with progress tracking
  • Generate personalized coding challenges and explanations
  • Understand how AI assistants can enhance learning experiences

Example of what you'll create:

🐍 Python Study Buddy - Interactive Learning Session
===================================================
Level: Intermediate
Topic: List Comprehensions
Progress: 3/10 concepts mastered

Challenge: Create a list comprehension that filters even numbers...
💡 Hint: Use the modulo operator (%) to check for even numbers
🎯 Your mission: Write code that demonstrates understanding!

Continue to: Part 2: Python Study Buddy →


Part 3: Building Your Own MCP Server - AI Research Learning Hub

⏱️ Time: 20-35 minutes

Key Learning Objectives:

  1. Find and use external MCP servers
  2. Add resources with MCP
  3. Automate Tasks with MCP

Outcomes:
Build an advanced MCP server that helps you keep up with the latest AI Research:

  • Create an AI/ML research paper discovery service
  • Implement tools for finding trending papers and breakthroughs
  • Build personalized study plan generation capabilities
  • Create intelligent content summarization and ranking
  • Store daily AI Research Learning Notes in a Github Repo

What you'll build:

  • search_research_papers() - Find latest AI/ML research by topic
  • get_trending_papers() - Discover what's hot in AI research
  • create_study_plan() - Generate personalized learning roadmaps
  • summarize_paper() - Create digestible summaries of complex research
  • track_learning_progress() - Monitor study achievements and goals
  • send_research_learning() - Send study daily study note to the user

Continue to: Part 3: AI Research Learning Hub →


Quick Start

If you're ready to dive in immediately:

1. Visual Studio Code
  • Download and install VS Code
  • Essential for MCP development and integration
2. Python 3.12+
  • Install Python 3.12 or later from Python.org
  • Verify installation: python --version or python3 --version
  • Ensure pip is installed: pip --version or pip3 --version
3. Python Extension for VS Code
  • Install the Python extension
  • Provides comprehensive Python development support
  • Includes IntelliSense, debugging, and virtual environment management
4. Install UV

To install UV, run the following command in the terminal:

pip install uv 
5. Create Virtual Environment
# Using venv (recommended)
python -m venv mcp-env

# Activate on macOS/Linux
source mcp-env/bin/activate

# Activate on Windows
mcp-env\Scripts\activate
6. Install packages
uv sync --active
6. Walk through the core concepts in the terminal
python part-1-concepts.py
7. Build your first MCP app
  1. Choose your path:
Additional Resources
Contributing

This tutorial is open source! Feel free to:

  • 🐛 Submit improvements and corrections
  • 💡 Add more examples and use cases
  • 🤝 Share your own MCP server implementations
  • 💬 Help others in the discussions

Happy learning! 🐍🧠

Author Information
Microsoft

Open source projects and samples from Microsoft

Redmond, WA

100,701

Followers

7,034

Repositories

0

Gists

0

Total Contributions

Related MCPs
adk-mcp-tutorial logo

No description

Python
Meteo_MCP_server_tuto logo

This repository is a minimal tutorial for building and using an MCP (Model-Context-Protocol) server with FastMCP in Python. It demonstrates how to expose simple weather tools (get_coords, get_forecast) and use them directly in GitHub Copilot Chat in VS Code via the STDIO protocol — no extra API or plugin code required.

Python
mcp-learning-path-demo logo

Learning Path Generator with Model Context Protocol (MCP)

Python