[00:00] (0.32s)
Hey, what's up? My name is Greg and
[00:02] (2.16s)
Enthropic just recently announced
[00:04] (4.16s)
support for remote MCP servers uh in
[00:07] (7.84s)
Claude. Uh remote MCP servers are super
[00:10] (10.56s)
exciting because they allow folks to
[00:13] (13.04s)
interact with an MCP server with just a
[00:15] (15.28s)
URL. And if you played with local MCP
[00:17] (17.76s)
servers, uh you know, they can be a
[00:19] (19.84s)
little clunky to get set up. You sort of
[00:21] (21.92s)
almost need to be a developer to do it.
[00:24] (24.00s)
So, uh, this sort of remote MCP support
[00:26] (26.80s)
or what Claude's calling integrations is
[00:29] (29.28s)
just going to, uh, cause an even more
[00:32] (32.64s)
meteoric rise of MCP servers than what
[00:35] (35.36s)
we've seen over the last 6 months. So,
[00:37] (37.52s)
in this video, what I want to do is show
[00:39] (39.44s)
you how you can build a remote MCP
[00:41] (41.84s)
server using Python. And we're going to
[00:44] (44.24s)
be using the fast MCP
[00:47] (47.88s)
framework. And let me show you a demo of
[00:50] (50.16s)
what you'll be able to do after we
[00:51] (51.76s)
complete this. If I come here to Claude
[00:53] (53.76s)
and I ask what time is
[00:57] (57.56s)
it, it's going to tell me that it
[00:59] (59.60s)
doesn't have access to the time and it
[01:01] (61.36s)
only has access to the date because
[01:02] (62.72s)
Claude injects it into the system
[01:04] (64.16s)
prompt. But of course, the knowledge cut
[01:06] (66.56s)
off is probably about 12 months ago and
[01:09] (69.04s)
uh you know the current up to the moment
[01:10] (70.96s)
time is not included in the knowledge
[01:12] (72.32s)
cutoff. That's just not how like large
[01:14] (74.00s)
language models actually work. uh but
[01:15] (75.92s)
what you can do is you can give this
[01:17] (77.04s)
thing a tool so that it can uh access a
[01:20] (80.32s)
Python script let's say to return the
[01:22] (82.48s)
current time and the way that we can do
[01:25] (85.36s)
that is by coming down here to settings
[01:28] (88.32s)
and scrolling down to integrations and
[01:30] (90.88s)
click add more and I built a remote MCP
[01:34] (94.88s)
server uh it is at
[01:38] (98.52s)
datetime.highhigh.ai/sse
[01:40] (100.84s)
AI/SSE. Um I believe that stands for
[01:43] (103.12s)
serverside events. Uh and then we click
[01:46] (106.20s)
add. You can see that that MCP server is
[01:49] (109.44s)
connected. Now if I click here, it says
[01:51] (111.68s)
one tool. You can see current date time
[01:53] (113.92s)
is a tool has a description of what that
[01:56] (116.40s)
tool does. And then if I come back,
[01:59] (119.12s)
start a new chat and I ask what is
[02:02] (122.92s)
the current time?
[02:08] (128.40s)
It's going to realize that it has access
[02:10] (130.40s)
to that tool. Um, it asks for permission
[02:13] (133.28s)
to use that tool. Uh, but you can see
[02:15] (135.20s)
here that it's running the uh tool
[02:17] (137.12s)
current date time. It passed in the time
[02:19] (139.60s)
zone. It knew from the MCP server what
[02:22] (142.24s)
parameters it needed to pass in for this
[02:23] (143.68s)
to work. And this is saying that it is
[02:26] (146.80s)
currently 11:40 or 10:40 Eastern on
[02:29] (149.92s)
Thursday, May 1st. And uh let's see, you
[02:31] (151.92s)
could check my clock here. Uh, that is
[02:34] (154.00s)
accurate. Um so that is how we equip uh
[02:38] (158.96s)
claude with a new capability that it did
[02:42] (162.48s)
not have before and I will show you the
[02:44] (164.80s)
code that is running for that. Uh it is
[02:47] (167.52s)
this simple file server. py using
[02:50] (170.04s)
fastmcp. We define the MCP server. Uh
[02:54] (174.40s)
and then we define a tool and that tool
[02:57] (177.04s)
quite simply is just called current
[02:59] (179.76s)
datetime uh with that optional parameter
[03:02] (182.96s)
on there. And then we have a dock
[03:04] (184.56s)
string. And this dock string will uh
[03:06] (186.96s)
describe how to use the tool, what
[03:08] (188.88s)
happens when you use the tool and you
[03:10] (190.56s)
know what arguments you need to pass to
[03:12] (192.00s)
it. Uh and then it just uh grabs the
[03:14] (194.96s)
current time zone. It grabs the current
[03:16] (196.88s)
time, formats the time and returns it.
[03:19] (199.60s)
And if it throws an error, then it kicks
[03:21] (201.52s)
back an error message so that Claude can
[03:24] (204.00s)
uh reformat its time zone. We're to make
[03:26] (206.32s)
a small change here. You can sort of see
[03:28] (208.96s)
uh what happens. Like if we could update
[03:30] (210.40s)
the dock string. Yes, sure. That sounds
[03:33] (213.04s)
great. If you're asked for the current
[03:34] (214.40s)
time or date, call this function. We'll
[03:36] (216.96s)
come here to my terminal. I'm just going
[03:38] (218.48s)
to add that
[03:42] (222.84s)
change. And then if I come over to my
[03:45] (225.76s)
render dashboard, you can see that MCP
[03:49] (229.44s)
time is currently deploying. I have a
[03:51] (231.84s)
custom domain set up here,
[03:53] (233.88s)
datetime.hihigh.ai, that points to this
[03:56] (236.32s)
particular server. Um, and then once
[03:59] (239.04s)
this deployment finishes, it will be
[04:01] (241.28s)
about a minute, we could reload the tool
[04:04] (244.32s)
via cloud, and you'd see that updated
[04:05] (245.92s)
dock string. All right, so now you've
[04:07] (247.12s)
seen the end state of how we got here.
[04:08] (248.56s)
Let's take a look at building with
[04:10] (250.92s)
fastmcp from scratch. All right, so I'm
[04:13] (253.76s)
going to come here to
[04:16] (256.20s)
gomcp.com or you can visit their GitHub
[04:19] (259.36s)
page. Uh, you'll find very similar
[04:21] (261.60s)
information on both. I generally have
[04:23] (263.52s)
found uh the website to be a little bit
[04:25] (265.20s)
more pleasant. Uh, so I'm just going to
[04:27] (267.12s)
click copy here on their getting
[04:29] (269.20s)
started. Um, so I liked this version
[04:31] (271.36s)
here. So this is kind of the the hello
[04:33] (273.20s)
world with a little bit of extra
[04:34] (274.64s)
seasoning on it. Um, so we import the
[04:36] (276.88s)
library and then we create a new MCP
[04:39] (279.76s)
server and we name this thing. So in
[04:41] (281.84s)
this case, I'm going to call this uh
[04:43] (283.68s)
date and
[04:45] (285.00s)
time. All right. And then um, so MCP
[04:48] (288.16s)
with instructions. This is going to
[04:49] (289.36s)
provide a little bit of additional
[04:51] (291.12s)
detail to the model on how and when to
[04:54] (294.64s)
use this. So we will add that in there
[04:58] (298.92s)
and see if cursor uh there we go. The
[05:03] (303.36s)
server provides the current date and
[05:04] (304.56s)
time. Call current daytime to get the
[05:06] (306.00s)
current date and time. So that's great.
[05:07] (307.20s)
So we have uh now we just we have a
[05:09] (309.36s)
server. It doesn't do anything yet, but
[05:10] (310.72s)
we do have a server. Uh so the first
[05:13] (313.04s)
thing you're going to want to do and
[05:14] (314.32s)
probably you know the current state of
[05:15] (315.68s)
affairs is that tools are the things
[05:17] (317.44s)
that most people associate with MCP
[05:19] (319.52s)
servers. Um though I suspect we'll start
[05:21] (321.60s)
seeing a lot more use of resources and
[05:24] (324.64s)
uh prompts but uh tools is probably what
[05:26] (326.56s)
you're going to be working with right
[05:27] (327.52s)
now. Uh so we're going to create a new
[05:29] (329.20s)
tool. Uh we're going to call this tool
[05:31] (331.36s)
uh it looks like actually cursor knows
[05:32] (332.88s)
exactly what I want to do here. So uh
[05:34] (334.64s)
we're going to create one called uh
[05:36] (336.00s)
current date and time. And it filled in
[05:38] (338.48s)
the dock string for me. Uh so that's
[05:40] (340.40s)
fantastic. And it looks like cursor is
[05:42] (342.24s)
just going to I have uh already done
[05:44] (344.24s)
this before. Let's just here we'll do it
[05:46] (346.16s)
the proper
[05:47] (347.48s)
way. Uh please write the rest of this
[05:50] (350.48s)
function which given a time zone passed
[05:53] (353.36s)
in via the arguments will calculate the
[05:58] (358.56s)
current time and date formatted in a
[06:01] (361.20s)
string and return it.
[06:13] (373.04s)
All right. Excellent. I believe that
[06:15] (375.60s)
will work. Let's move these where I
[06:18] (378.08s)
think they belong. Although I know some
[06:21] (381.36s)
folks do the inline imports.
[06:24] (384.44s)
Um, great. And so now we have our
[06:27] (387.40s)
function. Super simple function really.
[06:29] (389.60s)
We're just talking about three lines
[06:30] (390.80s)
here uh with uh some error handling. Now
[06:34] (394.32s)
we'll try this out. It does give you a
[06:36] (396.40s)
couple different ways to test it. Um,
[06:38] (398.72s)
you can use fast MCP as an MCP client.
[06:42] (402.88s)
So, when you're talking about MCP,
[06:44] (404.16s)
there's the client and the server.
[06:46] (406.16s)
Typically, that client's going to either
[06:47] (407.68s)
be enthropic or like the cloud app or
[06:51] (411.20s)
say for instance, cursor is probably the
[06:53] (413.44s)
most popular MCP client. Uh, an MCP
[06:57] (417.04s)
client can interact with a MCP server.
[06:59] (419.60s)
Um, and it doesn't an MCP client doesn't
[07:01] (421.76s)
have to be a fully featured app. It can
[07:03] (423.84s)
be a script. Uh, Pyantic AI uh, is one
[07:07] (427.04s)
that I've used in the past to act as an
[07:08] (428.96s)
MCP client to interact with MCP servers.
[07:12] (432.24s)
You can also use FastMPP for this. Uh, I
[07:14] (434.48s)
think there's a better way to do this.
[07:15] (435.92s)
Uh, so for right now, I'm just going
[07:18] (438.76s)
to do this to uh, run our script. And
[07:23] (443.60s)
let's see if we can just simply get it
[07:26] (446.64s)
to start. So, we can use this fast MCP
[07:29] (449.68s)
run my server.py MCP command here. Uh, I
[07:33] (453.68s)
can rename this because mine is actually
[07:36] (456.00s)
called local
[07:38] (458.28s)
server and my server starts up.
[07:41] (461.04s)
Enthropic has launched a really useful
[07:43] (463.04s)
tool for debugging MCP servers and
[07:45] (465.76s)
building MCP servers called uh the MCP
[07:48] (468.48s)
inspector. You can run this with just
[07:50] (470.48s)
this npx command. You don't even have to
[07:52] (472.88s)
uh do any installation ahead of time.
[07:56] (476.40s)
And if we drop that command in there,
[07:59] (479.04s)
the command is going to be fastmcp and
[08:01] (481.12s)
the arguments are going to be everything
[08:02] (482.56s)
that comes after it. Uh if I come up
[08:05] (485.04s)
here to tools and click on tools, you
[08:07] (487.52s)
can see a list of all the tools that are
[08:09] (489.04s)
available. So my MCP inspector is
[08:11] (491.28s)
realizing that there is a current date
[08:13] (493.44s)
time uh tool and I have the option here
[08:16] (496.64s)
just to very simply run it and it
[08:18] (498.40s)
populates the argument here with
[08:20] (500.56s)
whatever the default was. So, I click
[08:22] (502.24s)
run tool and I get the current time and
[08:25] (505.52s)
I see that a successful run. Uh, this
[08:27] (507.92s)
tool is so useful. Sorry, the MCP
[08:30] (510.48s)
inspector is so useful because when
[08:33] (513.04s)
you're building MCP servers, uh, you're
[08:36] (516.00s)
ultimately going to be using an LLM as
[08:38] (518.80s)
the client and the driver for that. And
[08:40] (520.80s)
LMS are is kind of like the worst mix of
[08:43] (523.20s)
computer programming of being
[08:44] (524.24s)
non-deterministic and opaque. Um, so
[08:47] (527.20s)
this gives you a deterministic and
[08:49] (529.84s)
transparent way to interact with your
[08:52] (532.00s)
MCP servers. And I'm very glad that uh
[08:54] (534.72s)
they shipped this. We could attach this
[08:58] (538.24s)
MCP server to cursor or to uh claw
[09:03] (543.20s)
desktop. Um, because it is a local MCP
[09:06] (546.32s)
server. It's running locally on my
[09:08] (548.80s)
machine. no one outside of my machine
[09:11] (551.36s)
can use it, but the clients that are
[09:13] (553.28s)
running locally on my machine can use
[09:15] (555.44s)
it. Um, and so, you know, this is uh
[09:18] (558.24s)
it's going to be hard for me to
[09:19] (559.52s)
distribute this to other folks, right?
[09:20] (560.96s)
And so, there's a whole host of
[09:23] (563.44s)
advantages that come if we can take this
[09:25] (565.76s)
local MCP server and turn it into a
[09:28] (568.96s)
remote MCP server. So, let's see how we
[09:31] (571.20s)
do that. Say two big differences here.
[09:34] (574.40s)
Uh, first, we're going to go under
[09:36] (576.24s)
transports. Standard IO is the default
[09:39] (579.92s)
transport for transferring information
[09:42] (582.80s)
from the MCP server to your MCP client.
[09:46] (586.64s)
Um, this works locally. If you want it
[09:49] (589.76s)
to work remotely, you need to use a
[09:52] (592.24s)
different transport. Uh, and I'm
[09:55] (595.44s)
recording this on May 1st. This is the
[09:57] (597.04s)
day that the announcement of cloud
[09:59] (599.44s)
integrations came out. So, I want to get
[10:01] (601.20s)
this video out. Uh currently as of today
[10:04] (604.72s)
the way of doing this remotely is with
[10:06] (606.88s)
SSE transport which is called serverside
[10:09] (609.56s)
events. This method though has been
[10:12] (612.84s)
deprecated and we are waiting on
[10:15] (615.76s)
streamable HTTP support in fastmcp.
[10:19] (619.52s)
there's an issue open to support this
[10:21] (621.60s)
and the creator of FastMPP said as soon
[10:25] (625.52s)
as the low-level SDK uh as soon as it's
[10:28] (628.32s)
available in the low-level SDK he will
[10:30] (630.40s)
roll out support for it. Very possible
[10:32] (632.56s)
by the time you're watching this video
[10:34] (634.16s)
you're going to want to do everything
[10:35] (635.12s)
that I do here except you're just going
[10:36] (636.96s)
to want to use the streamable HTTP
[10:39] (639.76s)
transport as opposed to the SSSE. But I
[10:42] (642.40s)
don't think it's going to be a terribly
[10:43] (643.92s)
big shift for you. And so the actual
[10:45] (645.84s)
code that I used came from uh under
[10:47] (647.92s)
fastmcp server under servers uh under
[10:51] (651.04s)
SSE transport here. Uh and I used this
[10:54] (654.88s)
code to run uh asynchronously. And I'm
[10:58] (658.88s)
going to paste that there. And I knew
[11:01] (661.12s)
that I would have to do some different
[11:03] (663.28s)
configuration of uh the way that the
[11:06] (666.16s)
server ran once I pushed it to render.
[11:08] (668.16s)
So I wanted to have control over the
[11:09] (669.52s)
host and port etc. Uh and in fact the
[11:12] (672.08s)
way I'll do this is just to come here
[11:13] (673.60s)
and say please modify this to work on
[11:23] (683.72s)
render. All right. And there we go. Uh
[11:26] (686.56s)
that is all it takes to get a remote MCP
[11:29] (689.44s)
server up and running using fast MCP and
[11:32] (692.08s)
Python. I'm super excited by these cloud
[11:34] (694.32s)
integrations. So here's what we know
[11:35] (695.44s)
about MCP. you know that they've been
[11:37] (697.28s)
really popular over the last 6 months
[11:39] (699.20s)
and yet to use them you needed to
[11:41] (701.36s)
basically be a developer cuz you need to
[11:42] (702.80s)
be able to clone a repository and then
[11:45] (705.12s)
figure out how to set up maybe a virtual
[11:47] (707.12s)
environment and mess with like a JSON
[11:49] (709.84s)
file to point a claw desktop at that
[11:52] (712.88s)
thing. So these things have been pretty
[11:54] (714.72s)
clumsy to work with, but yet there's
[11:56] (716.56s)
still been incredible hype around them.
[11:58] (718.48s)
And Claude just announced that they're
[12:01] (721.12s)
no longer going to be clumsy. you're
[12:02] (722.72s)
just going to have to paste in that URL
[12:05] (725.52s)
and you're going to have access to an
[12:06] (726.72s)
MCP server. Uh, and that's a really big
[12:09] (729.52s)
deal uh because now I think you're going
[12:12] (732.08s)
to see a lot more adoption from uh less
[12:15] (735.28s)
technical users. Uh, I think this will
[12:17] (737.84s)
put more pressure on OpenAI. Not that
[12:20] (740.08s)
they necessarily needed more pressure,
[12:21] (741.20s)
but I suspect you'll see remote MCP
[12:23] (743.28s)
support coming very soon there. Uh, and
[12:26] (746.00s)
then because of that, there's going to
[12:27] (747.68s)
be a whole lot more people who are uh
[12:30] (750.40s)
using these MCP servers. So, I think
[12:31] (751.92s)
you're going to start seeing a lot more
[12:33] (753.04s)
companies launch remote MCP servers. Uh,
[12:36] (756.16s)
and this is, uh, a very, very exciting
[12:38] (758.80s)
time to know how to code. And I think if
[12:40] (760.24s)
you're getting started now, you got a
[12:41] (761.36s)
little bit of a head start. Cloud is
[12:43] (763.04s)
just rolling this out to users on the
[12:46] (766.00s)
Max plan or on the enterprise plan. It's
[12:49] (769.28s)
coming to pro users soon, but there
[12:51] (771.28s)
hasn't been a huge push just yet. So, I
[12:53] (773.76s)
would encourage you to play with this.
[12:54] (774.88s)
You can get your own MCP server up and
[12:56] (776.64s)
running pretty quickly. And uh can't
[12:58] (778.72s)
wait to see what you