Why MCP Servers are SO IMPORTANT for UiPath automation!
By UiPath with Jeppe
Summary
Topics Covered
- Agents Use Goals and Tools
- MCP Servers Enable Dynamic Tool Discovery
- Exposing UiPath Automations via MCP
- Testing MCP with Postman Bearer Token
- MCP Unlocks Agent Tool Standards
Full Transcript
Hi guys, welcome back to the channel.
It's been a long time, but I'm back and I'm ready to go. And today we're looking at MCP servers in UiPath.
[Music] First though, a small disclaimer. This
stuff is brand new, fresh out of the oven. In fact, parts of it is still in
oven. In fact, parts of it is still in the oven. So, I or anyone else have
the oven. So, I or anyone else have barely had a chance to try any of this stuff out and certainly not all of it.
This is a first look of a product in public preview and things are almost certain to change by the time they are finally released. Anyways, before we dig
finally released. Anyways, before we dig into the demo itself, I want to talk briefly about what agents are and what they have to do with MCP servers. Well,
an agent specifically in UiPath is basically just an automation. Not an
automation like we've come to know them.
Built in UiPath Studio with well- definfined steps and if this then that, but an automation that is built using mainly two things, goals and tools. So
when you build an agent, you state a goal. Calculate the car insurance for
goal. Calculate the car insurance for Billy. He's 22 years old. He's slightly
Billy. He's 22 years old. He's slightly
insane and he just bought a 5,000 horsepower car.
Something like that. Anyways, so goals are expressed using prompts much like you know from prompting for example chat GPT. The point is you use natural
GPT. The point is you use natural language to state your goals and the platform because it has a large language model baked in understands the goals
that you express. The other main part of an agent and I might be oversimplifying this a bit are the tools or capabilities that the agent could then use to perform the work that then meets the goals you
stated in UiPath. These tools can be as simple as activities as we know them from studio. They can be automations
from studio. They can be automations that we or someone else have built or they can even be other agents. But
again, when we build and add these tools to an agent, we describe them in natural language. That way, when we tell an
language. That way, when we tell an agent to do something, the goal uh because it understands both the goals and the available tools, it can pair them up when it thinks that's the right
thing to do. But today when we build agents in UiPath and in most other tools, we add the tools to each agent one by one depending on what we think the agent will need. So we say, "Hey
agent, uh, build me a house. Here's a
hammer. Here's a saw. Here's a drill."
And so on. Do your thing. So while agent behavior itself is very dynamic and nondeterministic, the way we make the tools available to the agent that is
today very static. But MCP servers are about to change all that because going forward we add tools to the server and then we expose the server to the agent.
So instead of giving the agent one, two or three tools, we give it a toolbox. So
now we'll say, "Hey agent, build me a house." The toolbox is in the shed. Go
house." The toolbox is in the shed. Go
take whatever you need, then do your thing. So in short, MCP servers and the
thing. So in short, MCP servers and the model context protocol make this dynamic discovery possible. It's not yet fully
discovery possible. It's not yet fully implemented in UiPath or in very many other places really, but already now we can set up an MCP server inside UiPath
Orchestrator and we can expose the tools that live inside UiPath and then use them outside our environment. And before
long, maybe even already I may just not know how to do it. We'll be able to bring in external MCP servers to utilize in our UiPath agents. But in this video,
we'll let others call automations that we expose in UiPath using MCP. So let's
build a simple automation in UiPath Studio Web, publish it using an MCP server in Orchestrator, and then today we'll use Postman to test if this even works. Let's jump in.
works. Let's jump in.
Okay, so the first thing we want to do is we want to build a simple automation.
We'll go into Studio Web.
We create a new uh RPA workflow and we will call the solution solution. Why not? Inside the solution
solution. Why not? Inside the solution here, we have an RPA workflow project and we'll name that project math stuff. Inside the math stuff
math stuff. Inside the math stuff project, we have a workflow or a ZAML file. And that's one workflow. And we
file. And that's one workflow. And we
are going to rename this to add numbers.
I think you can see where this is going.
So in uh the uh data manager here, we're going to add some arguments. We'll add
one called in num one. It's an ingoing argument. It's a number. We'll create
argument. It's a number. We'll create
it. We'll create another one.
We'll call that in num two. Also a
number. Create it. And then finally we'll create an outgoing argument that's going to be our result.
There we go. Then over here in the workflow itself we're going to do a quick log message.
We will say incoming values are and then we'll click the number one and number two and then we'll
put and in between like that. Then we
will uh set the variable value of the outgoing argument. So we'll select that
outgoing argument. So we'll select that and we'll say this is equal to one and two added with each other. Oops. There
we go. Finally, we're going to do another log message.
Result is and then the outgoing result. And just
because we want to make sure that this is actually what is doing the calculation. uh we're going to change
calculation. uh we're going to change this and add just an extra one to the value. So it's going to actually do an
value. So it's going to actually do an incorrect calculation, but then we know that this is the automation doing the calculation and not just the LLM.
Right? Go back to our project here. Then
we can duplicate this uh this uh sample file and rename this one subtract numbers and then change that one so it
actually does a sub subtraction instead of an addition.
Cool. So now we actually built an automation. We're just going to do one
automation. We're just going to do one more thing. We're going to take the
more thing. We're going to take the subtract uh numbers uh workflow here and set that as an entry point because then we can select that uh in orchestrator when we add the process um to our
folder. So we'll publish it
folder. So we'll publish it and that'll just take a few minutes and while it does that we'll just wait.
And there we go. We can check our package.
We can go over here and we can actually deploy the package. We'll choose to deploy it into our demos folder, which is the folder I have over here. It has
nothing in it right now.
And we'll click deploy.
And we can see here now that the deployment is in progress. Now it's
successful. Um, and then when we go into our demos folder, we can see that it now created a subfolder here called Jav Solution. In that uh subfolder, if we
Solution. In that uh subfolder, if we click on the automations, we can see that there's one called math stuff. And
that math stuff uh process points to the main entry point in the uh project we just built called add numbers. So, we're
just going to do a quick edit of that.
Click next and next. And then instead of math stuff, we're going to call it add numbers and update it. Then we're going to add another process selecting
my math stuff uh package. And then
instead of the add numbers entry point, we'll use the subtract numbers entry point. Click next, next, and call that
point. Click next, next, and call that subtract numbers and create and close. So now we have in our folder we have two um we have two
processes that we could run and we could run them from here if we wanted to. An
important thing to note in our folder is that we do need in this folder to have a robot active. In this case I have um a
robot active. In this case I have um a serverless robot connected to it. So
this can actually run the automations.
It could be an unattended robot or you know whatever. Anyways now we have our
know whatever. Anyways now we have our automations the tools that we want to expose using the MCP server. So up here in the menu bar we have the MCP servers
um item and you can see that it is in preview. So if I click that you can see
preview. So if I click that you can see I don't have any MCP servers. If I add an MCP server I can choose between UiPath coded command and remote. And I'm
not going to get into these other ones but the UiPath one is basically where you expose artifacts as they're called from UiPath in an MCP server for the
outside world to use. So we'll call this one yism math server. You cannot have spaces and stuff in the name that will
generate a a URL here.
And uh we can give it a description here contains functions and uh let's call it tools tools for performing
calculations.
Then we need to add the tools. We've
just we're just creating the server here. We need to show it what tools it
here. We need to show it what tools it should contain. So we'll click add tool.
should contain. So we'll click add tool.
We can see we can choose between automations, agents, agentic processes, API workflows, and I'm sure more stuff will be added later. We're just going to click add numbers.
And we can give that a description. Can
add to numbers, right? And um we can add another tool
right? And um we can add another tool subtract numbers. And we will say that
subtract numbers. And we will say that can subtract two numbers.
Right? So now we have defined our uh MCP server, given it a name. It has
generated a URL for us. We're going to copy that. And then we've given it a
copy that. And then we've given it a short description and added two tools each with their own short description.
We'll click add. So now we have an MCP server. Now the way we test this is by
server. Now the way we test this is by using Postman. And you cannot use the
using Postman. And you cannot use the web-based version of Postman for this.
You have to download the desktop client.
I've done that here. And what I can do here is I can create a new workspace of the type MCP. And when I then paste in the URL that we just uh copied inside of
orchestrator and click connect, it's going to try to load the capabilities from our server. It can't do that because it needs to authenticate or authorize against something. What we
need is what's called a bearer token.
And all of this authorization stuff seems like it's not I I don't know. I
I'm not sure how to do it really. Uh but
I found a workaround at least so that we can get this to work. And the way we do this is we go to orchestrator and then uh go to the URL in the top
here and after uh orchestrator we just type in swagger and this gives us basically um the swagger user interface which is a way to
test the orchestrator uh API. You need
to make sure that you are authorized.
You can see here that my padlock up here is actually closed. If it wasn't closed, if I was signed out, you can see it's kind of open now because I'm signed into orchestrator. All I need to do is just
orchestrator. All I need to do is just click authorize in uh this dialogue and then click close. Now we can see we're authorized. Then if I click, for
authorized. Then if I click, for example, the folders uh section here, I can go down to the function called get O data folders. That'll give me all of the
data folders. That'll give me all of the folders that are in orchestrator.
Again, this is not something we really want to do, but we need to do it in order to get a bearer token. and uh I click try it out over here on the right.
Scroll down a little bit and click execute. That's going to execute and
execute. That's going to execute and then give me a list of the folders in this orchestrator. But more interesting,
this orchestrator. But more interesting, it's going to give us a bearer token up here in this section. So, I'm just going to copy this uh very very long string here
like so.
copy it and then go back into Postman, the Postman desktop client again. Very
important. Then I click authorization and for the authorization type, I click bearer token. I paste in my token over
bearer token. I paste in my token over here in this uh text box and now I click connect again. And now it says connected
connect again. And now it says connected down here. That means if I go back here,
down here. That means if I go back here, we can see in the uh tools section that we have two tools, add numbers and subtract numbers. So what this means is
subtract numbers. So what this means is that now we are connected to our MCP server and we can actually make calls against these functions. Now what
happens when we make calls against these functions is of course we're going to run our automation. So if we just quickly go back to orchestrator,
go into the solution folder and find our automations and look at the jobs list.
We can see that we don't have any jobs um that have run recently in this folder. So uh going back to the Postman
folder. So uh going back to the Postman uh client, if I click add numbers, it'll present me with the values that I can, you know, feed to this uh to this
automation, which is num one and num two in order to add these two numbers. We're
going to add three and three, that should give us the result six. But
because we made that little extra addition inside of our automation, it should return a seven. So um if I click run here, if we make a quick switch back
to orchestrator, we should see the job being created because this is going to start an automation. So I click run and we see now the uh add numbers process is
running once it says hopefully successful. There we go. We can go back
successful. There we go. We can go back to uh Postman and we can see down here that we got a result back saying out
result is seven because 3 + 3 plus that extra one is of course seven. Also, if
we go back into orchestrator and look at the um the logs for this job, we can see the log messages that we added incoming values are three and three and the
result is seven because we're really bad at math here. So, why this is so exciting is because this is a brand new way of letting your agents discover
tools that it needs in order to solve your problems or meet the goals that you state for it. And this is just a it's a standard. It's uh from Anthropic. They
standard. It's uh from Anthropic. They
released it, I think, in October or November of 2024. It's still brand new to a lot of people, including UiPath, but they're definitely working, I would say, almost day and night to get this implemented in a good way into the
UiPath platform.
Because with this implementation, as you just saw, you can very easily call automations from outside UiPath uh in the UiPath platform and have robots do
their things, whether it's a simple calculation like this one or if it's a longer running process including human in the loop and document data extraction and all kinds of other stuff. This is
just a very interesting way of opening that whole thing up. And of course also from within your UiPath agents when you add other servers or external servers
uh to your agents then those agents can do stuff that they would otherwise require a lot of coding in order to do.
So very exciting stuff. If you like the video please give it a thumbs up. Uh not
very many people are subscribed to my channel. So if you're not, please do.
channel. So if you're not, please do.
And uh I just hope to see you in the next one. So good to be back. See you
next one. So good to be back. See you
soon.
Loading video analysis...