Okay.
And with that, I can go back to my AI agent.
Here it is.
We've got everything set up.
We can chat with this.
It will use open AI.
It's going to try and produce this structured output.
We just have to give it access to search the internet for, uh, sales prospects to answer our question.
And we've found a great platform for that.
We used Fire crawl.
And fire Crawl was very effective.
But do you remember Fire Crawl had a little particular thing about it, which is that fire crawl, as
it happens, doesn't have a tool built out in Nan, at least not as of today.
By the time you do it, it might be there, but as of today, it's not there.
There's no tool.
And there is, of course, a proper core node.
You could have it here, but that would be no good because there is a fire crawl core node.
But we want to be able to have the Lem drive it and make its own decisions about what it wants to call.
So ideally, we'd want to be able to add a tool right here in these tools that could call fire crawl.
Well, how are we going to do that?
Wouldn't it be great if Fire Crawl had an MCP server, a fire crawl MCP server that we could connect
to here by adding an MCP client, giving us the ability to equip our AI agent with a tool to search
the internet.
Wouldn't that be great?
Oh, but you know me too well, don't you?
Yes, yes, yes.
Of course.
It turns out Farkle does have an MCP server, and it's not an Stdio one.
It's a proper one that we can connect to from within nw10.
So.
Oh, joy.
We found something that doesn't have a tool node, and that's ideal for our use case.
Let's build an MCP integration right now.
It's going to be so easy.
So here I've logged into Fire Crawl and here I am signed in.
That's my API key.
Hey I'm going to copy it to my clipboard.
And so should you because we're going to need it in just a second.
And now I'm going to go to the docks up here.
And in the docks you'll find there's a whole page on MCP server.
And if I scroll down here you'll see that they have a URL for running, and this is a streamable HTTP
type.
Uh which, which uh for, for the the pros that know it, you can tell because it ends with slash MCP
like that.
Um, and they call it a remote hosted URL, uh, which as it says right here has streamable HTTP support.
That is the, the the third type that I showed you in the three types of transport mechanism.
Okay.
So we are going to want to use this URL right here to connect to our MCP server.
But first up there's something else we need to do.
We need to get this fire crawl API key in as a variable into our environment.
And let me show you what I mean.
So I want you to come back to the Project amplify right here.
Oh, definitely save.
Uh, and there is a whole section called variables just here.
And if you go to variables, you'll see that you can add in a new variable.
You can do create variable which I want you to do.
And I want you to call it fire crawl API key like that.
And it's not going to let me because I've already got it, you can see.
But you should not get that red message.
And in here you will paste in the key that you just copied from Fire Crawl.
And you've got to be careful with this.
If I haven't said this a million times, I'm going to set 1,000,001.
You need to get it right.
You need to call it exactly this.
You need to paste it in here.
And if you don't, then don't come complaining to me about it.
You're going to have to keep hammering away at it until you get it right.
So, uh.
But but I know you.
You always get it right.
Thank you.
So you you put that in, and, uh, everything is looking good.
I'm going to change my key before, uh, before you go and use all my credits.
Uh, so at that point, it's telling you right here, this is how you use that, anywhere that you need
to use it.
Okay.
So with that, we are now going to go on and build our, uh, our MCP client to connect to this MCP
server.
Okay.
I've now just gone back to the Fire Crawl MCP docs and here is the link to the remote hosted URL.
You can see it in there.
And the only sneaky thing is that it's a normal URL, but they need you to put the API key in the middle
of the URL like that.
Ah, that's a thing.
So we're going to copy this to the clipboard like so make sure you copy that remote hosted URL.
All right.
Going back to workflows go back into MCP.
Go back into my workflow, whatever you may have named it.
And what we're going to do now is we want to add a tool.
And we know that we unfortunately can't add a fire crawl tool because it doesn't exist.
So we are going to add an MCP client tool, a general connector to any MCP server.
And this is the endpoint right here.
First of all you'll see here it says server transport.
This is where you pick between http streamable and the deprecated server sent events.
SE if I click this, then it it would want it to be a particular kind of URL.
We don't want that.
We want http streamable which is the type that we are using.
And now I'm going to click in endpoint and I'm going to paste in here this URL that I took just a second
ago from over there.
But and I should change it from being fixed to being an expression.
But you can see this is the endpoint that I've typed in here.
And this is the result of evaluating that expression.
And it's just kept that in there.
Because a single curly doesn't mean anything in any land.
For this to be an expression, it has to be a double curly like so.
And now this becomes an expression.
But it's not a good expression because this word firewall API key doesn't mean anything to Nan.
Do you remember what does mean something?
It was actually on the previous screen.
It was on the screen of variables.
It told us that this has to actually be not dollar JSON, because dollar JSON refers to whatever comes
in here.
There's another thing which is dollar vars, which refers to any variables that you've set.
And as soon as I do that, the URL becomes my v2 mcp.
I must remember to change that key.
Uh uh.
So, uh, so there you have it.
And now, of course, if you wish, you could just simply type this, this whole thing in as it is and
put that in this end point right here.
You don't need to do this, but it's a good, good to know that this is the way to do it.
Using Dollar Vase like this.
And then you have one place to change your fire crawl API key.
So that's what we're doing.
We've now configured the endpoint correctly.
We've told our MCP client how to access the MCP server.
And this approach for putting the API key in like this in the URL that's a bit non-standard.
Uh, it's more common to use something where the token is passed in separately.
And this dropdown gives you some of those other common ways.
And if, if you're using if you use an MCP server that uses one of those ways, you could just ask ChatGPT.
It will tell you exactly how you populate this correctly.
It's actually pretty straightforward.
In fact, to be honest, everything here has been straightforward.
All we've actually done is pasted a URL in here.
Uh, after all this terminology, all this stuff explaining MCP, actually putting it in here has been
really simple.
I basically done it that has set up this MCP client.
Uh, all we've really got left to do almost is just test this.
But there's just one more little thing I want to do.
The final thing I want to do is update the system prompt for this agent to be super clear on what it
has to do.
So let's do that.
We come here to add an option.
I'm going to add in the system message.
So I'm going to say you find sales prospects.
Based on a specific query from the user you use your tools to search the the internet and scrape websites
as necessary to find the best, uh, potential clients for the user and respond with, how many should
we say?
Let's say with with five sales prospects.
Okay, that's the system message that tells it what what business function we want it to do that has
now been saved.
Now, you may be wondering one thing.
There may be one thing on your mind that doesn't quite feel right.
Here's here's the thing that might be puzzling you.
And it should be.
It's that we've got an AI agent here.
We've given it a system prompt.
It's got to find sales prospects.
It's got a, uh, an MCP client which has just got a URL in it.
That's that's pointing to somewhere in fire crawl land.
And it's been told it needs to produce outputs in this format.
But nowhere have we actually told it that this thing gives it access to tools which can search the internet
and crawl the internet, and this is what the input should be.
This is how it uses the tools.
This is what they are all about.
And this is the difference between searching and crawling and everything else that Firebase can do.
We haven't done that.
All we've done is just put a URL in there.
Surely somewhere we have to explain what this is doing to the LM so that it knows how to use this to
achieve our objective.
Well, no, that is what MCP is all about.
Firebase will do that for us.
The MCP server that this attaches to is going to explain what it can do.
That's the point of the MCP protocol.
It's going to explain everything Firebase can do to our LM.
So it then knows how to use this tool properly.
And it's just going to work.
That's the magic.
And when you have like a packaged tool in the team has done that for you.
They've written the prompts.
They've packaged everything up into things that will make sense to the LM, but without that, in the
absence of that packaged tool, if we're using MCP, then it's the MCP server that does it for you,
and you don't need to take my word for it because we can give it a try and see.