WEBVTT

00:00.160 --> 00:04.680
Okay, so we've now covered the three ways to use MCP with Nan.

00:04.720 --> 00:10.320
The one that we're going to use most of the time that will be most useful for you, which is an MCP

00:10.320 --> 00:16.960
client node like a backup, a backup in cases where there isn't a tool readily available in Nan.

00:17.080 --> 00:23.280
And you can use the wonderful standard MCP to connect to anyone that's made an MCP server that suits

00:23.280 --> 00:23.840
your needs.

00:23.920 --> 00:25.200
That's the blue one.

00:25.680 --> 00:30.560
The yellow one is if you're trying to make your own MCP server that other people might want to reuse.

00:30.920 --> 00:36.640
And then the purple one is if you want all of your workflows to be MCP servers, so that that Claude

00:36.640 --> 00:38.640
say, could run any one of them.

00:38.680 --> 00:41.560
These are the three ways to use MCP.

00:42.200 --> 00:45.560
And now after all of this, I have I have some bad news.

00:45.760 --> 00:53.600
So the bad news is that MCP actually isn't as useful in Nan as it is in some other contexts.

00:53.920 --> 00:55.480
And I say that for a couple of reasons.

00:55.480 --> 01:02.000
The first of them is that Ann doesn't support one of those three transport mechanisms that I told you

01:02.000 --> 01:04.240
about the three different architectures.

01:04.480 --> 01:11.240
The first of them is called stdio standard input output, and that approach is not supported, at least

01:11.240 --> 01:12.000
as of now.

01:12.000 --> 01:16.880
With connecting to N810, you have to use one of the other two, and that rules out a bunch of different

01:16.880 --> 01:20.320
MCP servers that are designed for that particular way of working.

01:20.320 --> 01:21.520
So that's just one of those things.

01:21.520 --> 01:26.920
It just means that you've got a slightly smaller pool of MCP servers than than the rest of the world.

01:27.080 --> 01:27.880
That's one thing.

01:28.040 --> 01:29.160
And what's the other thing?

01:29.160 --> 01:36.560
Well, the other thing is kind of funny is to say that that actually, Nan is so good that you've already

01:36.560 --> 01:39.680
got a ton of tools to choose from.

01:39.680 --> 01:45.440
And remember, I just said to you that if there isn't already an existing tool that that covers your

01:45.440 --> 01:47.680
needs, then you should use that.

01:47.680 --> 01:52.800
That means that that the Nan team or the community have worked to package something into tools.

01:52.800 --> 01:54.920
For Nan, that's the first choice.

01:55.040 --> 01:58.720
Well, that first choice is available a lot of the time.

01:58.760 --> 02:04.160
It's actually quite hard to find something that doesn't have an Nan node.

02:04.560 --> 02:07.080
And so when there is an n node, you should use that.

02:07.080 --> 02:14.000
So the times when you need to fall back to like an MCP is actually quite rare because there's so many

02:14.000 --> 02:15.840
tools already in Nan.

02:16.000 --> 02:21.880
It's almost like saying Nan is so good that there's less need for this kind of generic MCP client MCP

02:21.920 --> 02:25.240
server setup, so that's worth worth recognizing.

02:25.240 --> 02:30.480
So when it came to, to me building some interesting projects with MCP, I struggled to start with because

02:30.480 --> 02:33.880
every time I thought of a good idea, there was already an end node for that.

02:34.080 --> 02:35.280
And that kept happening to me.

02:35.320 --> 02:37.240
It's like, ah, and it ends too good.

02:37.280 --> 02:39.120
So you may you may find you have that problem.

02:39.160 --> 02:42.200
You're determined to use MCP because it's all the rage.

02:42.200 --> 02:44.000
And and everyone wants to use MCP.

02:44.080 --> 02:46.680
But it turns out Nan already got you covered.

02:46.720 --> 02:48.520
You've already got so many tools.

02:48.520 --> 02:50.680
It's not like there's such a need for it.

02:50.680 --> 02:52.920
But still, I found a couple of needs.

