
Lesson Description
The "Server-Side Events" Lesson is part of the full, Complete Intro to MCP course featured in this preview video. Here's what you'd learn in this lesson:
Brian discusses server-side events. SSE's provided a way to use remote MCP servers that functioned like local stdio servers but operated more like traditional API servers
Transcript from the "Server-Side Events" Lesson
[00:00:00]
>> Brian Holt: So everything we've been doing is through standard IO. Everything that we've done so far, more or less probably could be done by a remote MCP server. Is that true? Yeah, it could be done as a remote MCP server. It's good to just start with standard IO. I think cuz that's how most MCP servers are being run at the moment.
[00:00:23]
I view streamable HTTP in the server side event. They do add some complexity to them as being something that you would run as a company, right? So like as neon we run, we actually have all three of the MCP servers available because it's really easy to add. But we run certainly a remote MCP server.
[00:00:43]
So Cursor, for example, can call our MCP server, which then we could manage people's services for them. We're not gonna dwell too much on server side events. SSE as it's frequently abbreviated. The problem with standard IO transport is it runs locally, right, it's not able to run on the cloud, it's not able to run for your business, for your clients.
[00:01:10]
Wherever the standard IO server is running, it is necessarily running on that machine. So it has to have some level of access. You can try and lock it down, you can try and run it in container, but at the end of the day it's code that's being executed somewhere that you control, which is always scary a little bit, right?
[00:01:28]
So that's why server side sses were invented. I would say invented, but used for MCP servers. So this was the first attempt of a remote MCP server. It's a bit simpler, but it works relatively similar to how standard IO does, which is why I think they went with it, is that the mental model of how SSE works, works really similar to standard IO.
[00:01:54]
And you can see here, this is just directly from their docs here, that it has a sub process, it exchanged message, it rans standard in. It's basically like bridging standard IO to the Internet, right? This had some issues. The biggest issue is that if it's on a stable network, everything works okay.
[00:02:15]
But the moment that your server drops it, you kinda lose state and then you have to re establish context. It's stateful, as we were talking about earlier. And that just does not work very well for anything that's over a network [LAUGH] for that matter, right? So they needed something that was more resilient to dropped sessions, resumed sessions, a bunch of stuff like that.
[00:02:41]
And SSEs were just not a good fit for that. If you wanna read more about it, I'm not gonna talk any more about it here. This is all from the docs here. It's still supported, we still support it for MCP, but streamable HTTP is much more of the way forward here.
[00:02:57]
In other words, I want you to be aware of it, so if you encounter it, you're not afraid of it or anything like that. But I don't think you should be writing these. So I'm not gonna show you how to write these. Not that it's very different from what we've been writing.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops