
In this lesson, we delve into the reasons behind the existence of the Model Context Protocol (MCP). We address specific challenges that MCP aims to solve in the realm of AI and large language models, particularly the need for a standardized interaction mechanism between AI systems and external entities.
- Introduction to the limitations of LLMs in interacting with the external world and the emergence of function or tool calling to address this gap.
- Discussion on the lack of a standardized framework for tool calling, leading to incompatible methods across different frameworks.
- Explanation of the inefficiencies caused by independently developed function calling scripts that aren't consistently supported by underlying API providers.
- Exploration of the challenges posed by server-based tool calling, preventing LLMs from leveraging local machine resources for functionality.
- Introduction to MCP as a solution that standardizes interactions, allowing seamless integration between various systems and facilitating resourceful local computing interactions.
- Overview of MCP's role in unifying how AI systems connect with external systems, offering a widely adopted standard.
In this lesson, we delve into the history and benefits of the Model Context Protocol (MCP), focusing on its origins and significance in agentic AI development. We illustrate how MCP streamlines interactions between users, hosts, models, and various external systems or tools by eliminating repetitive code, making it easier for developers and users alike.
- Explanation of MCP’s origins in agentic AI and its architecture.
- Overview of traditional user-host-model interactions, using examples like Claude desktop software and ChatGPT.
- Introduction to the concept of tools as functions models can execute, using APIs and external systems.
- Description of MCP’s workflow, where MCP clients and servers facilitate seamless tool integration.
- Highlight of MCP’s advantages by abstracting complexities, enabling developers to bypass repetitive coding tasks.
- Examples of companies creating MCP servers for their APIs, like Zapier and Cloudflare.
- Illustration of how to connect MCP servers to MCP clients with minimal code.
- Discussion on leveraging MCP in user applications and developing MCP servers if none exist.
In this lesson, we explore the Model Context Protocol (MCP) as a standardized mechanism for AI systems to communicate with external systems. We compare MCP to a USB-C port, highlighting its role as a universal connector for various tools and systems, while emphasizing its importance in simplifying complex integrations with AI environments.
- Understanding MCP as a protocol for connecting AI systems, like LLMs or agents, with external systems such as APIs and local processes.
- Explanation of MCP's functionality using the analogy of a USB-C port for seamless data exchange.
- Overview of how MCP abstracts complex code into a few lines of JSON, making system integration more efficient.
- Clarification that MCP is not a new technology, but an accepted communication standard for AI interactions.
- Emphasis on the importance of understanding the foundational purpose of MCP as its adoption grows in various applications.
In this lesson, we delve into the objectives and scope of the MCP Masterclass course. We focus on equipping learners with the skills to develop MCP servers and clients from scratch, particularly using Python, providing a comprehensive guide to understanding MCP architecture.
- Overview of the course as a complete guide to MCPs, aimed at developers rather than end-users.
- Emphasis on building and understanding the architecture of MCP servers and clients using Python, while recognizing that the concepts are applicable across different programming languages.
- Exploration of various MCP components, including architecture, tools, resources, transport protocols, and authentication methods.
- Highlighting the evolving nature of MCP and its specifications, underlining the importance of keeping up-to-date with changes.
- Assurance that the course will thoroughly cover all necessary topics to make learners proficient in developing and implementing MCP solutions.
In this lesson, we explore the course roadmap, laying out the structure and sequence of modules to ensure a comprehensive understanding of MCPs. We emphasize the importance of engaging with each part, highlighting key sections and potential areas you may choose to focus on based on your learning goals.
- Introduction to the course, detailing the logistical components and initial overview of MCPs.
- Discussion about the essential architecture overview module, which provides the foundational understanding necessary for the course.
- Guidance on setting up the development environment to follow along actively with the course exercises.
- Outline of the main course content, including the quick start guide, server and client deep dives, and integration techniques.
- Explanation of the MCP server and client deep dives, focusing on tools, resources, debugging, and deployment strategies.
- Insights into MCP integrations with popular frameworks and tools for broader applicability.
- Final project-based module where learners apply their knowledge to build various MCP servers and clients from scratch.
- Concluding remarks on course completion and obtaining the certificate.
In this lesson, we get to know Henry Habib, the instructor of this course. Henry shares his background as an automation and productivity consultant, highlighting his enthusiasm for no-code automation and generative AI. He expresses his passion for simplifying complex concepts and teaching them to others.
- Introduction to Henry Habib, highlighting his role as an automation and productivity consultant.
- Discussion of his experience with no-code automation and generative AI technologies.
- Emphasis on his enthusiasm for being an early adopter of new technologies, including MCP.
- Insight into his passion for teaching complex frameworks in a simplified manner.
- Encouragement for course ratings to improve learning experiences and visibility.
In this lesson, we discuss how to succeed in mastering MCP servers and clients by emphasizing active participation. We focus on hands-on practice, exploration, and community involvement to ensure deep understanding and learning.
- Emphasize the importance of actively engaging with the course material by performing tasks alongside the instructor.
- Highlight the value of setting up your own environment and using shared resources for practical learning.
- Encourage exploration and experimentation by creating various MCP servers and clients, such as connecting APIs to AI applications.
- Support independent exploration and learning beyond course modules to deepen understanding.
- Stress the significance of community engagement by asking questions, providing answers, and seeking help within the course community.
In this lesson, we delve into the intricate architecture of the Model Context Protocol (MCP). We explore the roles and interactions of MCP servers and clients, providing a foundational understanding of how these elements work together to facilitate efficient communication and processing within various applications.
- Overview of MCP architecture and its significance in agentic AI applications.
- Explanation of the roles of MCP hosts, clients, and servers.
- Discussion on the modularity of MCP servers and their one-to-one connections with tools, apps, or processes.
- Examination of communication protocols between MCP clients and servers.
- Examples of real-world applications using MCP, including integration with SaaS APIs and local computations.
- Workflow example demonstrating the interaction between user, MCP client, server, and external processes.
- Clarification of where MCP components typically run (local vs. remote) and the implications for application deployment.
In this lesson, we delve into the intricacies of MCP servers, particularly focusing on the integration of tools and their communication protocols. We explore how MCP clients connect to servers and utilize different tools by defining necessary parameters that facilitate interaction within the system.
- Explanation of the MCP server-client relationship and connectivity with web APIs.
- Understanding the definition of tools within MCP servers, including necessary parameters: name, description, and input schema.
- Discussion on how tool parameters are communicated between the client and MCP host.
- Introduction to additional primitives in MCP servers, such as prompts and resources.
- Insights on how tool parameters can be both statically typed or implicitly derived from function definitions and doc strings.
- Emphasis on creating function logic for tools, enabling effective communication and execution via MCP servers.
In this lesson, we delve into the complete workflow of the MCP client and server communication protocol. We break down each step involved in establishing a connection between an MCP client and server, using a practical example to clarify the process for learners.
- Introduction to the components involved: MCP host, MCP client, MCP server, and an external service.
- Explanation of the initial connection process where the MCP client spins up servers and requests a list of tools.
- Description of the tool identification and execution process when a user query is received.
- Insights into how the MCP host's system instructions guide the process of selecting and executing a tool.
- Detailed walkthrough of the logic executed by the MCP server, including database queries and API interactions.
- Emphasis on how the MCP infrastructure automates complex logic, allowing for easy server creation and maintenance.
In this lesson, we dive into the lesser-known MCP (Model Context Protocol) primitives: resources and prompts. While tools are the primary focus of MCP servers, understanding the roles and functionalities of resources and prompts provides a more comprehensive grasp of MCP architecture.
- Overview of MCP server primitives: tools, resources, and prompts, highlighting their distinctions.
- Explanation of tools: model-controlled logic or functions akin to a post request in RESTful APIs, handling tasks like processing, database calls, and more.
- Insight into resources: application-controlled data, similar to get requests, providing additional context for LLM calls and examples of their use cases.
- Description of prompts: pre-crafted templates that facilitate specific LLM interactions, particularly useful in creating structured content like research reports.
- Discussion on why tools are predominantly used while resources and prompts are less common, with examples of applications and practical scenarios.
- Emphasis on the importance of tools in MCP servers while acknowledging the value of resources and prompts in achieving a complete understanding of MCP.
In this lesson, we delve into the distinctions between FastMCP and the low-level server class used for developing MCP servers. We clarify common confusions and illustrate why FastMCP is often the preferred choice for developers, thanks to its simplicity and efficiency.
- Overview of developing an MCP server using the Python SDK.
- Explanation of the two main abstractions: FastMCP and low-level server.
- Discussion on the complexities of the original low-level server implementation.
- Introduction to FastMCP as a higher-level abstraction that simplifies development.
- Analogy comparing FastMCP over the low-level server to Python over C/C++.
- Advantages of FastMCP: ease of use, active community support, and ongoing development.
- Step-by-step comparison of setting up a server using low-level vs. FastMCP.
- Emphasis on why developers should primarily use FastMCP for most functionalities.
In this lesson, we examine the differences between local and remote Model Context Protocols (MCPs), focusing on the use of Stdio and Streamable HTTP. We discuss the implications of the server's location, whether on the same machine as the client or remotely, and how this choice affects the protocol used for communication.
- Explanation of MCP architecture choices based on server location, either local or remote.
- Discussion on using Stdio for local server and client setups, highlighting its simplicity and benefits for local processes.
- Details on setting up local MCP servers using configuration scripts with commands to download, install, and run the server.
- Overview of HTTP protocol use for remote servers, including its benefits such as maintaining up-to-date code and reduced resource usage on local machines.
- Exploration of potential future trends towards online MCP applications and usage scenarios requiring remote server accessibility.
- Description of handling remote MCPs with alternative methods when direct support is lacking, emphasizing the use of MCP Remote.
In this lesson, we explore how to integrate an existing MCP Server into an MCP Client using a simple example involving Claude Desktop and Airbnb. We focus on establishing a solid foundation for connecting these components, which will be pivotal when building your own MCP servers and clients later in the course.
- Learn the steps to integrate an MCP server, specifically using the Airbnb server as a practical example.
- Use Claude Desktop to search for Airbnb listings, understanding the requirement of an MCP server connection.
- Access GitHub to find and utilize MCP scripts for official and community-maintained servers.
- Configure Claude Desktop settings to integrate the Airbnb MCP script, facilitating API access.
- Refresh Claude to apply changes, using task management tips for seamless operation on Mac and Windows.
- Execute search queries in Claude that utilize the newly installed Airbnb tools to demonstrate practical usage.
- Craft natural language queries to efficiently fetch Airbnb data while understanding the potential data interactions with third-party APIs.
In this lesson, we create a simple Model Context Protocol (MCP) server using Python. We guide you through the setup and development process, similar to a "hello world" exercise, to give you a foundational understanding of MCP server development.
- Ensure all necessary dependencies are installed, focusing on Node, Python, and particularly UV, which can often be tricky to set up.
- Choose your preferred IDE, although Visual Studio Code is recommended, and make sure your working directory is not a synced folder to avoid common errors.
- Use the UV package manager instead of PIP to initiate a new project, create a virtual environment, and install the MCP CLI dependency.
- Develop your MCP server by creating a new Python file named weather.py, where we import essential libraries like Fast MCP.
- Construct an MCP object and define a simple weather tool function using decorators to demonstrate how to interact with an MCP client.
- Execute the server and prepare it for integration with MCP clients, with further exploration in the next video.
In this lesson, we dive into the process of deploying an MCP server using Python. We detail how to activate and test the server using the MCP inspector before connecting it to various hosts or clients, such as Claude. This sets the groundwork for ensuring reliable server functionality across different platforms.
- Begin by deploying an MCP server on your local machine and learn how to run it using commands like 'uv run weather.py' or 'python weather.py.'
- Understand the importance of activating an MCP host or client to enable server interactions.
- Introduce the MCP inspector to test server functionality before broader deployment.
- Step-by-step tutorial on using MCP CLI commands to explore server resources and ensure connectivity.
- Detailed instructions on modifying MCP server settings in Claude and connecting it using a server JSON file.
- Explanation of directory path adjustments needed for successful deployment on different operating systems, particularly Windows.
- Demonstration of restarting the Claude application to verify server integration successfully.
- Practical example of using server tools such as 'get weather' to query information post-deployment.
In this lesson, we delve into the practical steps of connecting an MCP client to an MCP server through a simple "hello world" example. We focus on setting up a basic connection where the client lists and calls tools available on the server, demonstrating the foundational process of MCP client-server communication.
- Start with setting up a fresh environment in VS Code, initializing a virtual environment for better package management.
- Add necessary libraries such as MCCLI to facilitate MCP client-server interaction.
- Demonstrate creating a simple server script (weather.py) that includes a tool called getWeather, which returns predefined weather information.
- Outline the creation of client code in client.py, highlighting the use of MCP classes and features for seamless server connectivity.
- Explain the command structure needed for the client to correctly initiate the server using standard input/output parameters.
- Walk through defining and executing an asynchronous client session to perform tasks like initializing, listing, and calling server tools.
- Discuss the significance of async functions in managing asynchronous tasks and session management efficiently.
- Conclude with running the Python script to observe the client’s ability to connect, list available tools, and execute tasks, showcasing the utility of the MCP library in simplifying these processes.
In this lesson, we demonstrate how to connect an MCP client to an MCP server using NPX. We explore how easy it is to integrate different MCP servers into your client, using Airbnb as a practical example for searching properties without requiring API keys.
- Explanation of how the structure of client.py allows integration with various MCP servers, not just local ones.
- Introduction to using Airbnb's MCP server for property searches as a practical example.
- Step-by-step guide on locating and utilizing a list of available MCP servers.
- Instructions on copying and using specific NPX commands from GitHub to connect with an MCP server.
- Demonstration of running client.py to access tools like 'Airbnb search' and 'Airbnb listing' along with their input schemas.
- Troubleshooting common issues such as encountering a disabled path in Airbnb's robots.txt and solving it with additional arguments.
- Illustration of retrieving and handling extensive search results using JSON formatting.
- Discussion on the broader implications of using MCP clients and servers in developing AI agentic applications with tools like agents SDK.
In this lesson, we explore how to test and utilize an MCP server with local file functionalities. We demonstrate the process of setting up and running the server, interacting with local notes, and leveraging MCP to maintain and propagate information across different clients.
- Explanation of how to initiate and run the MCP server using mcp.run.
- Demonstration of using Claude to access and manipulate local notes.
- Instructions on granting permissions to read and write local files.
- Overview of storing information like favorite pizza toppings and tennis player names in notes.txt.
- Discussion on organizing notes by creating separate files with timestamps.
- Suggestions for enhancing file reading, such as creating a search index or vectorizing notes.
- Insight into the benefits of persisting memory across different MCP clients and LLMs.
- Preview of future modules that will showcase more advanced MCP server functionalities.
In this lesson, we explore how to test and utilize an MCP server with local file functionalities. We demonstrate the process of setting up and running the server, interacting with local notes, and leveraging MCP to maintain and propagate information across different clients.
- Explanation of how to initiate and run the MCP server using mcp.run.
- Demonstration of using Claude to access and manipulate local notes.
- Instructions on granting permissions to read and write local files.
- Overview of storing information like favorite pizza toppings and tennis player names in notes.txt.
- Discussion on organizing notes by creating separate files with timestamps.
- Suggestions for enhancing file reading, such as creating a search index or vectorizing notes.
- Insight into the benefits of persisting memory across different MCP clients and LLMs.
- Preview of future modules that will showcase more advanced MCP server functionalities.
In this lesson, we explore the innovative use of MCP servers for desktop automation tasks. We guide you through setting up an MCP server to capture desktop screenshots, demonstrating how to integrate Python scripts with MCP to interact dynamically with clients like Claude.
- Discusses how MCP servers can facilitate desktop automation by running Python scripts locally.
- Provides step-by-step instructions for creating a new MCP server and a Python file, screenshot.py, for the task.
- Introduces the PyAutoGUI library for taking screenshots and demonstrates its installation and setup.
- Explains the use of the IO library and the Image object from MCP server utilities for handling images.
- Highlights the process of writing a function to capture desktop screenshots and return them as images.
- Walks through testing the MCP server using the MCP inspector tool and troubleshooting connection issues.
- Demonstrates connecting the MCP server to an MCP client (Claude) to process and interpret screenshots.
- Emphasizes the versatility of MCP servers in handling various data types beyond text, such as images and potentially audio.
In this lesson, we delve into the use of MCP servers for making API calls, which is a fundamental aspect since the vast majority of MCP servers serve as API call wrappers. We explore the mechanics of how API calls operate from the server installed on a user's local machine and demonstrate this through a practical example involving cryptocurrency price queries.
- Explanation of why most MCP servers function as API call wrappers, emphasizing their prevalence.
- Discussion on how API calls from MCP servers occur on the local machine using STDIO transport.
- Introduction to streamable HTTP for conducting API calls from a server-based MCP server.
- Step-by-step creation of a sample MCP server named 'crypto.py' designed to retrieve cryptocurrency prices using the CoinGecko API.
- Implementation details including function edits, API URL setup, and parameter handling for cryptocurrency price retrieval.
- Instruction on importing libraries such as 'requests' necessary for making API requests.
- Demonstration of error handling and environment setup to ensure smooth API operations.
- Testing the server to validate its performance in retrieving prices and handling unexpected inputs gracefully.
- Installation and operational testing of the MCP server to check its functionality in obtaining and comparing cryptocurrency prices through multiple API calls.
In this lesson, we delve into the power of MCP servers to integrate various AI models, enabling enhanced functionality. We demonstrate how MCP can expand the capabilities of a primary model like Claude by leveraging the strengths of other models such as Perplexity for web search tasks.
- Discussion on how MCP servers enhance LLM capabilities by integrating various AI models.
- Example scenario illustrating the integration of Claude with Perplexity to overcome limitations in web search functionality.
- Step-by-step guide to obtaining an API key for Perplexity and setting up the MCP server.
- Detailed code walkthrough for creating a `web_search.py` server and implementing a function to perform web searches using Perplexity.
- Explanation of using OpenAI standards for API calls and configuring them to work with Perplexity’s base URL.
- Instructions on testing the web search functionality with real-world queries and addressing potential timeout issues.
- Final steps to integrate the web search server into an existing configuration for Claude, enhancing its capabilities with other AI models.
In this lesson, we delve into handling complex inputs with MCP servers using Python. We focus on creating custom schemas to facilitate MCP client-server communication, allowing for various input types, beyond simple strings or integers, to be processed effectively.
- Recap of MCP server tools and a transition into working with more complex input types.
- Introduction to the concept of custom schemas using the pedantic library in Python.
- Explanation of how pedantic supports schema and data validation.
- Detailed example using a custom schema for a 'person' object, demonstrating attributes like first name, last name, years of experience, and previous addresses.
- Step-by-step guide on implementing a function that utilizes the pedantic model to input complex data into an MCP server.
- Discussion on the importance of detailed doc strings for MCP tools, aiding large language models (LLMs) in understanding data structure.
- Demonstration of logging a 'person' object to a database and verifying the input using the MCP client-server setup.
In this lesson, we delve into the versatile primitives of MCP servers beyond the commonly used tools, focusing on prompts and resources. We explore how these elements can enhance the interaction between MCP clients and servers, and discuss their potential applications and limitations.
- Explore MCP server primitives beyond tools, particularly prompts and resources.
- Understand prompts as predefined templates guiding language model interactions.
- Learn how resources provide structured data or content for additional context.
- Discuss the potential and limitations of prompts and resources versus tools.
- Review different MCP clients and their capabilities, focusing on those utilizing resources and prompts.
- Get step-by-step guidance on setting up Klein in VS Code for accessing MCP server features.
- Briefly introduce upcoming topics like authorization and handling complex inputs.
In this lesson, we dive deep into creating an MCP server with a focus on implementing prompts. We guide you through setting up an MCP environment, writing a functional prompt in Python, and integrating it with MCP clients to generate dynamic user interactions.
- Begin by setting up a clean working environment using a virtual environment and MCP CLI.
- Create a new MCP server in Python, initializing it with proper imports and configurations.
- Define and implement a function for prompts, ensuring it returns a string and adheres to MCP specifications.
- Explore how to test the prompt through terminal commands and MCP inspector, observing responses for various inputs.
- Discover how MCP clients and hosts process and interpret prompts, including integration with tools like CLAWD.
- Learn the dynamic potential of prompts, including using API calls for updated content and specialized applications.
- Walkthrough of practical examples for creating detailed reports with custom user input, showcasing flexible use cases for MCP servers.
In this lesson, we delve into the concept of resources in the Model Context Protocol (MCP) and how they differ from tools. We explore how resources serve as a standardized way for MCP clients to retrieve data. Two examples, Anthropic and Klein, are used to demonstrate the varied methods of handling resources, highlighting differences in implementation.
- Explanation of resources as data retrieval mechanisms distinct from tools, which are used for processing or API calls.
- Discussion on the variability of handling resources by different MCP clients and hosts. Some clients may choose to engage with resources differently or not at all.
- Overview of URI-based addressing for resources to provide structured and unique identifiers similar to file storage paths.
- Practical example using Python to create an MCP server that includes a resource returning an inventory overview.
- Demonstration of how resources can be added explicitly to context in Anthropic, while Klein processes them during runtime based on user queries.
- Preparation for the next lesson where we will explore using resources to get data with input parameters, such as fetching prices based on inventory ID.
In this lesson, we delve into the concept of resources with inputs in the Model Context Protocol (MCP). We demonstrate how to create dynamic resources capable of accepting inputs, focusing on mapping inventory data to retrieve prices and IDs. This process highlights the potential of custom URIs and how they enhance data retrieval.
- Creating a simple in-memory database using dictionaries for inventory mapping.
- Developing functions to fetch inventory price using an inventory ID and vice versa.
- Exploring the concept of dynamic URIs that adapt based on input, contrasting with static URIs.
- Understanding the difference between resources and resource templates, particularly in the context of input requirements.
- Demonstrating the use of the Klein tool to test resource functionality and resolve inventory queries interactively.
- Discussing the benefits and future potential of resources in MCP, such as automatic updates and integration with AI models.
- Tips on using MCP clients to efficiently list and access resources, adding robustness to Python applications.
In this lesson, we explore the process of deploying MCP servers, focusing initially on distributing them for local installation. We discuss methods of packaging MCP servers for easier access and installation by clients, highlighting both the benefits and challenges associated with different deployment strategies.
- Discussion on the importance of distributing MCP servers for local installation.
- Overview of packaging options: using a system that allows MCP clients to download, install, and run the server.
- Explanation of running MCP servers on virtual machines, allowing direct client connections via streamable HTTP.
- Exploration of community examples from the MCP GitHub page, showcasing various company implementations.
- Detailed instructions on using NPX and alternative package managers for deploying servers not built with JavaScript or Node.js.
- Introduction to PIP and UVX as alternatives for Python-based MCP servers.
- Examination of diverse deployment strategies based on server language and usage requirements.
- Practical demonstration of creating and sharing a special command string for installation using different package managers.
In this lesson, we guide you through the process of creating and packaging an MCP server in Python. We cover the essential steps from server creation to deployment using GitHub as a package manager, making it accessible for users to install and run locally.
- Begin by creating a new MCP server in a blank directory and open the terminal.
- Use `uv init` to set up a new project and create a virtual environment for dependency management.
- Add `mcp-cli` library to the project and configure files needed for packaging.
- Set up the project directory with a `pyproject.toml` for build and installation configurations.
- Organize your code with an `src` folder structure, including necessary files like `__init__.py`, `__main__.py`, and `deployment.py`.
- Develop the server logic; a basic example provided is an addition tool to demonstrate functionality.
- Explain how to run your MCP server through an entry point in `__main__.py`.
- Detail the configuration in `pyproject.toml` for directing the package manager on building and deploying.
- Conclude with instructions on packaging and making the server publicly available on GitHub for easy access and download.
In this lesson, we focus on deploying an MCP Server to a package manager using GitHub. We cover the necessary setup and the step-by-step process to make your server accessible for public download, ensuring that anyone can install and run it from anywhere with internet access.
- Set up a GitHub account and ensure Git CLI is installed on your system.
- Prepare the MCP server by ensuring it runs locally and resolves dependencies.
- Use GitHub Copilot in VS Code to automate repository creation and file uploads.
- Create a GitHub repository without initializing with a README to make it publicly accessible.
- Link your local project with the GitHub repo to push your code online.
- Demonstrate how to run the MCP server from any computer using the UVX command.
- Explain the process of editing configurations in Anthropic to automate server deployment.
- Highlight the convenience of running the server globally, provided internet access and UV command availability.
In this lesson, we delve into the concept of streamable HTTP transports for MCP servers. We explore how hosting MCP servers on a virtual machine allows multiple clients to connect without the need for local installations, revolutionizing how MCP servers and clients interact.
- Introduction to local MCP server operations and their limitations.
- Overview of the need for local MCP clients when using traditional STDIO transport.
- Explanation of streamable HTTP transports enabling remote MCP server access.
- Discussion on the replacement of HTTP SSE with more flexible streamable HTTP transport.
- Comparison between STDIO and streamable HTTP methods.
- Examination of how streamable HTTP allows for independent server operation and multiple client connections via HTTP requests.
- Insights into the potential industry shift towards streamable HTTP-supported MCP servers.
- Practical steps on creating and deploying an MCP server using streamable HTTP transport.
In this lesson, we set up an MCP server capable of handling streamable HTTP transports on a virtual machine. We guide you through the process of transitioning from STDIO to streamable HTTP, providing a practical demonstration.
- Begin by creating and activating a new virtual environment.
- Install the MCP CLI library to facilitate your server setup.
- Develop a simple MCP server script using Python, focusing on instantiating the FastMCP class.
- Learn the specifics of changing the server transport from STDIO to streamable HTTP using configuration options.
- Test the server using different terminal windows and explore how the server runs on a specified IP address and port.
- Understand how to configure the server to run on different hosts and ports if the default settings are not suitable.
- Discuss the significance of deploying the server onto a virtual machine or cloud service, enabling broader accessibility for clients.
- Highlight the current limitations regarding streamable HTTP support in some MCP clients, like CLAWD, and hint at the workaround provided in the next lesson.
In this lesson, we learn how to connect an MCP client to a streamable HTTP MCP server. We address the common issue of MCP clients lacking support for streamable HTTP and provide a solution using a specific package, allowing smooth connectivity to remote servers.
- Explanation of the current limitation where MCP clients, such as Claude, do not support streamable HTTP natively.
- Introduction to the MCP-remote package from NPM, which enables connectivity between local MCP clients and remote servers.
- Step-by-step instructions on using the MCP-remote package with the `npx` command and necessary arguments, including server URL and optional HTTP allowance.
- Demonstration of configuring the Claude MCP client, updating the config JSON file with the server details, and running the setup.
- Validation of a successful connection by sending a message to the server and reviewing the response.
- Brief look forward to the next steps, which involve shifting the server from local to an online virtual machine to facilitate global accessibility.
In this lesson, we delve into deploying an MCP server onto a virtual machine. We guide learners through creating a virtual machine using Azure, setting up the server environment, and ensuring seamless connectivity to their application.
- Setting up a virtual machine on Azure, including account creation and virtual machine configuration.
- Discussion on choosing the right Linux distribution and virtual machine size to optimize cost.
- Instructions on setting up authentication using SSH public keys.
- Steps to enable necessary ports for HTTP and HTTPS connections.
- Guidance on Git operations to transfer code from local to server, utilizing GitHub and Git clone.
- Connecting to the virtual machine via SSH from different operating systems.
- Installing necessary server dependencies not present on the new machine.
- Running the MCP server and ensuring that local machines can connect to it successfully.
In this lesson, we focus on connecting a locally installed MCP client to an MCP server using streamable HTTP transport on a separate virtual machine. We demonstrate how to verify the server's operation and successfully establish a connection, allowing for remote interactions with the server.
- Ensure the MCP server is running on a virtual machine and verify its status by checking the core's host and port configuration.
- Utilize an MCP inspector to connect to the server; access it via MCP dev and configure the local browser with the server's host and port.
- Update the URI with the virtual machine's address, maintaining the port number, and append the "/MCP" for connections.
- Establish the connection and perform actions such as listing tools and sending greetings, validating server functionality.
- Discuss the advantages of hosting an MCP server on a virtual machine, especially for serving multiple clients without local processing constraints.
- Highlight the importance of testing connectivity both through an MCP inspector and actual client applications.
In this lesson, we delve into connecting an MCP client to an MCP server using the streamable HTTP protocol. We demonstrate two approaches to establishing this connection, highlighting the benefits and challenges of each.
- Explanation of connecting MCP clients to servers through streamable HTTP on a virtual machine.
- Use of Anthropic Cloud for connecting despite lacking direct support for streamable HTTP by employing an MCP remote workaround.
- Detailed setup for ensuring correct server connectivity, including configuring IP addresses and necessary file adjustments.
- Exploration of using VS Code with GitHub Copilot as an MCP client supporting streamable HTTP natively.
- Step-by-step guide to adding MCP servers in VS Code using simple configuration settings.
- Comparison between workaround methods and native support for streamable HTTP with insights on real-world applications.
- Discussion of the significance and growing importance of streamable HTTP for hosting and client connectivity.
- Identification and explanation of potential bugs with streamable HTTP setups, emphasizing the importance of correct configuration details.
In this lesson, we dive into the specifics of MCP clients within the Model Context Protocol framework. We discuss how MCP clients facilitate connections to MCP servers, the intricacies behind these interactions, and when knowledge of this process is essential for developers.
- Overview of MCP clients and their role in connecting to MCP servers, contrasting with the previously discussed MCP servers.
- Explanation of why MCP client details are often abstracted by MCP hosts and various development frameworks.
- Discussion on scenarios when understanding direct MCP client-server connections is necessary, especially in building custom applications without existing frameworks.
- Introduction to the functions and requests available to MCP clients for server interaction.
- Clarification on when learning about MCP clients is beneficial or necessary, particularly for developing applications from scratch with minimal framework support.
In this lesson, we explore the intricacies of the MCP Client session class. We begin by examining the Python SDK on GitHub, focusing on the session.py file, which is crucial for creating an MCP client. The lesson emphasizes connecting to a server using this class and highlights various functionalities available within a client session.
- Introduction to the session.py file in the Python SDK as the foundation for creating an MCP client.
- Explanation of initializing a client session by entering server details, similar to those in a config.json file.
- Overview of the initialization process, including establishing a server connection.
- Details on performing actions post-initialization, such as sending a ping to confirm the connection and listing available resources and resource templates.
- Discussion on additional functionalities: reading resources, subscribing to them, and calling tools from an MCP server.
- Mention of JSON RPC as the underlying protocol, but noting that using the SDK simplifies complexity via pre-built functions.
- Step-by-step guide to setting up a project in VS Code for creating and utilizing an MCP client.
In this lesson, we dive into the practical steps of setting up and using MCP clients to communicate with MCP servers. We work through initializing projects, setting up environments, and performing basic server interactions, such as listing and calling tools, using asynchronous programming in Python.
- Begin by opening a terminal, initializing a new UV project, and setting up a virtual environment.
- Add the `mTPCli` package and create a new file named `client_simple.py` for a simple client setup.
- Import necessary classes like `client session` and `stdio client`.
- Create server parameter objects using `stdio server parameters` for local servers.
- Implement asynchronous functions using Python's `asyncio` library for running async processes.
- Instantiate a new client session and connect to the server with provided server parameters.
- Initialize the client session to ensure an active server connection.
- Use functions to list available server tools and wrap up the script with try-catch blocks for error handling.
- Demonstrations include running the client script and successfully listing tools, despite possible server closing errors.
- Explore calling a specific tool using the `session.call_tool` function, with a focus on providing necessary arguments and understanding tool schemas.
In this lesson, we dive into how MCP clients can list and interact with resources on MCP servers. We learn through practical examples how to create a server with various tools, resources, and prompts, enabling us to effectively call and manage these resources.
- Introduction to creating an MCP server to host tools, resources, and prompts.
- Demonstration of listing and calling resources using a Python-based MCP client.
- Step-by-step guide to writing a server script (`server.py`) with functionality such as a weather tool and prompts.
- Explanation of resource and parameter management on the server, showcasing dynamic responses based on input.
- Illustration of using the MCP client inspector to verify server interactions and debug any connection issues.
- Instructions on setting up directories correctly and ensuring compatibility across different operating systems.
- Overview of asynchronous function calls and the importance of using `await` for proper execution.
- Testing connectivity and functionality through a series of example commands and expected outputs.
In this lesson, we explore how to list and call prompts from MCP clients to MCP servers within a Python environment. We guide you through the process of utilizing available functions for managing client prompts and delve into methods for dynamically interacting with these elements to enhance server-client communication.
- Introduction to interacting with prompts in MCP, focusing on listing and calling functionality.
- Exploration of the Python codebase to derive necessary functions for prompt interaction, particularly list prompts and get prompt.
- Step-by-step guide on modifying code to list client prompts and retrieve a specific prompt using session functions.
- Demonstration of how to expose available prompts to users and how they can use them after connecting to servers.
- Overview of creating a simple client that connects to a server, lists tools, resources, and prompts, and performs callable actions.
- Discussion on the limitations of hard-coded solutions and the next steps towards allowing an LLM to dynamically determine tool calls and arguments in future lessons.
In this lesson, we delve into building an MCP host that utilizes an MCP client alongside large language models (LLMs) to answer user queries. We explore a process where user questions are read, tools are called with constructed arguments, and the results are processed to provide an answer. This lesson takes a significant step forward in developing agentic applications with MCP clients.
- Start by setting up the environment in VS Code, creating a new file, and preparing the code.
- Install necessary libraries and ensure your environment includes the OpenAI API, managing API keys securely.
- Initialize a server to run the MCP client queries involving LLMs, emphasizing the integration with OpenAI's API.
- Break down the code execution with the use of breakpoints to understand initialization and tool listing processes.
- Transform tool data from MCP server to OpenAI API-compatible formats by renaming and reclassifying fields.
- Create messages for the LLM to clarify user queries and interact with the OpenAI client's response system.
- Debug and carefully examine each variable and process step, ensuring correct integration of LLMs with MCP clients.
In this lesson, we delve into the process of handling queries in MCP clients, specifically focusing on the interaction between MCP servers and language learning models (LLMs). We explore how LLMs assist in determining which tools to call within the system, showcasing the integration of LLMs in practical application scenarios.
- Overview of retrieving and processing responses from LLMs.
- Explanation of how LLMs can provide multiple choices, with a focus on tool calls.
- Insight into how LLMs use the user's query to determine and construct necessary arguments for tool functions.
- Discussion on the role of LLMs in delegating tool calls and the MCP client's role in executing them.
- Demonstration of converting JSON strings to dictionaries for argument processing.
- Illustration of tracking tool execution results and updating messages for LLM reference.
- Exploration of how an LLM completes the user query by integrating tool results.
- Preparation for developing a comprehensive chatbot using multiple MCP servers and tools, emphasizing a back-and-forth interaction model.
In this lesson, we dive into creating an MCP server called Memory Tracker. We explore how this server can enhance your interactions with MCP hosts by saving and retrieving memories. This practical example demonstrates advanced concepts like Retrieval Augmented Generation (RAG) and utilizing OpenAI's API for efficient data handling.
- Overview of building an MCP server named Memory Tracker, focusing on tracking interactions and saving memories for later retrieval.
- Explanation of concept RAG (Retrieval Augmented Generation) and its application in organizing interactions for better accessibility.
- Step-by-step guide to setting up a virtual environment and incorporating essential libraries such as MCP CLI and OpenAI.
- Instructions on managing environment variables securely, emphasizing the importance of keeping API keys private.
- Implementation details on creating tools to save and search memories, utilizing OpenAI's API for semantic searches over keyword searches.
- Discussion on vector stores for efficient data storage, integrating vectors seamlessly into the retrieval process.
- Debugging tips and troubleshooting insights for common errors encountered during the setup and execution of MCP servers.
In this lesson, we delve into the practical implementation of an MCP Server focusing on memory tracking functionality. We demonstrate the creation and searching of vector stores using the OpenAI API alongside Pythonic programming methods for building and testing an MCP server effectively.
- Demonstration of how to create a vector store using the OpenAI API.
- Explanation of searching capabilities through vector stores using client.vectorstores.search.
- Creation of a search_memory function to retrieve and process results.
- Use of Pythonic programming to stitch content from search results into a single string.
- Testing the MCP server functionality by saving and querying memories.
- Instructions on deploying the server locally for testing and potentially publishing it to a server or virtual machine.
- Example workflows using Claude and VS Code to save and utilize memories creatively.
- Illustration of integrating memories with other tools like Google Maps API for generating practical applications.
In this lesson, we create an MCP server that interacts with chess.com stats, turning it into a powerful interface accessible through MCP clients. We demonstrate setting up the server so it can answer queries like a player’s rating or recent game history. By leveraging the existing chess.com API, we simplify the integration process using Python libraries.
- Introduction to creating an MCP server using chess.com’s API for fetching chess statistics.
- Explanation of setting up a Python virtual environment and installing necessary libraries such as MCP and requests.
- Process of structuring a Python project with folders and files, including creating `chessapi.py` and `server.py`.
- Demonstration of making HTTP GET requests to fetch player profiles and stats from chess.com API.
- Utilization of headers to mimic typical user agents for successful API requests.
- Setting up MCP functions in `server.py` to handle API data retrieval and passing results to clients.
- Instructions on preparing the project for distribution via GitHub, emphasizing build scripts and project configuration.
- Testing the server locally and preparing it for wider use, ensuring compatibility with package managers and client configurations.
In this lesson, we focus on publishing an MCP server to a package manager or GitHub, allowing users worldwide to install it with minimal JSON code. We leverage Copilot to automate the creation and management of the repository, ensuring a seamless upload process and guiding users through installation steps.
- Demonstrating the use of Copilot to automate git repository creation, adding and committing files, and pushing to a remote repository.
- Step-by-step guide to creating a new GitHub repository and making it public for wider accessibility.
- Instructions on crafting a detailed README file to aid users in installing the server using JSON configuration.
- Explanation of the installation process using UVX and the necessary GitHub repository URL for downloading and setting up the MCP server.
- Finalizing the server setup by revising configurations to ensure the service is correctly named and accessible globally for chess-related interactions.
What makes this course different than others?
Complete Guide: this is not a bootcamp or "crash" course - this is the only complete guide that takes you from knowing nothing about MCPs, to understanding the architecture and protocol, to an MCP expert building MCP Servers and Clients. You get ~8 hours of content!
Focus on Python: the SDK we use here is completely in Python (instead of Javascript or Typescript). However, since all the SDKs are similar, what you learn here will be applicable to all SDKs.
Up to date: this course incorporates all the latest updates and technologies, including the new Streamable HTTP transport
From Theory to Build: this course starts on the theory and architecture behind MCPs, why they exist, how they work, their history so that you get a solid understanding. After that, we focus on the features around MCP Servers and Clients and applying it as we build with MCP
MCP Servers and Clients: this course builds both MCP servers and clients (most content just stops at servers)
Build 4+ MCP Servers and Clients: we build several MCP servers and clients from scratch
MCPs are taking over the world because they solve a critical problem. LLM applications are great at generating content but they lack taking action. Tools and Function Calling were meant to address this, but LLM frameworks apply this differently and many developers had to "reinvent the wheel" every single time they started building an LLM application.
Consensus was needed and MCP was born.
Since then, MCP has taken off, being adopted fully by Microsoft, OpenAI, Anthropic, and so much more. Thousands of companies have built their own MCP servers, and tens of thousands of developers have built MCP servers that interact with an API or compute some process locally. In fact, MCP was one of the highest search terms in Q1-Q2 2025 (after AI Agents).
This course is all about taking you from knowing nothing about MCPs to becoming an MCP master. By the end of this course, you will be able to build your own MCP Servers and Clients from scratch, deploy them locally or on a virtual machine, distribute them using GitHub or NPM, and learn / master all of MCPs architecture and features.
Note that we focus on the Python SDK when building MCP Servers and Clients.
What's MCP?
MCP is a standardized mechanism (i.e., protocol) for AI systems (like LLMs, agents, etc.) to interact with external systems (like APIs, tool logic, local processes, etc.). Think of it as a universal USB-C connector for AI systems and everything that needs to connect to AI systems.
Why MCP?
One word: standardization. Once you build an MCP Server, it can easily connect to thousands of different applications / LLMs / Agents that contain an MCP Client. Similarly, if you build an MCP Client, it can easily connect to tens of thousands of MCP Servers.
What is this course all about?
This course has one goal - to taking you from knowing nothing about MCPs to becoming an MCP master. Ultimately, this means going through MCPs vast set of features and learning how to apply them into your own applications. We will build MCP Servers and Clients from scratch and deploy / distribute them both locally and remotely.
This course is hands-on, practical, and tailored for enthusiasts / developers seeking how to build real-world MCP Servers and MCP Clients. Note that the SDK we use is Python in Windows/Mac and the MCP Hosts we use in this course are VS Code and Anthropic Claude.
What will you learn?
Understand MCP architecture - learn how MCP Clients and MCP Servers interact with each other in detail
Learn, master, and apply all MCP features - deep dive into all of MCP features, including tools, resources, prompts, transport protocol, STDIO, streamable https, and so much more
Build MCP Servers and Clients - build several real-world practical MCP Servers and Clients from scratch, and combine them with LLMs to create powerful LLM applications
Publish, and host your own MCP Server or MCP Client - distribute and publish your own MCP Servers and MCP Clients
Why choose this course?
Complete guide - this is the 100% start to finish, zero to hero, basic to advanced guide on building MCP Servers and Clients. There is no other course like it that teaches you everything from start to finish. It contains ~8 hours of instructional content!
Structured to succeed - this course is structured to help you succeed by learning the theory and actually applying it. We also focus on both architecture, servers, clients, and deployment.
Fully instructional - we not only go through important concepts, but also apply them as we are building our application so that we can solidify them. This is not only a walkthrough of the all the features and theoretical concepts, but a course that actually uses real-life examples and integrations
Step by step - we go through every single concept one-by-one. This improves your probabilities of learning MCP rather than going haphazardly through each feature
Teacher response - if there's anything else you would like to learn, or if there's something you cannot figure out, I'm here for you! Look at the ways to reach out video
Resources - you get access to all the code and slides in this course, plus several notes and guides
Course Overview
MCP Introduction – Understand why MCP exists, its origins, what it enables, and a breakdown of the full course roadmap.
MCP Architecture Overview – Dive into how MCP works with agents and LLMs, the client-server workflow, server primitives like resources/prompts, and the difference between FastMCP, Stdio, and Streamable HTTP setups.
MCP Environment Setup – Get your local development environment ready with Claude, Python, Git, and VS Code, and access key course resources.
MCP Quickstart – Build your first working MCP system (both Server and Client) with Claude and a simple tool (like an Airbnb example), covering both local and NPX-based setups.
MCP Server Deep Dive - Tools – Learn how MCP servers interact with your local files, APIs, external models, and how to structure more complex inputs.
MCP Server Deep Dive - Resources and Prompts – Explore how to expose reusable resources and prompts from your MCP server, and how to structure them for input-output handling.
MCP Server Deep Dive - Deployment and Publishing – Package your MCP server for reuse and publish it to platforms like GitHub to share or deploy in real-world scenarios.
MCP Server Deep Dive - STDIO vs. Streamable HTTP – Understand remote server options, how to build and host Streamable HTTP servers, and connect clients using MCP Inspector and virtual machines.
MCP Client Deep Dive – Go under the hood of MCP Clients, how they manage sessions, call tools/resources/prompts, and integrate with LLMs for full processing flows.
MCP End-to-End Builds – Build real-world projects like a memory tracker and chess stats server, and create MCP Clients that connect to multiple servers.
MCP Conclusion and Certificate – Wrap up your MCP journey, celebrate your accomplishment, and learn how to access your course certificate.