02:52.920 --> 02:56.600
And that's what we're gonna do in today's practical.

02:56.600 --> 03:02.480
But first, there's one more thing I want to mention that's got nothing to do with MCP, but it's something

03:02.520 --> 03:03.600
important to mention.

03:03.600 --> 03:08.520
It's something that we touched on during the lab yesterday, which I sort of introduced in a bit of

03:08.520 --> 03:12.440
a rush, and I it deserves it warrants a little bit more time.

03:12.960 --> 03:19.240
I told you that tools are the major innovation that stands behind a genetic AI.

03:19.600 --> 03:26.560
Well, in addition to tools, there is a kind of secret weapon the the the the dark secret.

03:26.600 --> 03:34.400
That's not so much of a of a secret, uh, of agents and of using llms generally is this fabulous thing

03:34.400 --> 03:38.320
called structured outputs that we did in the lab yesterday.

03:38.560 --> 03:40.520
And I just want to reinforce it.

03:40.520 --> 03:47.600
Structured outputs is when you have an AI agent or really any NLM call and you say, you know what,

03:47.600 --> 03:50.320
I don't want you just to generate any tokens.

03:50.560 --> 03:57.600
I want you to output JSON, and I want you to output JSON that conforms to a particular spec.

03:57.960 --> 04:02.400
And as you may remember, the way you do it in Nan is by setting a flag.

04:02.520 --> 04:04.410
And that flag is right there.

04:04.410 --> 04:10.490
When you're editing the agent, there is like a switch, require specific output format, and you turn

04:10.490 --> 04:18.730
that switch on, and then this new little, uh, sub node appears in your node cluster AI agent that

04:18.730 --> 04:20.770
says output parser.

04:21.050 --> 04:26.970
And you can attach that to like a structured output parser as, as I've done in this diagram.

04:27.170 --> 04:34.330
And then within that you get to specify the kind of JSON that you want it to produce, and that that

04:34.330 --> 04:35.690
is the magic.

04:35.730 --> 04:44.090
That is where you say, I want to constrain the output of this AI agent to conform to this JSON, and

04:44.130 --> 04:51.690
it's super powerful, and it allows you to build a more bulletproof approach around your your AI.

04:51.810 --> 04:53.970
And I use it all the time and so should you.

04:53.970 --> 04:59.210
And as a pro point, it's worth mentioning that for many llms, the way this works is that it's actually

04:59.250 --> 05:01.290
implemented using tools itself.

05:01.290 --> 05:06.330
It is a tool to produce structured outputs, and you can see that behind the scenes when you when you

05:06.330 --> 05:10.010
look at the, uh, the actual information exchanged with the AI.

05:10.810 --> 05:11.450
Okay.

05:11.730 --> 05:18.650
So with all of that, we have the bits and pieces now to go and do today's lab to go and actually put

05:18.650 --> 05:21.290
this MCP thing into practice.

05:21.330 --> 05:24.450
We're going to use someone else's tools.

05:24.450 --> 05:29.330
We're going to use an MCP client to connect to an MCP server and use their tools.

05:29.530 --> 05:36.010
And we're also going to take a complete workflow and make it an MCP server so that someone else can

05:36.010 --> 05:36.890
call into it.

05:36.890 --> 05:41.970
We're going to do both of those things, recognizing that the first one is the more relevant one for

05:42.010 --> 05:43.570
for for you and me day to day.

05:43.730 --> 05:44.250
Okay.

05:44.450 --> 05:45.370
Let's go and do this.

05:45.370 --> 05:45.850
Okay.

05:45.890 --> 05:47.530
Here we are back in.

05:47.690 --> 05:50.330
And and we're going to start with some housekeeping.

05:50.490 --> 05:51.890
Let's go to projects.

05:51.890 --> 05:53.570
My project right here.

05:53.730 --> 05:57.290
And from here let's go over to Project Settings on the right.

05:57.290 --> 05:58.930
And let's change the name of this.

05:58.930 --> 06:07.330
Let's make the name of this amplify, which is going to be the name of our project Save Project amplify.

