Full transcript of “Build AI Agent with MCP Servers to Automate - Browser, API, SQL & File Systems”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.
0:00 [Music] Welcome guys. In this video, we are going to build an AI agent with the help of MCP servers that can transform plain English instructions into a powerful business flows test automation with simple prompt instructions. Here is what overall goal which we are going to accomplish in this video. Firstly, we can automate web browsers using MCP servers. Now here to fill this registration form, it needs a data from database. So it will query my database. It will understand what is the structure of my database, what are the
0:45 tables, what are the schema of the tables and then you know it pulls up the data from database and then it fills it in my web browser. You can see that just with prompt instructions, it pulls the data from my database and it is filling in the registration form. Once it successfully automates the registration flow, then it will make API call to check whether this registration has been successfully done. It makes a login API calls through REST APIs and then it will see whether the registration was success. You can see that it's reading my entire Postman collection files which are present in my local system. That means you know our AI agent have access
1:31 to our local file system where it reads all the postman collections and you can see that it is making login API call on our behalf with the registered username password here to confirm whether the registration is success. It parsed the response saying that login request was success and next all the successful registration data it is going and placing back in the Excel sheet. You can see that let me write this email and password to the Excel file because these are the instructions we have given initially that go to this web page fill the registration form to fill the registration form take the data from the database and once you registered make a rest API calls to see whether the login call is success and then once it is
2:17 success collect all the data and place it in the excels in the appropriate columns and then you login and automate the flow everything you provide provide prompt plain English instructions without writing a single line of code and the AI agents can take care of all the work by leveraging the combination of large language models and MCPS. So how did we achieve this? So most of us are familiar with large language models right like claude chat GPT Gemini. So they process the our input and generate responses based on the training data. However, an LLM by itself cannot connect directly to the database. They cannot directly automate
3:04 your browser or make an REST API calls or talk to your local file systems. They are intelligent in giving the responses on the trained data. But for them to make these operations somewhere they need some other technology in place. So that is where MCPS comes into picture. So for next few minutes, let's explore what MCPS are here on high level before we deep dive into building an AI agent which can seamlessly solve our solution of automating browser, database, file systems, and API calls. Okay, a quick heads up. If you want to stay updated on AI concepts like this from time to time,
3:50 check out my Gen AI AI agents course in Udemy. The course discount link is in the video description below. Title might slightly change based on the how AI evolves. So you can directly check out from the link here. So this course will be your one-stop shop to get familiar with all the AI updates happening in the software industry. So I add new content every month with the latest happenings in the AI space. So you are all covered and you can come to one location to figure out everything what you need. So let's try to understand what is MCP from their official documentation. Okay. So here model contextprotocol.io in this website the first thing what they told is it is a
4:36 protocol that standardizes how applications provide context to large language models. Okay. So now if I have a question to ask large language model that get me the total number of orders placed for my product in New York. Let's try to ask first placed in New York for my product. So will LLM can answer this? See what are large language models known for? So basically they are trained on vast amount of data. So that if you ask something they can scan from their trained data and will give you the solution. But this is something sitting
5:22 in my local database, right? How many orders my product has been placed, it all is in my backend system. These large language models like claude or chat GBT or Gemini, they don't have access to my internal resources. Right now, when I ask a question like this, obviously it cannot answer. Though it is an intelligent, it is lacking the context here. Okay? So let's see what it will give us back. See here you see it is happy to help us but however it don't currently have access to your products order database or any data. So that is what it is responding. So that means it is lacking the context. So context here is
6:08 the database. Okay. So now what we can do is using this MCP protocol we can connect this large language models to our local database. Okay. So by forming that connection we will be able to uh get that answer where LLM can have access to our resources and then figure out all queries what it has to fire and gets the information for you. That's on ground level. But there is a way to do it. large language models cannot directly talk to your databases. Okay. So it is a protocol on how applications so applications in the sense in my case it could be database it could be browser it could be file system anything what
6:54 you have in your local resources. So for providing those context this large language models let's understand how MCP help in this right. So if you see the structure now assume that this is our MCP client. So that means now I'm asking question from claude anthropic. So that's my client. So if you ask a question from any other Gemini deepseek those are your clients. Okay. So this is my database. It cannot directly talk. So in the middle we are hosting a server called MCP. MCP stands for model context protocol. The name itself it tells that context I am going to give you the context what you need right in this case
7:41 my context is this database so there is a standardized way to ask and if you compare that with the APIs it's like similar only like you have a web browser here it you have a database here and you can't directly talk to the database where you ask your data in form of JSON protocol to APIs APIs then parse your request payload and triggers associated methods and get the data for you. Right? It is in the similar fashion. But these MCPS protocol are designed to interact with large language models. Okay? So they can talk with these large language models and then they can process the information. Now in this case I asked
8:26 this question get me total number of orders placed. Now what happens is this question will be gone to the MCP server and now when this question is being asked it strictly has to follow this protocol again what is protocol in ground level let's say you know president is visiting your city there is a protocol that there is security team who will be there before day and then when he lands in the airport there is a protocol that some other state ministers will greet them and you know it's a set of standards what they need to follow when president visits similarly you know when you talk with these MCP servers what these servers are saying is
9:13 communicate me in that standard so I can understand that's what MCP server is saying so now what these large language models does is when you ask something they will make sure they ask this question in that particular MC MCP standard protocol so that MCP server understand it and then it process the information talk to database and get it but there is lot more going in this MCP server we will get there step by step okay so now let's read the definition again it's a open protocol that standardizes how applications can provide context to these large language models okay so think of MCPs like USBC
9:59 for all AI applications, right? USBC is you know universal plug where you can connect to any device right so that's how you can take MCP server and for whatever AI application you have it could be your ID is like VS code cursor and chat GPT all that you can commonly connect your MCP server and all these tools can talk directly to the your local stuff right so overall this MCP provides a standardized way to connect your AI models that means this is your AI model to your different data sources or tools whatever you have right now I'll show an example that I have this done now let me go and start a fresh
10:45 conversation so this is my cloud desktop in the very next episode we will download step by step and see all that now what I have done is I went to the settings and then I have given this MCP server information to my uh local client. Now how you will give that information? Now let's say you are working with a database here. That doesn't mean that there is one universal MCP server which interacts with your databases, browsers, file systems, everything. Okay. So for every application you need to create that associated MCP server. Now for example in my local I have MySQL database. So now for MySQL there could be some MCP server written by somebody. Let's see.
11:30 So, MySQL MCP when you hit this, there are people who have published an MCP server for exclusively MySQL applications. So, if you want to really interact with MySQL, then you have to use only MySQL related MCP server. Okay? And that's obvious right when you ask a question. Now if your MCP server should be able to interact with your MySQL. So that means there should be code written in this that it can interact with the MySQL database by asking relevant queries. So for every application there are custom MCP servers are built there. So you need to figure out and it is not
12:16 a unique standard that there will be only one MCP server for one application. Anybody can design MCP server for any application. So you just need to go about seeing stars how popular it is and decide to you to use or not or you want to choose another MCP server for same MySQL. Okay. But there are a lot of MCP servers people can design. Probably in one of my next video I will show how to create your own MCP server for your own application. It's not big deal guys. Okay. So now let me just give you glimpse of how this MCP server is designed. We really don't need this to solve our task but for you to understand what exactly happening behind the scenes. Now if you go to this
13:03 implementation obviously they built it in the Python. So these are different methods. Get DB config read resources and this is what I am more interested in tools. Okay, tools are nothing but a functions here. So what happens is there is one function written. Now you can see that functions in the list of tools. If you open this list tools here where you will see what all functions this MCP server is exposing. Basically your large language models has to interact with the tool functions present in this server because these functions are responsible to execute what large
13:48 language models are asking. Okay. So when you connect your MCP server to this client connection is very simple guys just four lines of JSON configuration you need to provide to your client and then it will directly talk to it. Okay. So if you are a Java Maven guy that means if you know how Maven works that you provide pom.xml XML four lines of dependencies right so that your Eclipse can talk to your Maven host and download. Similarly here also four lines of configuration right now what happens is when you connect the first thing what all these um chart GPT or cloud what they do is they immediately see what are list of tools available I can use here.
14:33 So here there's only one function is available using this one function only you have to do everything because you see that name execute SQL this is a function and large language models are intelligent to read the description because in general for any MCP servers there could be multiple tool functions available. So this clot this LLMs has to intelligently decide which tool function I have to use to get my answer. So they will read the description. This is very important. Uh if you write clearly that's how LLMs can understand and can you call write function to get right information. So here what all they need is execute SQL. That's all right because
15:18 I'm asking get me total number of orders placed in New York for my product. Right? So all it needs to execute SQL in this. So it will look for that function in this server. So it will come to here and it finds that and it will see what are the inputs I have to pass to that execute SQL function. And here they have clearly given these are the properties you need to pass that means string the SQL everything you need to pass that and then it will call that tool here where that specific tool will be called and that tool have first DB configuration it connects the database and it it does all thing to execute that query and finally it returns you output that's how MCP gets information for you okay so they
16:05 have written a code in the server where large language models can directly come here find the relevant tool and get the information. Now similarly there is something called browser automation also. Now MCP playright MCP selenium now uh Microsoft have launched recently a playright MCP. Now when you scroll down there are a lot of tool functions it exposes. Now you see browser navigate browser go back all these are functions this playright is exposing as an MCP server. Now if you simply ask go to raahulshittyacademy.com here it won't go but if you plug in this playrightmc server then whenever it says go to rahulshittyacademy.com your llm is intelligent to go to this playrightmcp
16:50 server and it will see which function I can call so that I can go to that website by looking at description it will think okay this is a function if I call this I'm sure that it will take to the website and it automates for without writing any code and you can describe in plain English language because there is inbuilt code written in it. Okay. So these are different tool functions MCB exposes. Now what code inside it is written. If you want you can go and check but it is not required. I'm telling you how exactly you know people design all these. Now you can see here navigate there is a one tool internally. It reads your context. It will do all the stuff. And finally there is one playright step page. go to it will make that work. Okay. So which tool function
17:38 to select you no need that all that headache your large language models are so intelligent by reading the description and see which tool function to execute. Now before we go in depth now I have configured something here claude in my local and I have given the tools information. It's very simple. I just went to this uh cloud settings and then here developer options and you can give all your configurations here. Don't worry in the next episode we will do everything from scratch. Okay. So I'm just giving you a idea so that you know how I am connecting dots from the next episode. Now in the edit config this is my file. So here where you need to uh just provide that four lines of code
18:24 what I'm talking about. You see now I just gave this small code here. This is a configuration file. If you just add this file in your clot and that's it. Your MCP server is configured. Now if you are wondering how would I know this? It's again in their official documentation. Right? So they have given what you need to copy paste in your LLM so it will start working right. Just place this code and you are all set. And once you place that code there and if you come back to your MCP to ask a question you see there are tools available here 32 MCP tools are available because I have multiple configurations there now by just asking in plain English I can talk to I can make API calls API testing I can do
19:10 browser testing I can do I can figure out something from databases I can talk to my local file system I can manipulate Excel everything I can do because I have all tools available You also will know by end of this complete lecture because I will show one by one how to do it. Now coming back to our question. Now there is a database local database I have uh let me quickly open that. So here where I have all tables everything here right I have orders table there and customers table there which you will also see in the next episode. Now I'll hit this query. This query is about get me the customer names who have placed at least one order and these are the folks who have placed at least an order. Now what
19:57 I'm going to do I'm asking same question in my general LLM here I don't have any uh MCP tools right if I ask this question then again it lacks context it will tell that I don't have access to your customer database everything so how can I give you all that I'm just a large language model who can get information based on your question but this is out of my box right now what we did is I have configured those MCP tool called MySQL. Okay. And in that configuration, I also provided how to access my local database. Let me scroll. Yeah, my SQL. This is the configuration they are asking to me to place. And then I gave all my credentials everything right. And
20:42 I configured in this LLM. Now I ask same question. Get the name of customers who have placed at least one order. See to be frank right now this clot do not know anything about tables all that all it know is it can access to DB. Now it has to figure out what is your database name, what are different tables you have and uh what are columns in the tables. After analyzing everything only it can give me answer because if you see your workbench it's a subquery to get this answer you have to go to customers table you have to go to orders table and you have to form a subquery to get customers from orders and then club it to get it. Okay it's a complex involves multiple tables. If you simply ask this
21:29 immediately it won't give you answer with its intelligence first it will analyze your entire database like how many tables are there and what are primary key foreign keys what are columns let's see what it does okay now it has a context because my MCP tools are configured now it won't give you that I don't know you see I will help you to retrieve name of customers who have placed at least one order to do this I have to query your database and it's asking see run execute SQL so this is the tool function. Remember this. If you expand this, it is saying that I want to run this execute SQL from MySQL MCP. So that means you have your MCP here. Uh this is the MCP we have given here. It is trying to call that execute
22:15 SQL action, right? By passing the string. There's still lot more to talk in deeper. Step by step I will explain you because it don't know anything right now. It is trying to check ABC. First it started saying give me the table information. It says great I can see your tables. Now let me check the structure of your tables. Without knowing all that how can it form a query. Now it is checking orders table structure table structure and then finally it found answer. See it have written exact query which we did now in our workbench. After analyzing all your table structure, database structure, see here are the customers who have placed how it has a context. Now from where
23:00 that context is coming because we have configured MCP server in our cloud, it is talking to that and it's making that possible. So if you see this diagram again because I have SQL server and it configured LLM internally interpreted your statement that means it processed your statement because it has natural language interpretation ability right it understood what it needs to be done it spoke to your SQL server and it see which are the tooling functions I can call and then it realized that I don't know anything about it learned first by itself understanding what are the tables what are everything once it understood and then it is intelligently created a
23:46 query and then it got the answer with the help of MCP server in place now I also have a browser automation playright server with me okay I just shown you right I have configured that also which you will also do in the next episode now I'll say go to raulshittyacademy.com and click on few links for smoke test. Okay. Now before I actually hit this question, I'll ask in general where there is no MCP configured will large language model can do it. No. So this cannot be an agent to perform some actions because it cannot click it cannot navigate all that knowledge. It won't have by default. There should be
24:32 some mechanism in place. Playright is expert in browser automation. So what they did is they wrote a wrappers and created MCP server to help MCP clients like claude or chat GPD. Okay. So now these are like agents which will help you to understand and large language model is just a brain. Now if I ask this question it cannot it will say I don't have ability to directly navigate to websites or perform actions because I'm not a web automation library. Right? How can I automate? But now it will do it because I have provided MCP server which can actually help this large language model. But still large language model is not automating. MCP is automating. But
25:18 the instructions what to do. Okay. Now go to that page or click on that link that intelligent instruction is driven by this large language model. Okay. It is calling write functions. Okay. Okay, that brain intelligence is still this cloud only doing it is telling what functions to execute because when you go play right there are a lot of functions they exposed browser drag press choose type right which one to call all that is decided by this LLM so that is MCP server is just an agent which is doing that now you see first thing go to raulshittyacademy.com so LLM is intelligent that it know that it has to first hit this browser navigate tool because this browser navigate is a tool
26:04 function which will help you to navigate. It only decides you don't need to typically write code. Okay. So you say hello for this chart and here you go browser is open right now again next thing see for everything it is asking can I do this? It's good to ask because somebody is acting behalf of you on your own system. So you should be careful that you know write methods are happening instead of you know some random methods are being executed. So it's asking I want to click on your browser are you okay because this method needs to be done. Hello then perfect. Now you see it is doing smoke testing. It is clicking on few links. It does all smoke testing. You need not manually do it or run any automation code. Okay. So once it decide which link to click, it's just calling that tool function from
26:51 that MCP server and that MCP server is executing for behalf of you. Let it let it do whatever it need. It's it want to search text box. It has to perform some actions there. Type selenium in the search box because I just asked to do smoke testing. It will do for a few seconds and then it will say you know execution is complete. Finally, it says let's go back to the homepage and check out primary navigation. But again there is a privacy error. uh we are not allowing to do that more than a few seconds but yeah you got a point right this is how let me close the browser this is how you can actually work and create an intelligent large language model with the help of MCP so you are creating your own a AI agent technically so overall as a big picture that you are
27:38 building an AI agent with a set of MCP servers so you just ask in your plain English that agent particularly will go and solve whatever you need. So that being said in the next episode let's get started I'll take one realtime example and my goal is to show you all the MCP servers what are commonly used in your projects like I will show how to access database I'll show how to access um web browsers Excel files how to read write manipulate and how to make API calls okay you can do API testing also web browser also and then you can access your local files also So everything um the popular five MCP servers I will show how to configure without writing a
28:25 single line of code with a plain English instructions. Let's try to write end to end test where data being derived from database entered into web browser confirm through API calls and then feed that data back to Excel files or something you know let's frame nice example so that you'll feel confident on how to access it. So first things first we will get started by having our client. So all these are MCP servers and first let's have our MCP client where we can ask a question. So not every large language model as of now providing a plug-in configuration to integrate MCP server into their LLM applications. So MCP was
29:14 introduced by Anthropic and cloud is also written by them. So you have a very nice integration if you want to do it an AI application claude desktop. So please download this from here. You can ask a question and get it plugged with MCP servers. There are other IDE tools like VS code cursor which we can also support all these MCP servers. you can do in copilot github as well but this is the first thing where you can you know get started to understand concepts clearly client you can use anything that doesn't matter now let's say you want to write a java development you can do it in eclipse you can do it in intelligj no matter what client you use code concept is same right so same applies here as
30:02 well so cloud desktop you have nice UI where you can nicely ask a question and fix things so I prefer to get started when you are learning with cloud desktop. So go there and download based on your operating system. So once you download so the first thing it will start wishing you. So right now I don't have any MCP servers configured. Okay. So after you set up your client, the next thing is we will get started with a playright first because I want to give instructions to my LLM to go to that website and fill the registration form or something else. Okay. So with a plain English instructions I want to provide to my MCP client. Then to get it done I
30:49 need some browser automation MCPS, right? So playright is one and we have selenium as well. Okay. Underlyingly all these MCPS are still using core playright for playright MCP core selenium for MCP selenium. Again don't see this whole project or this video in QA automation lens. We are trying to solve a problem of end to end process automation. So again like how to put assertions all that that's a different story. So we are able to control browser automation. If you have any test data setup needs all that we can use this MCPS handy instead of writing a code right now it's up to
31:37 you what MCP you use but your goal is that the MCP what you are using that should help you to browser automation in my case I am using playright MCP you can use selenium also okay right just because you know officially Microsoft pushed it I am choosing that that's all okay so now if you scroll down they kept it very simple guys to make this configuration available for our LLM this is the five lines of you know JSON configuration just copy this now before we copy I want to explain you what happens in real time by giving that configuration there so step one you just ask navigate to you know some website
32:22 whenever you say navigate to website by default LLM does not have access right now when it check the configuration dojson file. The next step it can find many MCPS. Assume that it has playright, API testing, database, everything. Your large language model is such an intelligent to find right MCP server for your plain English description. This guy is saving to navigate to xyz.com. So that means this is typically a browser. So what is the point by choosing a SQL server? Okay, because we don't write code anywhere that when you see navigate to website choose XY Z MCP server that all headache large language model which will do it by its own intelligence in
33:08 our case large language model means cloud okay let it figure out what MCP server to choose from your configuration file and do remember that it won't go to internet to find all MCP servers it will just check in its own config.json JSON file what you configured in that it will check what are available what to choose right in our case with its intelligence it found that hey this guy have something related to playright MCP I can use it because I know that it helped to navigate website step one it has chosen so after that it will see what configuration contains right it is having a command npx and go and start the MCP server see ultimately what is
33:53 It's a server which needs to be started in your local system, right? All these are servers, right? You need to start the server and then send instructions to that server and that server will invoke browser and do things for you, right? So how to start server that configuration you will find in this configuration file. They have provided commands how to start. So what LLM does is by looking at this configuration file it starts server with help of config file in your local system where client is running. Client means where your cloud right now lm is running in that local system itself. It will start that MCP server with the help of config file commands input. Right? Server begins. All good.
34:41 Now it's ready to receive communication from large language model. Right? Now navigate to website rahulshettiacademy.com. This is the first English plane instruction what you send. Now llm what it does is it uses MCP protocol to communicate next step. Okay. So what is MCP protocol? How it should send? Should it be sending the JSON? All that you don't worry again large language model will take care. It's their responsibility to convert your plain English instruction to proper communication format what it requires. It will send that information not just sending your LLM while sending it also
35:27 has to tell which tooling function to call. Okay, select tooling function. Now you connected to MCP server of playright which is great. But now problem is this MCP server exposes many functions. Okay. So if you see here scroll down browser click is there forward is there back is there navigate is there. See playright MCP provides set of tools for browser automation. Here are all available tools. Now what is your requirement? Navigate to Rahul Shetty Academy. Right. It knows that this is a right tool I need to call that also LLM decides. Okay. It will tell what tool it has to call. put this browser navigate tool name and then it will send you know and while sending it now let's say browser navigate this is
36:13 the tool lm selected right and then what lm do is what is the parameters it is expecting URL okay this is what I need to send let me see what this guy is asking me he's asking navigate to website this raulshittyacademy.com okay then this is a URL okay fine then what it does is it creates a URL like this and it will tell go and call this particular tooling function with this parameter all the bloody headache I would say taken care by intelligence of your LLM you don't worry okay with all information it reaches the MCP server playright the moment MCP playright server is invoked with this function with URL all it does
36:59 it's just automate just like how you automate in your local system it opens a browser and it hits that URL Done. Step one is done. Next, what you want? I'll say go and click on that link. Right. Again, by seeing that click link instruction, your LLM will now again find out. Okay, this guy changed another action. Now, let me find out clicking means what I should do. Oh, this is something called perform click on page. Now, let me call this function. Okay, so parameter string is there. Right? Now I will send string and then target element also I need then what for that I need page snapshot where is the page snapshot okay it will choose a page snapshot it will open the DOM again it will call another function to open DOM and then it
37:45 decides what is XPath everything LLM will do and finally it will send parameters browser click tooling in this MCP server and then what MCP server do it will interact with browser and get it done for you right that's how it work this is how internally things work. Now to make all these things work, what is the first step? It has to start playright MCP server, right? To start that server, it should sit in your config file, right? Now let's do that. Okay. Now come back to your clot and then go to settings and in the settings you will see something called developer. Select this tab and here edit config. It will open that uh particular file here dot JSON. Right now it is
38:33 empty. In this particular file you have to uh write your code. So let me write like this. Now let's try to understand what exactly this is. So MCP servers key value pair. So this is a parent. In this you need to write servers. So I started uh by giving this command here what play right later when you have uh API rest API testing MCP you can add one comma here and write that server okay so like that all server information you will write in this main key MCP servers and now the first what is it it's a playright MCP server and the command what you want to execute to start the server this is a npx is a command which
39:20 you need to give and these are arguments like you will provide npx space playright / mcp at latest. This is what it will frame and it will hit in your local terminal where playright server will start. That's it. Now if you don't have node installed in your system, it won't work. So this is simple. They're just having command with argument and it's running. So make sure node is installed in your system and it will begin the mcp server. Once you're done, save it and then uh you can close or just keep it open. No worries. And come back to your actual cloud. It will take time to reflect. What I would suggest is restart. Quit
40:06 your cloud completely. And then we can restart. Close it. And again open cloud. And then here you go. You see there are 14 tools available for you. Now previously there is blank. If you want you can rewind the video before I provide any JSON file. There is nothing here but now it is showing as a 14 MCP tools. Now select it. It will tell you what all tools tool functions. Now this LLM is aware. Now you can choose file to upload. I can click I can close. Go back. All these things you can do on your browser. If you see something which is not exposed as an uh tooling like this that means LLM cannot do it right
40:52 and there is something called attach you can see what all MCP servers attached to this guy right now playright is attached okay now ask the question navigate and then basically we need to fill the registration form as I told you that to fill the registration form we need a data from database so hit this URL and then you will land here. So, navigate to /client and then I will say uh click on this link. Click on registered here link. That's all for now. After you reach this page, next we need to fill the data. For this, we will soon have database um MCP
41:41 server and extract the data from those tables and feed it. we will do as an integration for now these two steps. So technically if you don't see this MCP tool integration you LLM cannot do it for sure but because now I added that and I am submitting now it has to start um you see first it will prompt you allow this tool to run in your local browser navigate and you see here how it framed in MCP protocol standard URL this is the one but you didn't give this right you gave in a plain English but it's a duty of LLM to do that but one painful point that is every time it will ask are you allowing me to do this but I still feel that is okay because we are not primarily doing this as an
42:27 automation testing so here we are doing our day-to-day task without even worrying about doing it in a code but there are some tools which you can avoid by clicking this and it will do sequentially without prompt there's a tool called cursor but we will go there later first let's understand the concept so now it should click see it clicked already it on the restore page. See, I have successfully navigated to registration page. Now page displays registration form. Okay, now it is telling this form have all these fields. Would you like me to help to fill out? Hold on. Don't go there. This this LLMs are super smart. We will give you data how to get there. Okay. So that data comes from our SQL, right? In the next
43:13 episode, let's see how we can connect MCP server of SQL to this and get the data from the SQL to input in this registration form. All right. So now let's focus on MySQL MCP. Now we need to connect database to our client. So for that again you know just Google and see what is good MySQL MCP server out there and then you can choose. Um for me I felt this is enough the one what I have because I see good number of stars here but again it's up to your due diligence to decide which MCP server to choose. All right so they have given me the usage here. This is the one I have to put in my system and then it will work
44:00 right. So let's try to understand first what this is exactly doing because you might run into errors when you directly place this. So you need to place path to MySQL MCP server and then you need to run it. So check it out here. It's not direct like the way how we did play right now. And there is a command called UV. So will UV command will run on your system? It might give you saying UV is not recognized as any internal or external command. Okay. So let's try to fix this before you blindly use this. Okay. So basically this guy who prepared this is not downloading this server.
44:46 Okay. So we he's just writing a command to start the server. But you are the one who has to download this first put it in the path and give that argument here. So it will start the server. But previously in playrate everything has taken care by uh them that it gets the latest one and it will run the server. But here is not the case by looking at the commands you should be able to decide now. So my SQL MCP server let's go little up and see they have provided a manual installation. That is the first thing you need to do. Fine. Let's do it. So we have a terminal and if you are working with uh Windows obviously you will have uh command prompt where you can start the things right. So I already have in
45:31 my system. So in Mac you just give pip or pip 3 install MySQL MCP server. Same thing in Windows as well. But do remember when you are giving pip that means you should have python installed in your system and python path is set in environment variables. If you don't know how to do that just google it there are any number of resources available. Okay, actually why do Google ask here only the same cloud it will tell you right so that's where uh I see some videos people just asking to paste the configuration directly but try to understand what it is telling so that way you won't get errors it is asking to do all this stuff first install it yes we installed but
46:18 when you see pip that means you need a python and that also you can install and do it what is next step because it's already installed in my machine if it is installed and if you want to know where is that path because you have to give the path of that MySQL MCP server right for that there is a command called pip show it's same in windows in Mac pip show my SQL server when you ask like this it will tell you where it got installed let's see okay so in my system it is installed in this location and when you do from your system it will tell you where it is installed no matter you are in Windows or in Mac do this and first find the
47:04 location because it's asking it's demanding to get that path fine so we will give this location and we will ask to run everything looks cool but this is the initial command right so UV space it will execute this argument but what is UV right that we need to understand so let's try to ask I know what it is but I'm giving you the context on how you can uh you know research and find out something what is UV in Python because today this is MCP server and when you are dealing with some other MCP server in the future I want you to u scan interpret and decide how to make it work that's my ultimate goal okay so here they were telling that in Python UA refers to modern Python packaging tool
47:50 it's an alternate to pip just like pip but designed to significantly ly faster and more reliable. So that means when you download Python, pip will come by default. So you need not worry about downloading pip package again. As long as you have Python, pip will work. But UV to work, it won't come by default. So you need to install it again manually. For that, you know, because we have pip access as if you download Python, you will have access to this pip install UV. You need to do it first. Okay? And then in Mac give pip 3 but window guys just put pip install ub actually I already have in my system right that's why it says requirement already satisfied in your case it will nicely download that is required because
48:36 without that when it hits a command with u you you will get error that u is not recognized as any command but now it will work if possible place u in the system variable path or even known it let's directly find out First where is this UV installed? Just like how you have checked where pep is installed. So this is pip software right and then you can just ask show me where this UV is installed. All right. So it is again installed in this particular location. Right? But we need executable path. I will say which UV. This is an executable path where UV is present. In Windows you need to tell where if you want to know
49:22 that theexe file which is responsible for invoking UV. So this is a software where it is present. This is a location where the whole package is present. Right? When you give which it will tell you where executable path is there. In Windows you need to tell where. But here oh it's still working here also. Awesome. So we have in this system. Good. First confirm this. Before confirming this, don't try to add this configuration file in your system. Okay. Now, as we have everything in place, next you need to have database, right? So, what exactly this server is doing? This MCP will connect to your database. You need to give it if it's in your local host or it is in a Azure cloud, Google cloud, it's up to you. You need
50:08 to give the database host port, username, password, and what database you want to access. It's obvious, right? If you want to connect to database, these details are must. Okay. So for that you can have your local database MySQL setup. Again it's very easy guys. MySQL server just download this and community server. Let's go to their official website. Yeah. So here based on your Mac or Windows because I am in Mac it has selected Mac by default but for you it will show Windows if you're Windows guy. If you're Mac you will see the screen. So download the first uh one what you see here and the whole SQL server will be downloaded in your local system right and you need to install it when you do next next next
50:55 after installation it will ask prompt you to give username password and what is the root um sorry what is the port number everything it will ask you to prompt or it will show you default note down all that okay so when you download and double click it you need to go through steps by Just clicking on next. Next. When you are doing that, it will give you all these details. Note down them, right? And it will prompt you set one username, password. Write them and note down them because you need to bring all those details here. Okay? Now database we still did not create one. Right? So once MySQL is set up in your system, next step to play with MySQL database and to fire queries, you need editor. So for that you have MySQL workbench. Just go and download this. Uh
51:42 I personally like this because this is a lightweight and you know download it and just open that. Once you open you will see something like this. Welcome to MySQL workbench. And here where you can create a new connection. Click on plus icon host name port username and password you can give here and test connection and that's it. So it will prompt for you automatically with all details, username, password, host if you give and set your username and password and it will just click on continue anyway. All right. So this is a query editor where you can interact with your local SQL server by asking with a queries. Right? So I have a complete query set. I
52:29 will attach that to this video. You can find it in the resources or in description mode. So basically I created a database called Rahul Shetty Academy and then I am switching to that database. I created one table called customers and one table for orders and then I filled the data. This is customer table data and this is orders table data. Right? From this you know you can create multiple queries. You can do joining, you can do subqueries, left join, outer join. So many things you can come up from this structure right but as I said we don't worry about creating all the queries let LLM take care of that headache but this is something first we are setting up one database with some table so that you know our LLM can interact for our
53:15 practice what we are doing in this exercise all right so this file you can get it from resources copy this file exactly place this and you know select everything and run this so it will create a database for you create tables fill the data everything it will do on one single shot. So once it is done just see the tables are created let's select start from customers just making sure you know first you have to choose your database right and then head this query and it will give you all customer details which are good that means it is successfully present similarly check for orders right once you feel that your database is ready with this data you are good DB setup is Now you know that
54:02 username, password, host everything right? Uh as I said when you download this for first time it will prompt you to create take all of them and now let's come back. You need to replace them here because you are working in local. These two will be same. Host port won't change. Mostly it will by default it will be in3 66 port only. And in your local local host only things will change. Username password what you set those you set here and the database is what you created in your workbench. So here I created Rahul City Academy database right and I'm using it. All my tables are inside the database. So use Rahul City Academy database here. Right? And next thing path to MySQL MCP server. So in this place uh you need to get the
54:50 path where we have downloaded that package entire package. So pip 3 show MySQL MCP server. Right here is the location. Copy that location what you get from this command and just place in this. Right. Once you prepare everything and when you are sure that UV is also run, you are all set. Copy that entire config.json file and then you know just place it in your config.json. So I have done that for my side. So let me go to uh the file config.json file. So previously playright is something we have written right. Um so this starts here ends in this manner. This is playright arena. I'll put comma
55:37 and I'll add my SQL here. Yeah, this is my SQL just like playright and this is the command. Now you see here if I just give UV because I did not place UV in the system variable path. My system is not able to detect where is UV, right? Uh if you go back to your terminal again, we installed UV fine but we have to place it in the environment variables path. then only when you give UV it will recognize for just one thing I don't want to put in environment variables so for that what I did is I just asked where is UV I need to know the executable file that's all so it gave me the location you can also do it if you are in Windows guy just ask where is UV take the entire path of UV if you are not willing to put it in system variable
56:23 path take that path and just directly place here instead of just UV we are placing the whole executable pathexe okay and And this is the where the whole package is there that I just shown you, right? pip show where is my SQL MCP server started and this is the actual package and this is my host and this is my username and this is my password database everything all set the way now how I explained you the same instructions you do it on your side and save it the moment you save and I always recommend to restart because it won't reflect immediately right now it is 14 all the 14 tools belongs to playright Okay. So, let me do one thing.
57:10 Quit and then open the cloud desktop again. It's fun, right? How are you? You just asked me how are you again? What? For every 1 minute. It's not intelligent in decide that we open immediately, right? Okay. You see it's a 15. Oh, yeah. It's there. MySQL MCP server. It's detecting. Great. And now let me open this execute SQL. Yes, it is reflecting. We're all set. Okay. Now what do you want to do? Now in the workbench there are a lot of things you can ask. Now for example let's frame some uh query question here. Find companies that have placed more than one order. So here if you see in
57:56 orders you have company names and the customer's name. So this is a query. Basically you need to write group by company uh column and then from order table you need to figure out which company have placed more than one for that I have taken count of star that order count should be more than one I'm aggregating like this okay but now don't worry about all this llm will take care but I'm just testing we are testing our LLM and we have tech solutions in have total two orders right now same question. See now if you are expert you can write query but now with MCP server you need not be expert no need ask here find companies that have placed more than one order when you ask this your
58:42 LLM is intelligent to choose right tool I told you right it will scan everything and it will decide I think this is the right for me that's how it will decide let's see okay see it decided that it has to give SQL query again every time it will start fresh right so it has to understand database structure tables customers everything because we just configured and it don't know that how it all works. Okay, now it understood table structure. Great. All right. You see I have found tech solution sync is the only company that have placed more than one order. Same thing you got here. Awesome. Okay. So in my case um we are all set with SQL and playright. Now let's write an
59:29 integration script. So that means we have done until registration that um go to website and open the registration page. Now I'm going to ask in something different way like this. So go to again rahitiacademy.client and click on don't have account register and then I'll click on register. Two steps done. Now next thing is pull the data of first two records from registration details and usernames tables. Okay. So do you have these registration details and usernames with you? This is whole different setup right now. We saw a demo of uh SQL but here if
1:00:16 you observe our workbench it talks only about orders and this right we don't have about registration table all that so let's do one thing uh in the same file I'll create two more tables and I'll quickly add them so you will see the data here so we are expanding our tables here but don't worry I'll give all this data for you to download so you can quickly create a database with all these tables See I'm creating registration details. It has first name, last name, everything and usernames. Here it has ID number and email, right? And there are foreign keys. All these are involved. Okay. So everything good and I'm filling the data here for that table. Now I'll run this query quick. Select star from
1:01:04 registration details. So yeah, you can get this file and do it. first name, last name, phone number, engineer, everything we have. But one thing what is missing here is email. Okay. So, select star from uh we have another table as well which is usernames. This is having email. Now, there is a problem here. Let's see this username table hold emails. Okay. But if you want more details of first name, last name, then that data is present in another table. In this table, it is present. For these both common connection is ID. Right?
1:01:49 Now, if you check the query, what I'm asking, pull the data of first two records from registration table and username table and register them in the page. I need data from two tables because in if I want to give usern name email email here this email information I have in this username table right and a registration details all the information what I want here present in this table. So basically both the tables I need. If you want to write a typical query for this to pull the records all that I have this this is a query where you can use usually to combine all of them first name last name we are using a simple join statement here. Okay. Now
1:02:35 out of this first two records is what we want to pull up right that's what I'm saying. So you need not worry about all these queries. So we have data like this that means it involves join that headache all LLM will take care out of all the records first two records only I need with those two records I want to register in this page which page uh the page what we are uh looking for in this /client if anything missing use your own knowledge to input I'm adding this because there could be some information my table does not have about gender let's If anything is missing, I'm just telling you know use your own knowledge. Okay, all that LLM will take care. Let's
1:03:21 see. Now this is a input which involves combination of browser opening with playright MCP server as well as DB because record should come from there. Let's submit and see the magic. So first it's saying I'll navigate to the website to first two records. Okay, do that first. sitting on that page to get started because that's how you said, right? Okay. So, it's saying hello for this chat. Let's allow this. All right. Now, this is on the page. Let me adjust this so we can see both working together. Okay. Now, what it is doing, it's already went to database. You see, you see that it pulled the data already. First name John, it entered, last name
1:04:07 do. So, where is this data coming from? Let's go to database. See John Doe. We are asking first two records, right? It exactly pulled first record and it is filling. John do at Gmail. But I think this email is already registered. Then let's see what it will do. You can see all that description. Make sure you allow chat. It is taking phone number everything. So you see I did not give occupation. I think it will figure out what occupation it has to do all that. It's entering password. But you know password is minimum eight characters are required in my database. There are only four. What will happen? Let's see. So I I'm not worried. See it says password must be eight. If something is
1:04:52 wrong I told to use your knowledge to fix it. So it is fixing by giving eight characters. You see that I see there's a password requirement was not your data. It is at least eight characters long. Let me update this. All the magic will be done. See if you provide nicely input that password is this this requirement it will do on first go but because you did not tell anything it is trying to be intelligent to figure out all this. All right. So it says user already exist. After doing all this it says user is existing. Now let me try uh the second user and the execution is going on for second user as
1:05:39 well. Perfect. Account created successfully. And you see for second user it is telling that I'll use a strong password based on the requirements we learned earlier. That's the beauty of this large language model because it know and it understood how your application working nature based on that next time it will create a password on those requirements and it just created. So out of first two users first is already registered that's what it found so it skipped it. It took the second user and it's unique and it get registered. That's all we need and it's done. Now you see the overall summary. It says I have successfully registered both users from your database tables and it is giving the summary for the first
1:06:25 user due to password requirement that was not in our database. It updated password like this and for second user it did this way and registration was successful. Is there anything else you would like me to do? Yes, there's still more to do. But this is how you can connect multiple MCP servers and solve your needs. In the next episode, let's talk about performing API testing or I would call it as APIs interactions. Not specifically testing but how to hit APIs everything. We will see how LLM can do with a plain English instructions. Right? So now we registered successfully through play rate MCP server with the data from MySQL. Right? And that's another MCP
1:07:12 server. Now we need to confirm whether we have successfully registered or not. How would we do that? For that I'll take a help of APIs. So for the same Rahul shitty academy/client for this practice web page there are APIs also available. Okay. So this is a postman collection. Again this will also be available for you. download in the resources uh the attachment what I have put everything the database SQL queries postman collection everything will be there so you can just download them and practice parallelly with me if you want so this is an API call right so this is a login URL and the body you need to send the user email and password what you have
1:07:58 used to register and then when you submit it will tell you that whether the token is successfully received that means it logged in successfully or not. So as long as you receive the token and message login successfully that means you are good that means registration is successful because you are able to log in with success response and status codes right this is an API call which will help us to confirm whether the registration is successful or not. Now our requirement is to make this API call from our LLM with the user email and password what we have used for registration and check whether we are getting the same success message in the
1:08:45 response everything large language model has to do. Okay. So what we are doing here basically we are making an API call. So that means I need API call making ability MCP server. So that will help us to make an API call and give the response back. Okay, that's the concept. So for that, so just type rest API MCP service and here is one available DK um maker and based on stars you can decide if you want to use this MCP server or if you have another one available. So anybody can create MCP server and can push. Okay. So I found this as table stable. So I'm using this
1:09:32 again. You know how to scan everything, right? So scroll down and see what all these guys are asking. Uh rest API and node command, right? So this is for Mac OS and this is for Windows. So make sure you see the difference. And they are telling that due to non issue in window path, you must use full path instead of app data. Right? Let's try to understand what exactly it is. So it's simple guys. First of all, npx command which is a node command you are making right and that will help you to download this rest API. Great. Nothing you need to do. It will download for you not like uh previous SQL server and these are environment variables you need to provide. So what is your base URL? In
1:10:18 our case our base URL is rahulsh cityacademy.com. just provide that and then if you have any authentications as of now our API is straightforward we don't have any authentications to make a calls so all this will not be applicable for us except the last one probably header application/json but in your case if you are working for any APIs which needs authentication you can add just one more key value pair and get it done right it's straightforward and we have nothing fancy about it same thing with windows also So let's add this configuration to our project. But one thing it is still not clear for us. So you are adding this configuration but where is the contract?
1:11:06 So it knows just a base URL. But how come your large language model know the contract of this API? When I say contract like what is the URL? What is the body? How what are the parameters? How should it frame all that? what is the HTTP method? It's a post call or get call. So, it needs information about the whole API contract, right? And then it can use make a call using this rest API server. But when it is making a call, it has to construct all this, right? In your MCP server, you are just telling about base URL only. So, let's give that information first before you know you give the ability of uh API calling. So I can do a simple
1:11:52 technique here. Now this is my project. Okay. You can loging or you can create order also. Okay. So this is basically my postman collection. I'm not going deep dive into what is this API. But overall this project I will export as a postman collection. Okay. So that means it gives me one JSON file. Very simple. So here export right when you export it will be exported as a JSON file. So that file knowledge I will pass to my LLM. That's
…