Model Context Protocol (MCP): Everything You Need To Know
Skills:
LLM Foundations80%
Key Takeaways
The video introduces the Model Context Protocol (MCP) and its applications, including setting up an MCP server in Python and integrating it with Claude Desktop and cursor functionality.
Full Transcript
What is going on guys? Welcome back. In this video today, we're going to talk about the model context protocol short MCP that everyone's talking about right now. I want to cover what it is, why it's important, why it's useful, why it could be a gamecher, and basically I want to give you one video that teaches you everything you need to know about it. So, let us get right into it. It's not a game, it's a red. [Music] All right, so everybody's talking about MCP, the model context protocol. And in this video today, I want to give you one short video that explains everything you need to know about it. So what it is, why it's relevant, why it can be a gamecher, and also I want to show you how you can build your own MCP server in Python and how you can use various MCP servers in cloud desktop and also in cursor. So let's get started right away. What is MCP? MCP as I said stands for model context protocol. And that's the important thing. It's a protocol. It's not some new fancy technology with a bunch of features. It's not a new model. It's not a new platform. It is a protocol which standardizes communication between MCP clients and MCP servers. Now what are MCP clients and servers? We're going to talk about this here in a second, but the basic idea is that the whole use case or the whole purpose of MCP is to standardize communication when it comes to LLMs interacting with resources and with tools. That is what MCP is all about. Now, I think most of you guys know that most LLMs can use tools. So, Claude or GPT or Gemini have access to tools and tools are essentially just functions that you specify the signature of. So you say this is my function I don't know get to-do or create to-do and it has these parameters and you can call this function to create a to-do or to list all the to-dos and so on. So you specify here are a bunch of functions that you can use and the LM then knows okay if I want to do that I have the opportunity or I have the option to do that uh by calling this function. So if the user says create a to-do I have the capability to do that by calling this function. Here's how I call that function. So I can make a function call, I can use the tool. So tool using, tool calling, function calling. Uh there are different names for this concept, but it's essentially that. Now what MCP does is it standardizes the communication in order to do that. So instead of having a bunch of different tools that all have their different APIs, they all have their different ways of calling them and using them and maybe they change over time. What we have now is we have standardized communication using this protocol. And we have these different servers here, these MCP servers that all work in the same way. We have an MCP client that speaks the exact same language. And behind the scenes, you can have whatever you want, data sources, other APIs, other tools, whatever. They can have whatever interface they want as long as you put some MCP server in front of them so that the LLM can communicate with this MCP server. So a good analogy would be to think about the client as a client that speaks one language, the most important language, the MCP language. And then you have all these different data sources and services and tools that speak German, Spanish, Chinese, whatever. And then you have these translators that translate whatever language to the target language, the MCP language. they serve as translators and the client doesn't have to bother uh dealing with all the different languages with all the different interfaces and APIs and so on. It just has to speak MCP and then it can do whatever it wants to. And this is now a gamecher because it allows for easy tool creation uh for MCP clients. And MCP clients can be something you write yourself. So you can write your own tool in Python for example. You can use IDEs. Cursor is also an MCP client or has an MCP client. Uh cloud desktop also supports MCP servers. And I'm going to show you in this video how easily you can set all of this up. And for this we're going to start with cloud desktop. Now, Claude Desktop is available for Windows and Mac. Since I'm on Linux, I have to use this workaround here, this GitHub repository, Claude Desktop Debian. You will find a link to it in the description down below. All you have to do basically here is go to the releases page and just install the dev package. Not too difficult, but still, I don't understand why they don't just publish a version for Linux since this is an Electron app and it's super easy to port. But this is actually a reason why I cancelled my cloud subscription just because this is really ridiculous. Yeah, whatever. So, get cloud desktop onto your system. And then all we have to do is we have to locate the config file. So, you can go to the documentation to see where the config file is located depending on your operating system. On Mac, it's here. On Windows, it's here. And on Linux, it's inconfig. And then clot. And here we have this uh claw desktop config.json. By default it's empty. And now what we're going to do is I'm going to move that. I'm going to move that. And here now we're going to run clot desktop. And we're going to see that we don't have tool use available. So if I say something like create a new to-do, please uh shopping for example, maybe it's going to give me some response. Maybe it's going to pretend like it's it knows uh what it does here in this case. Now, it creates some markdown, I guess, with some to-do list that I didn't ask for, with a lot of stuff that I didn't ask for. But yeah, basically does anything. It doesn't use any tools. So, right now, this doesn't have the capability to use tools. So, what we're going to do now is we're going to add tools or MCP servers to this configuration. And a cool thing about a standardized protocol is that since everybody uses the same language, it's very easy to just plug and play different features into this config file. Now, so let me move this for a second to my other screen and let's get back to this one here. There is a repository on GitHub from model context protocol uh called servers. And in servers, you can find already existing MCP servers that you can easily just add to your application. For example, one would be here file system which means that we can do file operations or um stuff on our disk using this tool. So we can provide access to this tool to cloud desktop and then it can do stuff like create files and delete files and read files and so on. And uh that is one example of something. Then we also have git. We have stuff like postgress. We have stuff like SQLite that allow all for different features to be used by cloud desktop. Let me give you an example or let me show you an example. Here we go to file system and all I have to do to use it is I have to just copy and paste the configuration. So here now I'm going to use npx. I'm going to just copy paste this um and I'm going to go back to my config file. I'm going to replace all of this with this configuration. So now what we have here is we have an MCP server called file system that uses the command npx. Of course, for this you need to have npx installed. So you need to have node running and everything. Make sure that you have the commands that you're using installed on your system. But you have to use npx-y model context protocol server file system. Um now in this case I need to also specify the directories that I want to allow access to. So these are just some default placeholders. I'm going to go with home neural 9 uh desktop and then um what did I call it sandbox mcp and that is one directory and then I'm going to go with another one which is home neural 9 documents sandbox mcp. So these two directories are the ones that I want to allow access to. And now I'm going to just save this. I'm going to close this and I'm going to restart the clot desktop. And this tool is now integrated or this tool. As you can see now I have this hammer icon here. 11 tools are available to claude desktop here based on MCP. So I can click on them to see them. I can see what it can do. Now I can see all the supported methods and their description. And now I can just go ahead and say uh read the content of the hello world txt file in my desktop sandbox. So in my desktop sandbox, maybe I can show you that as well. Um if I go to desktop and I go to uh the sandbox, I have a file here called hello world txt which basically just have some uh Lauram ipsom text here. Now it asks me here do I want to allow the tool from file system. I say allow for this chat which basically means I allow it to rerun this all the time here without confirmation. The first thing it did is it listed allowed directories. So it wanted to see okay what directories do I have access to. Now it asks me to run um list directory from file system. So to see the content you can see here it lists the content of this path. I allow this as well. And then finally it's probably going to read the files. So it's going to ask me one more time here read file from file system. It tries to read the content of this file allow for this chat and then I get the content displayed here. So it connected to this MCP server and it used the capabilities of listing the allowed directories, listing the content of these directories and then reading the content of the files. So I can also do stuff like create a new file in the same directory called test.txt and fill it with ABC or with the with the alphabet. Uh first in uppercase then in lower case I don't know just some random stuff here. So now it's going to try to ask for a new feature which is create a file or write file. I allow this as well. And you can see now it creates a new file. And if I go now again to my desktop to the sandbox and I see the content of test .txt, you can see I have the alphabet here in this file. So this is a basic example. We can do that now with all sorts of tools. So I can actually let me close this again. For example, I can go back to servers and I can go to SQLite now and I can copy and add this MCP server as well. Now the important thing is this time we don't want to copy the full thing because we already have a servers uh key. We only want to add this to our existing configuration. So I'm going to go back here to uh config and then to clot and then I'm going to open the clot desktop config JSON and now I'm going to just copy the SQLite part here. I'm going to copy this and paste it after the server. Now I need to adjust a couple of things here or actually just one thing and this is right now what it tries to do is it tries to run UV which is u the rust based or the python package manager implemented in rust. Um and what it tries to do is it tries to call uv run on the mcp server SQLite and it assumes I have the repository here on disk. This is not the case. So what I actually want to do is I just want to say uvx. So, I'm going to use UV tool and I'm going to use that MCP server SQLite uh right away. So, I'm going to use it with UVX, not with UV. I'm going to remove all of that. And this is going to create a test database. Actually, let's go and call this I don't know uh because I already have a test DB. Let's say MCP test DB. Write this. Close this. And move this. Then open up Claude Desktop again. And now we should have an additional tool. Now you can see we have 17 here, not 11 anymore. And we also have database features. So I can say now uh show me all the tables in the database. So it asks here for permission to run list tables from SQLite. Allow for this check. And it's going to probably tell me now that nothing is in the database. There are no tables in the database. Great. So now let's say create a person table with ID, name, age and job. So now allow you can also of course every time see what it exactly tries to do. So you have to confirm that. And then I say uh populate it with 10 rows of sample data for testing. Then it's going to generate a query and execute it right away. You can see here we have the different people and then allow for this chat and every time you use the same function by the way it's going to um to now allow it. So write query is also used for deletion. So let's say first of all uh show all people from the table. This probably is going to request new permissions. But if I try then to write again by deleting a person, it's going to just allow me to do that because I already used the right query method. So I can say for example, delete the entry for Robert. And then you can see it does that right away. So it doesn't ask for permission anymore because it uses something that I already allowed for this chat. All right. So that's the easy integration here into Claw Desktop. Now what's important is this is not the only source that you can get servers from. This is just the official repository from model context protocol. There's also here from tensor block awesome MCP servers where you have a bunch of different servers for all sorts of things. Uh you also have Docker and you have EngineX and you have all the different tools that are out there that they have MCP servers here and also you have this model context protocol registry smiththery where you can just easily uh look for servers and then just add them easily to your config. Super super useful. That is the power of a standardized protocol. Everyone starts developing. Everything is plugandplay. Everything is easy. That is why MCP is so much uh or hyped so much because people can now easily develop servers and you can easily add them to your clients. So speaking of that, I want to show you how you can build your own MCP server. However, I'm not going to write out the code here because I don't want to bore you with a coding uh session here. So what we're going to do is we're going to jump to our current working dire current working directory here. Uh I'm going to create a main or actually let's use UV. We are in 2025 after all. UV in it. uh my-mcp-server and uh now I'm going to go into that. I'm going to say uvat and we want to add the following two dependencies. So this is also if you're not using uvp pip install uh mcp and then in square bracket cli and then also piantic. This is going to install everything we need. Then we're going to go into the main file here. I'm going to remove all of this. And now we're going to start with the imports. We're going to need the following imports. We're going to import from UU ID UU ID4. So we're just going to generate string ids. We're going to import from typing list for pyantic. Uh from pyantic we're going to import base model and field. And then here this is new from MCP server. Fast MCP. We're going to import fast MCP which is uh yeah a little bit like fast API but fast MCP. Essentially we're going to define some data models here. The important thing is we're going to define a we're going to build an MCP server for a sample to-do application, but we're going to keep everything in memory here. So, I'm going to say to-do or to-dos is equal to an empty dictionary. Then, we're going to define a couple of basic pyantic uh schemas or models. So, to-do, create to-do, update to-do, get to-do input, delete to-do input. Now the new thing which is um something specific to MCP is we define a server like this. So we say server is equal to fast MCP name to do server version is 1.00. This is exactly the syntax that you would use with fast API. So basically if you know how to work with fast API you know how to work with fast MCP. And then what you can do is you can just create tools. How do you do that? I'm going to copy paste that here as well to show you how this is done. Basically we have server. So again same as fast API add server but this time we don't do get post or something like this or route like in different frameworks. We use server tool and we say the tool is create to-do. The description is create a new to-do and then we just create a new to-do. That's basically it. And then we have the different list. Get update. The code is not that difficult. I'm going to provide a link to my GitHub in the description down below where you can copy paste this if you want to. This is just a basic fast API application, but we're just defining everything as a tool and we're using fast MCP instead of fast API. Super simple, super straightforward and this is automatically going to be executed in a way that this uses the MCP protocol or the MC protocol I should say. So that is easily usable and we can just add this once this is running. can add this as a server. So all we have to do here now is we have to say if uh name is equal to main then we're going to run this instance. So we're going to say server run and the transport this is now important. We have two ways of transporting uh one is the uh standard input output. So, SDIO and the other one is I think SSE which is for uh network. We're going to use that because we're running this locally on the system. If we're using this over the network, we should specify the other transport method. And all we have to do now to add this to our configuration is we have to go to the configuration. So, we have to go to um config and clot and then to claig JSON. And now we can add our service here or our server by saying to-dos and then the command that is necessary to run everything. So in our case this is going to be um command uv and then we need also uh some arguments here. The arguments are going to be uh a list and we're going to say here d-directory then the path to the directory. So our working directory here which is home neural 9 documents uh programming neural 9 python current my MCP server and then first of all comma and then run. So we're doing uv run and then finally the name of our file which is main.py. Of course, we can also just specify the path directly. But that is how you would call that. This is how we do this. And now I can close this. I can end this. I can also quit claw desktop. And then I can say claude desktop again. Hopefully this is going to work. No, it doesn't work. Oh, it seems like I'm doing main / py. I'm not sure if this is actually the case. That would be of course problematic. So let's go to config and claw and then claw JSON. Yeah, I'm doing main / py. Of course, this is not reasonable. So let's restart again. Quit claw desktop. And now we have 22 tools. So I can say now list all of my to-dos. It's going to say I don't have any to-dos. The server is running of course on my system. So now it tries to access list to-dos from to-dos. And uh this should probably give me nothing. There you go. And now I can say add a to-do for shopping. And then this should create a new to-do. And next time I ask I should get a list of the to-dos. And this should be part of it. So now say uh list all of my to-dos. And in this case I get now shopping not completed. Perfect. So this is extremely simple. This is just a basic Python server uh basic MCP server in Python. And the coolest thing about this is now not only can I add as many tools as I want to easily from different repositories or registries. I can also just copy paste my config file to cursor. So I can take this config file that I have here. I can go again to config clot and then I can open it. I can copy everything into my clipboard and then I can go now if I have cursor installed here I can go to cursor and here now I can create an mcp.json. Now I already have one so let's delete that but I can now just say mcp.json JSON. Create this new file. Copy and paste everything into this file. No different syntax. Everything's the same. Uh save it and then open cursor. In my case, now I have to go to uh applications because I'm using an app image. So I can just double click on it here. And when I open cursor now, this is going to have the exact same MCP servers available. I can open or I can work with them here in the context. I can just say okay uh list all or actually not list all my to-dos let's say um show all my database tables because of course the to-dos are only in RAM so we would not have any to-dos and what it does now is it calls the MCP tool uh list tables I can say run tool allow for that and it's going to tell me now okay we have person so let's go list all the entries in the table person actually first of all it tries to describe the table and now if I say send it should get me all the entries from person run tool by the way I think in cursor you can also enable yolo mode which I would not recommend but you can then just always execute the commands without confirmation but that is super super easy to set up again the big game changer when it comes to MCP is it standardizes everything which means I can use cursor I can use cloud desktop top. I can use any other MCP client, any other IDE or tool that supports MCP and I can easily just copy and paste these little blocks of configurations and I can get all sorts of plugins here and integrate them easily into my client. So that's it for today's video. I hope you enjoyed it and hope you learned something. I also hope that my voice was not too distracting for you because I have a cold at the moment. But let me know in the comment section down below if you guys are using MCP already, if you have MCP clients set up with a bunch of servers, how you're using them, what kind of uh servers you think are the most interesting. Also, let me know if you're more interested in videos about current developments about uh the latest updates, protocols, tools, models, and so on. Let me know in the comment section down below. And besides that, don't forget to subscribe to this channel and hit the notification bell to not miss a single future video for free. Other than that, thank you much for watching. See you in the next video and bye.
Original Description
Today we talk about the Model Context Protocol (MCP) and why it is talked about so much currently.
Code: https://github.com/NeuralNine/youtube-tutorials/tree/main/MCP%20Tutorial/my-mcp-server
MCP: https://modelcontextprotocol.io/introduction
MCP Servers: https://github.com/modelcontextprotocol/servers
Other MCP Servers: https://github.com/punkpeye/awesome-mcp-servers
Smithery: https://smithery.ai/
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: https://www.neuralnine.com/services
🖥️ Setup & Gear 🖥️: https://neuralnine.com/extras/
🌐 Social Media & Contact 🌐
📱 Website: https://www.neuralnine.com/
📷 Instagram: https://www.instagram.com/neuralnine
🐦 Twitter: https://twitter.com/neuralnine
🤵 LinkedIn: https://www.linkedin.com/company/neuralnine/
📁 GitHub: https://github.com/NeuralNine
🎙 Discord: https://discord.gg/JU4xr8U3dm
Timestamps:
(0:00) Intro
(0:28) What is MCP?
(3:49) Claude Desktop Integration
(14:20) Code MCP Server in Python
(20:51) Cursor Integration
(23:06) Outro
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from NeuralNine · NeuralNine · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Visualizing Stock Data With Candlestick Charts in Python
NeuralNine
Python Beginner Tutorial #1 - Installation and First Program
NeuralNine
Python Beginner Tutorial #2 - Variables and Data Types
NeuralNine
Python Beginner Tutorial #3 - Operators and User Input
NeuralNine
Python Beginner Tutorial #4 - If Statements and Conditions
NeuralNine
Python Beginner Tutorial #5 - Loops
NeuralNine
Python Beginner Tutorial #6 - Sequences and Collections
NeuralNine
Python Beginner Tutorial #7 - Functions
NeuralNine
Python Beginner Tutorial #8 - Exception Handling
NeuralNine
Python Beginner Tutorial #9 - File Operations
NeuralNine
Python Beginner Tutorial #10 - String Functions
NeuralNine
Python Intermediate Tutorial #1 - Classes and Objects
NeuralNine
Python Intermediate Tutorial #2 - Inheritance
NeuralNine
Python Intermediate Tutorial #3 - Multithreading
NeuralNine
Python Intermediate Tutorial #4 - Synchronizing Threads
NeuralNine
Python Intermediate Tutorial #5 - Events and Daemon Threads
NeuralNine
Python Intermediate Tutorial #6 - Queues
NeuralNine
Python Intermediate Tutorial #7 - Sockets and Network Programming
NeuralNine
Python Intermediate Tutorial #8 - Database Programming
NeuralNine
Python Intermediate Tutorial #9 - Recursion
NeuralNine
Python Intermediate Tutorial #10 - XML Processing
NeuralNine
Python Intermediate Tutorial #11 - Logging
NeuralNine
Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
NeuralNine
Python Data Science Tutorial #2 - NumPy Arrays
NeuralNine
Python Data Science Tutorial #3 - Numpy Functions
NeuralNine
Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
NeuralNine
Python Data Science Tutorial #5 - Subplots and Multiple Windows
NeuralNine
Python Data Science Tutorial #6 - Matplotlib Styling
NeuralNine
Python Data Science Tutorial #7 - Bar Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #8 - Pie Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
NeuralNine
Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
NeuralNine
Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
NeuralNine
Python Data Science Tutorial #12 - Pandas Series
NeuralNine
Python Data Science Tutorial #13 - Pandas Data Frames
NeuralNine
Python Data Science Tutorial #14 - Pandas Statistics
NeuralNine
Python Data Science Tutorial #15 - Pandas Sorting and Functions
NeuralNine
Python Data Science Tutorial #16 - Pandas Merging Data Frames
NeuralNine
Python Data Science Tutorial #17 - Pandas Queries
NeuralNine
Python Machine Learning Tutorial #1 - What is Machine Learning?
NeuralNine
Python Machine Learning Tutorial #2 - Linear Regression
NeuralNine
Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
NeuralNine
Python Machine Learning #4 - Support Vector Machines
NeuralNine
Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
NeuralNine
Python Machine Learning Tutorial #6 - K-Means Clustering
NeuralNine
Python Machine Learning Tutorial #7 - Neural Networks
NeuralNine
Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
NeuralNine
Generating Poetic Texts with Recurrent Neural Networks in Python
NeuralNine
Stock Portfolio Visualization with Matplotlib in Python
NeuralNine
Analyzing Coronavirus with Python (COVID-19)
NeuralNine
Making Text Images Readable Again with Python and OpenCV
NeuralNine
Neural Networks Simply Explained (Theory)
NeuralNine
Motion Filtering with OpenCV in Python
NeuralNine
Top 5 Programming Languages To Learn in 2020
NeuralNine
Simple TCP Chat Room in Python
NeuralNine
Image Classification with Neural Networks in Python
NeuralNine
Edge Detection with OpenCV in Python
NeuralNine
S&P 500 Web Scraping with Python
NeuralNine
Simple Sentiment Text Analysis in Python
NeuralNine
Introduction - Algorithms & Data Structures #1
NeuralNine
More on: LLM Foundations
View skill →Related Reads
📰
📰
📰
📰
O(N) Manacher's Algorithm with Mirror Boundary Optimization
Dev.to · Dipaditya Das
Building a Power Grid Inside Minecraft with BFS Algorithms
Dev.to · Carlos Cortez 🇵🇪 [AWS Hero]
The Run-Length Encoding Trick: How Simple Strings Get Compressed
Medium · Programming
75 Days of Leetcode — Day 4: #238 — Product of Array Except Self
Medium · AI
🎓
Tutor Explanation
DeepCamp AI