06:07.370 --> 06:08.330
Save successfully.

06:08.330 --> 06:09.050
That's satisfying.

06:09.050 --> 06:11.090
And over on the left here, it becomes amplify.

06:11.330 --> 06:13.650
And I'm going to change this this folder name.

06:13.690 --> 06:17.370
Let's let's rename this folder from my first folder.

06:17.370 --> 06:20.890
Let's let's take this make this uh testing.

06:21.570 --> 06:23.250
Oh let's make it prototyping.

06:23.290 --> 06:24.010
That feels better.

06:24.010 --> 06:27.170
Prototyping rename.

06:27.330 --> 06:30.850
And then we're going to make a new folder in here.

06:30.970 --> 06:34.770
And we're going to have the new folder be uh to to.

06:34.930 --> 06:37.490
So right click here create folder.

06:37.490 --> 06:40.170
It's going to be um MCP.

06:40.210 --> 06:41.450
That's what we're going to call it.

06:41.490 --> 06:45.210
It's where we're going to build out our MCP workflows right now okay.

06:45.250 --> 06:47.810
So here we go I'm going into MCP our new folder.

06:47.810 --> 06:49.250
We're going to create a workflow.

06:49.250 --> 06:50.170
Nothing there yet.

06:50.170 --> 06:51.130
Let's change it.

06:51.410 --> 06:52.210
Uh okay.

06:52.250 --> 06:56.130
First step we are going to do the usual on chat message.

06:56.250 --> 06:58.490
Click escape to come back here again.

06:58.530 --> 06:59.730
Let's hide the chat.

06:59.850 --> 07:02.450
Nice and clean screen okay.

07:02.650 --> 07:04.730
Next up I wonder what noble add here.

07:04.730 --> 07:06.890
Let's make it an AI agent.

07:07.210 --> 07:08.610
That's what it's all about.

07:08.850 --> 07:12.210
And now here is the usual AI agent screen, and we're normally pressing escape right away.

07:12.210 --> 07:17.490
But no, I want to add one option that becomes increasingly important as we get a little bit more in

07:17.530 --> 07:18.090
depth.

07:18.090 --> 07:21.690
I'm going to click here and Max iterations.

07:21.690 --> 07:26.850
This is how many total parts of the loop, how many times it will run the loop before it says, okay,

07:26.890 --> 07:27.450
that's enough.

07:27.450 --> 07:31.250
I've done too many iterations as a sort of way to avoid it going on forever.

07:31.290 --> 07:37.170
We're going to bump that up from 10 to 30, because ten just isn't enough when it gets to hardcore stuff

07:37.170 --> 07:40.210
like we're going to be doing today and, uh, there we go.

07:40.250 --> 07:47.690
I'm also going to turn on require specific output formats because we're all about structured outputs.

07:47.690 --> 07:51.010
So there we have our AI agent.

07:51.010 --> 07:55.810
And just to keep it simple, we will have a chat model that I'm going to use open AI.

07:56.210 --> 07:59.050
You can of course use whichever one you're now comfortable with.

07:59.330 --> 08:03.730
Um but I'm going to make it a strong one this time because I want to mess around with doing some hefty

08:03.770 --> 08:08.850
stuff, but you for sure can try with a smaller one if you'd prefer, if you'd prefer the, uh, the

08:08.850 --> 08:12.650
price point or whatever, I'm going to go with GPT 5.2, the very latest one.

08:12.930 --> 08:19.570
Uh, but I am I'm going to I'm going to say the reasoning effort, which is how long, how much time

08:19.610 --> 08:23.490
does it spend to think things through before coming to the the outcome?

08:23.490 --> 08:28.250
I'm going to say low so that we're we're a little bit faster and more economical.

08:28.250 --> 08:32.450
We don't need it to be on on slow, uh, long thinking times.

08:32.450 --> 08:38.970
So this is a nice combo, most powerful model on the planet for me and with a low reasoning effort.

08:38.970 --> 08:40.570
I like this setup.

08:40.770 --> 08:43.010
Okay, so here is our agent.

