anthropic introduces model context protocol so what does this mean here is the live demo what is the weather in London so now it's going to check the weather but unfortunately clae doesn't have realtime weather information so you need to integrate your custom application with clae so that's what I've done here so this is my own application running in an endo so I'm going to allow for this chat and finally I got the answer here current weather tomorrow's weather and Thursday's weather so what's happening here the AI is passing the city name that is London as
a tool call to my application and my application is returning the weather details based on the city name that's all it is this is same as GPT actions or GPT plugins which is released by open AI previously they had their own way of implementation with open API scheme but here they are implementing differently using mCP connects clients servers and large language models so you do not need to get confused with all these terms seems like they made it so complicated to understand technically mCP server is your own application and mCP client is clae your own
application will have endpoints like an API endpoint and clae will be using that endpoint to answer your questions by the end of this video you will learn how you can set up mCP create no not Server create weather server and finally integrate that with Cloe desktop app I'm going to take you through step by step even if you're absolute beginner you should be able to follow and I will provide all the code in the description below but before that I regularly create videos in regards to Artificial Intelligence on my YouTube channel so do subscribe and
click the Bell icon to stay tuned make sure you click the like button so this video can be helpful for many others like you as a prerequisite you need to install clo for desktop just download Based on your operating system so let's open up up your terminal in your computer make sure Python and UV is installed on your computer to install UV in my Mac I'm using Brew install UV but you can just copy this command and paste it if you want to install in Linux once after you install UV UV is a package manager
instead of pip now we are going to type uvx create mCP server so first we are going to create Notes application to do that type uvx create mCP server and then click enter Then providing the project name I'm going to give notes and providing a description version number then it's giving me a path to create the notes so this is my path I'm saying yes now it's installing all the required packages now it says cl. app detected would you like to install the server in cl. apppp so I'm going to say yes this will automatically
create this clo desktop config.js in this path so you might need to open this code and and here it is so this is the directory where I installed notes run notes that's it this gets automatically added if not just paste this by default clot provides a boiler plate that is notes so now here you can see I need to navigate to notes and then install all the required packages so CD notes and then UV sync all extras that's it now if I see the folder structure here you can see notes inside that you you got
these files and the key files are inside the source folder the server so I'm going to open the server so inside this the key things to note is the function definition so in list tools you can see the list of tools added that is the function definition there's a add tool a description add a new note when provided with the name and the content it saves the data in add tool so when the LOD language model call this tool this call tool function will be initiated that is The Decorator and if the name is add
note then it will get the note name and the content then process it accordingly as simple as that similarly you can integrate your own application own tool by adding the function definition that is a description about what the tool does the input and the output and the execution of the tool this is the default boilerplate code which automatically gets generated when you initialize mCP so this is my clo app app you might need to restart this app to get this working so I'm going to close this and now I have opened it now I'm going
to say meeting with mvin prison add this as a note now you can see it's asking my permission and I'm going to say allow for this chat and now it says I've added a basic note about meeting with mvin praison so when you see the details first it gives the name that is a required field and then the content that is also a required field and based on on this information we are calling the tool that is our own custom tool notes tool and it's automatically adding the notes also just to note that if you
have already added the tool you can see the tool listed here you can also go to settings and then in the developer section you can see those two mcps you can edit the configuration directly from here if you want to see the log just at the top in the developer section click open mCP log file and that will open the mCP log where you can see that our mCP server notes got connected mCP server weather got connected you can extend this nodes tool by storing the data in a database and retrieving the data when requested
to do so so here there's only one tool call that is ADD node you can add multiple tool call such as delete node update node read note so this is a basic setup to start next we are going to see how you can create a weather application a real time weather data as we have seen before when we ask what is the weather in London the AI chatboard will say I don't have realtime data but when you add this function calling feature that is nothing but calling an API it's going to call get weather function
get the weather and return the data in similar way you are able to integrate your own application in this section any of your application which has an API endpoint so here is Cloe what is the weather in London that's what I'm asking and it says I apolog oliz I don't have access to real time weather data so we are going to make this work so same like before type uvx create mCP server and click enter now give a project name I'm going to say weather a project description version it'll automatically create a weather folder and
again it's asking if I need to add the configuration to clo doapp which I'm going to say yes and click enter now navigate to the weather folder and you can actually install all the required packages by typing V Sync I will put all the command in the description below now if you see the files same like notes we also have server.py that's where we are going to add our code and here is the code we going to use open Weather API so using that we are going to get the weather data and then PA it
to clo so here is the fetch weather function which is going to use the city name and based on that get the weather information and then return all these results here is the list tools decorator where we are going to Define about our function so get for cost function requires a city name So based on that it's going to return the relevant information about the weather and the cold tool decorator will check if the requested tool is get for cost so based on that it's going to run the tool and return the results there are
two more decorator which you might need to know that is list resource and re resource list resource listing the list of tools and read resource reading the tool now we have successfully completed creating the realtime weather app go to open weather and get open Weather API key so here is the configuration the path to the weather application and the path to the Notes application so here provide your open Weather API key that's it just save it now you need to restart your clo app again I'm closing it and now I have started the application I'm
going to say what is the weather in London here you can see it's able to call the function with the city name London and get the weather details and then pass that to the large language model to give us the weather of London this is super cool and just to note that I'm able to run only this mCP locally on my computer using the desktop clo app not sure when this will be available in the web clo app also just to note that when I asked for other tools available it gave me get for cost
add note then artifacts artifacts is used as a tool using this mCP and it also use Ripple for JavaScript analysis so up until this time the tool mCP is closed Source now is been open and we are able to add our custom tools and I'm really excited about this considering you already like this Cloe feature you might also like another feature which is Cloe context catching which I've already covered in detail and I'll put the link here and I highly recommend for you to watch if you want to know more about clot and I will
see you there