MuleSoft inference Connector - [MCP] Tooling

Glue4Enterprise · Intermediate ·🛠️ AI Tools & Apps ·8mo ago

About this lesson

This Mule application showcases the use of the [MCP] Tooling operation to interact with OpenAI via MCP Connector. This operation enables you to execute tools hosted on an MCP server directly through user-defined instructions. [MCP] Tooling in Mule 4 allows the Inference Connector to expose your Mule APIs, flows, and connectors as AI tools — letting the model reason and act with real enterprise data, safely and under governance.

Full Transcript

So hello friend. So as part of uh this video we are going to discuss like uh this tool categories. Uh there is another operations called the MCP2 links. Okay. So this uh this is not available into the older version of the connectors in connectors. Okay. So this is available I think 1.2.0. Okay. So the purpose of these things is how we can able to use our MCP servers while we are interacting with the LLM which is like in my case uh which I'm going to use the open AAI okay so think from let me give you some details about this MCB okay so this mule application showcase uh showcase like this when I'm talking about the mule case applications so which like whatever I'm going to demonstrate. Okay. So is the use of the MCP tooling operations to interact with the open AI. Okay. Via MCP connectors. Okay. So these operations enable you to execute tools hosted on the MCP server directly through the userdefined instructions. Okay. So think from that perspective. Suppose uh the user is going to give a plain normal text. Okay. like the instruction or you can say the prompt okay or on the basis of that instruction data set okay internally you are going to hit to the get the uh the available tools or through the MCP clients okay and from that once you are going to get the uh exact tools okay then you are going to connect with the some different LLM so in my case I'm using the open AI okay so it is this MCP tooling allows connector to expose your removal API flows connectors as AI tools letting the model reasons and act with the real enterprise data safely at the governance. So we are going to see as part of the demonstration how this uh inference connector this MCP tooling is going to referring actually the MCP clients. Okay. And it is going to invoke to the MCP server. Okay. So let's quickly move on to the uh demo. Okay. So if you see this I have created one of the very basic U endpoint which I'm going to send this the MCP tooling basic. Okay. And this is the MCP tooling basic endpoints. Okay, which basically here going to hit the MCP tooling. So that is nothing but if you see this interference connector we have the MCP tooling. Okay. So what all configuration which is looking for is so this is looking for the inference text generation configurations which we have already discussed in our previous. So it's going to get only the open API key and the modules whichever you want to select apart from that no other configurations and if you see here the connection it using the open AI. Okay. Now coming to the next if you see here it is going to uh keeping this u details about the MCP config reference which means that at this latest uh uh this MCP tool links or uh this uh which is available this operations. Okay, it has the capability it can referring the MCP client. Okay, so this MCP client HTTP is nothing but my MCP client connections. If you see here, it is going to point the MCP server and this is the MCP endpoint. Okay, along with this client name client uh and here I'm using the authentication as a basic. Okay, because uh I need to pass the username or password. So in terms of the client ID or client secret the value I'm going to pass in the username and password okay and this is nothing but if you remember my previous videos okay so it is there into the here this MCP server which is already up and running here so this is the MCP server uh which is already up and running. Okay. So if you see here this is the MCP URL okay uh which we have network this is the path okay and if you see here it is up and running and since my client is connected already okay so it is also authenticated through the season listeners okay so which means that it is allowed to process that request from this client Okay. So that we are going to pass here. Okay. And this is what we are going to pass from the postman as a like client request. So one is the template, one is the instruction and one is the data set. We are not using any additional request attributes at this moment. Okay. Once it is going to okay configure and as part of this response what we are going to return we are going to returns both payload as well as the attributes. So this is just for this informations. Okay. What all the informations it is going to returns whenever it is going to interact with the uh this LLM which is the open AI using the reference of the MCP clients. Okay. So let's quickly go to this postman. Okay. And let me use this MCP tooling basics one. Okay. So this is whatever I have run or tested earlier. But let me re uh rerun it. Okay. So what I'm saying that passing as template. Okay. You are an helpful assistant. Okay. What is the instruction I'm passing? Answer the request with the politeness. I'm just giving one instruction. And what the data set I'm passing page check case details where case ID is this. Okay. So I'm giving this data set and to whom I'm sending this is I'm sending to the end point which basically connecting to the my assumption is it is connecting to the LLM. Okay. But LLM this open uh this is open AI they they are not aware about like what is this case ID because they are not anywhere going to what do you can say uh refer to your Salesforce to face this ID okay but while I'm going to run it you will see that since we have using the MCP client it is going to hit to the server and then it is going to return this response okay so this is how and although Although if you see internally it is going to use using this mule soft inference connection for the text generation. Okay. So let's see how it is going to behave. [snorts] See what it is going to Okay. Is it okay? So fetch case details by case ID. See when whenever I have hit this. Okay. See what is the returning from this response and this is response is coming from the this part here. If you see here see okay so response it is going to send. Okay. These are the tools. Okay. And this is the tool execution like content error MCP client. Okay. Actually this contents is saying type text. Okay, let me see whether is there any issue. Okay, maybe this MCP. Okay, so let me do one thing. Let me restart my MCP server. So just stop. Let me start it. Okay, so we will try to run because the uh it should send us these details. So here if you see the contents is coming null means uh the text is nulling null which means the response has not returned from the MCP but ideally it should give the response after executing this page case details okay so looking into that we can able to see although it selected the correct tools so this is the name of the tools like fage case details by case ID it's tried to execute but due to something like we are going to get some error and If you see here error is true which means that something happened wrong. Okay. So we need to look into the log. Okay. If suppose this is the false means uh we have the success. Okay. Although this is success but here the error is someone like some something is there. Okay. This is the attribute count. Okay. So here if you see it is going to give the token uses for this how many token has been used. output count, total count, input count. So this is going to giving this read result. If you see this, okay, this is significantly going to impact over the billing, okay, of your like open AI where you have used, okay, because it is going to consume the huge tokens, okay, these kind of things are going to consume the huge tokens, okay? So make sure like while we are doing the testing or these things. Okay, we need to make sure like we are in the correct path. So let me see. So it is still applying. Okay. So let's apply more times. Yeah. So if you see now this is up and running. Okay. Clear. This is up and running. Okay. So, let me try to hit and see what is happening again. Okay. So, this is the postman. Let me try to hit this. So, ideally we should get the response as well because uh we should get the page content details the error like the success response. Okay. Okay. What happens? Template was something 400 as did not specify content type. Okay. What is happening? Maybe it's not fully started. So, let's wait. Okay. Maybe it's not fully started. Yeah. Okay. Try again. Let me try again. Okay. So now it has hit. Okay. This is okay. Maybe this this is something related with authentication. Let me restart this my app. Okay. Okay. So if you see I have just restarted my app again. Okay. So it is deployed and once it is deployed you can see it is just now is trigger like authenticated. Okay. So now it is fine. Seems like at that time I have restarted the MCP server and this client was like uh the authentication was getting failed. So that's the reason. Okay. Let me try now with this. Hopefully uh this time it should work. Okay, because now authentication is going to happen everything's okay. So now it's perfect. Okay, so now what I did if you see the fetch case details where case ID is this I'm just sending this. Okay, it is giving me see this is the payload and these were the tools it got called and this tools is nothing but the fetch case details by case ID. along with it's not only giving me this reasoning of the like the which tools it has executed along with it's giving the entire details of this uh response. Okay. And here if you see the error is the false mean no error. And apart from that here you can see the attributes like uh what is the token uses. Okay these kind of things. Okay. Apart from that it is also giving few the additional attributes where this uh prompt filter result content filter result. Okay. Finish reasons. Okay. And which the model has been used while we are going to connect with the open AI that I have used. Okay. and this is the ID of that particular hold the conversations. So these all details okay but things like uh think from that perspective okay although this is good for the technicals okay like where we are going to see okay but uh this is not good like when we are dealing with the customers or business people's okay so how we can able to enhance in such a way like although it is going to call but response should be like the natural language okay if I wanted to check the status of this case details okay and the value of the case details. Okay, so that we wanted to see. Okay, so how we can be able to do that. Okay, so what I did okay let me I created one of the advanced version of that. Okay, and till here this is the same version like it is using the MCP client. Okay, I'm going to send this template instruction data set. Okay, this is the response I'm taking. This is the same response. Okay. And what I did I am taking the from that response I'm just taking the text contents. Okay. Because my purpose of to use this only taking with this this examples. Okay. So uh my my intention is just to extract these values. Okay. Uh I don't as of now for my business use cases require this tools informations or these informations. Okay. So what I did I just extracted this value in this format. Okay, I took this value. Okay, let me see if I can able to show you from the data view where uh not this one. Uh yeah, suppose uh these were the result which I took. Okay, if you see this extract value, so I have taken this value into the JSONs. Okay, why I have taken this value into the JSON? because that that response I have logged here. Okay, I'm now creating one of the request. Okay, so this is I have taken the uh very like the in a static way but think from that perspective whenever you wanted to check the status of the case or you wanted to send this new notification. So we can create that different flavor of the templates in the case of the case status update case on hold. Okay, case is escalated. Okay. And this template could be possible to uh put this values. Okay. Uh on the basis of on the basis of these values which are coming okay. So whatever the value which is coming here okay we can able to put into our template and we can able to so why I'm putting this so my purpose is to send this informations into the defined prompt template so that we can able to create one of the template related informations okay and to to get the uh what do you can say the normal uh text or descriptions or summary so that I can able to notify to the customers or anyways. Okay. So what I did I took this uh data sitware. Okay. And I'm using this agent defined prompt template as part of this mulesoft interference connector that we have seen earlier. I'm passing this template where. So this is template where is nothing but whatever I have stored from the request one. Okay. From there. Okay. But here the data set var is nothing but that is the value from whatever I have created into this this property. So that one I'm passing here. Okay. And I'm returning this response try to the into the so let's see how this is whole is going to behave. So this was the basic ones. Okay. Let me to the advanced one. Okay. So I did like I just modify little bit without template but more or less if you say like I'm using the plain language only. So template I'm saying you are the customer support agent who analyze the customer care details in the data set. Okay. And what is the data set? So as of now this data set is this but while it is running dynamically this data set is getting converted into the proper JSON by using the MCP tools. Okay. So I'm saying that these are the available into here. Okay, what instruction I'm giving? Answer via plain text output with all recommended personalized response. Do not repeat the response directly. Start the conversation with formal greetings. So these kind of the instruction I'm giving. Okay. So that that I have tested earlier but let's uh test one more times. Okay. So if you see here so we have received here this message. Okay, if you see here, it has faced that tools the MCP client. Okay, so this uh by using the MCP clients, it's executed the correct tools and if you see what is the response it is giving. Okay, so this is the response we have received here. If you see like dear Rajiv and then thank you for reaching out the regarding issues. So it's giving very like the very clear message to the customers or uh to the anyone's like analyst or whosoever is going to involve in a very plain language. Okay. So although we are not redirecting which tools used to crawl okay we are just giving the proper prompt and it is going to through this uh by using the open AI by using the this MCP server it's fetching the details and by using the agent defined prompt template it's converting into the this format and if you see looking into this any point management so here you can see this all response uh to ping this uh MCP server to get the uh what do you can say uh this uh case details is coming from the MCP server. So this MCP server which is getting hit by the MCP this tooling with the reference of the MCP client it is getting this. Okay. So this is how I have explored this MCP tooling is going to maybe we can u make it more generic as per the business use case. So I will recommend you just uh go by yourself. Okay, try to explore some more and uh thanks for your times. Okay, thanks for watching. Thank you.

Original Description

This Mule application showcases the use of the [MCP] Tooling operation to interact with OpenAI via MCP Connector. This operation enables you to execute tools hosted on an MCP server directly through user-defined instructions. [MCP] Tooling in Mule 4 allows the Inference Connector to expose your Mule APIs, flows, and connectors as AI tools — letting the model reason and act with real enterprise data, safely and under governance.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
How I Built a Blank Page Detector for PDFs with Vue 3 and Canvas
Learn to build a blank page detector for PDFs using Vue 3 and Canvas to automate the removal of blank pages
Dev.to · sunshey
📰
What I Learned Building an AI Resume Optimizer — And What Recruiters Actually Told Me
Learn how to build an AI-powered resume optimizer and what recruiters think about AI-optimized resumes
Dev.to · dayu2333-jinyul
📰
The Language Barrier That Made Me Use AI Better
Discover how overcoming language barriers with AI can improve development workflows and community engagement
Dev.to · FromZeroToShip
📰
I Stopped Running Playwright in Cron and Built a Screenshot Archive Instead
Learn to automate website screenshot capture without relying on cron jobs, using a Python workflow with Playwright
Dev.to · Cizze R
Up next
15 NotebookLM Hacks That Change How You Work
SCALER
Watch →