08:43.010 --> 08:49.770
Let's just have some simple memory for now and we are almost ready to get started.

08:49.770 --> 08:56.010
Okay, just before we start with our MCP, I want to set this structured outputs this output parser,

08:56.050 --> 09:00.010
and I should explain that what we're going to be building here is kind of taking things we've done in

09:00.010 --> 09:01.330
the past a step further.

09:01.370 --> 09:08.860
I want to build an engine that's able to find sales prospects from the internet, so it's able to find

09:08.900 --> 09:14.220
people that we could sell our product to by being like an intelligent salesperson.

09:14.540 --> 09:14.820
Okay.

09:14.860 --> 09:21.700
Which means that what I want it to output is ultimately going to be leads leads for me or sales prospects.

09:21.740 --> 09:25.780
So let's see how can we how can we how can we do that with structured outputs.

09:25.820 --> 09:30.420
Well, we start by clicking the plus here and selecting Structured Output parser.

09:30.460 --> 09:35.500
And you'll remember that what goes here is the JSON that we want our model to produce.

09:35.580 --> 09:36.860
So what should that look like.

09:36.900 --> 09:39.140
Okay let's delete whatever's there already.

09:39.140 --> 09:41.780
And let's have our best shot at this.

09:41.940 --> 09:46.740
So what we want is something that's going to respond with sales prospects.

09:46.820 --> 09:48.500
So we want a JSON object.

09:48.500 --> 09:50.940
So open and close curly braces.

09:50.940 --> 09:56.100
It's going to have a field called prospects prospects like so.

09:56.220 --> 09:59.340
And this is going to be a list of prospects.

09:59.340 --> 10:04.260
So a list you remember in JSON is surrounded in square brackets like that.

10:04.260 --> 10:07.660
And each each element of this list is going to be another object.

10:07.660 --> 10:09.980
So we need more curly braces like this.

10:10.140 --> 10:11.900
And that's going to have some fields.

10:11.940 --> 10:12.460
Okay.

10:12.500 --> 10:15.300
This is each of the prospects in the list.

10:15.300 --> 10:17.140
So let's let's come up with each of them.

10:17.380 --> 10:19.700
Each field it's going to have a first name perhaps.

10:22.500 --> 10:25.140
The uh prospect.

10:27.340 --> 10:29.620
First name here.

10:32.340 --> 10:33.740
Last name perhaps.

10:34.020 --> 10:35.020
Sounds sensible.

10:36.340 --> 10:36.740
Uh.

10:36.980 --> 10:38.420
Last name?

10:40.020 --> 10:42.140
Uh, then we could have their company.

10:44.340 --> 10:50.900
Where they work, we could have their role, what they do.

10:51.060 --> 10:57.860
And I'm just putting in here in the values, just English language that describes to the LM what we

10:57.860 --> 10:59.300
really want in there.

10:59.340 --> 11:01.460
There's no hard and fast rules to this.

11:01.500 --> 11:06.420
It's just something that will be read in by the LM as it figures out what do we want it to generate.

11:06.580 --> 11:07.940
So that's the role.

11:07.940 --> 11:08.860
What else do we want?

11:08.980 --> 11:12.100
How about, uh, email?

11:13.460 --> 11:22.460
Predicted email address for this prospect.

11:23.460 --> 11:25.860
And then finally, rationale.

11:28.780 --> 11:41.300
Why this prospect is, uh, qualified, uh, uh, as a potential client.

11:42.220 --> 11:43.260
Oh, okay.

11:43.940 --> 11:50.580
Uh, so those are sensible fields that we might want our LLM to generate.

11:50.580 --> 11:56.380
And this is why Structured Outputs is such a powerful technique, because this gives us an opportunity

11:56.380 --> 12:01.980
to constrain what the LLM generates and to make sure that it generates something consistent with our

12:01.980 --> 12:07.300
business objective generating prospects that conform to this schema.

12:07.660 --> 12:09.220
That's that's why it's so powerful.

12:09.220 --> 12:10.900
And that's why I love to use it.
