# Stream AI Responses with MCP HTTP in React & #n8n ## Metadata - **Published:** 6/10/2025 - **Duration:** 9 minutes - **YouTube URL:** https://youtube.com/watch?v=nUYiA0CqKhM - **Channel:** nerding.io ## Description Join the Community: https://nas.io/vibe-coding-retreat Get 50% off from http://supermachine.ai/ for 1-click install MCP servers (NERDINGIO) 📩 Newsletter: https://sendfox.com/nerdingio In this video, we explore how to use the MCP HTTP Streamable spec to enable real-time AI communication in both n8n workflows and React apps—without needing WebSockets or SSE. 🔁 HTTP Streamable is a powerful transport option in the Model Context Protocol (MCP) that works over simple POST requests with chunked responses, making it: ✅ Easier to implement ✅ Compatible with most web hosts ✅ Ideal for serverless and frontend environments 🛠 What You’ll Learn: - How HTTP Streamable works in the MCP protocol - Building streamable tools in n8n using built-in HTTP and function nodes - Connecting React frontends to MCP streamable agents - When to use HTTP Streamable vs SSE 💬 Comment below: Are you building streamable tools or sticking with SSE? 👍 Like & Subscribe for more AI workflow tips! ## Key Highlights ### 1. MCP HTTP Streamable Endpoints The video demonstrates implementing MCP (Message Channel Protocol) using HTTP streamable connections, offering advantages like statelessness and compatibility with NATS. ### 2. Backward Compatibility with SSE The video shows how to transition from the deprecated SSE (Server-Sent Events) to streamable HTTP while maintaining compatibility with existing resources and tools. ### 3. Interactive Client for MCP Debugging An interactive React-based client is built to visualize and debug MCP interactions, providing a console-like interface for testing tool invocations and observing session details. ### 4. N8N Integration with HTTP Streamable The video explains how to utilize MCP HTTP streamable APIs within N8N using both a community node and the native MCP client, showcasing workflows like listing tools and executing searches. ### 5. Community Contributions Highlighted The presenter emphasizes the importance of community contributions to N8N, specifically acknowledging a contributor for implementing HTTP streamable support. ## Summary ## Video Summary: Stream AI Responses with MCP HTTP in React & #n8n **1. Executive Summary:** This video tutorial demonstrates how to implement real-time AI communication using MCP (Model Context Protocol) HTTP streamable connections within both n8n workflows and React applications. It highlights the advantages of HTTP streamable over SSE, showcasing its ease of implementation, compatibility with most web hosts, and suitability for serverless and frontend environments. **2. Main Topics Covered:** * **Introduction to MCP HTTP Streamable:** Explanation of MCP and the HTTP Streamable transport option, emphasizing its benefits (statelessness, NATS compatibility). * **Backend Implementation (Node.js):** Demonstrates updating an existing SSE-based server to support MCP HTTP streamable endpoints using a custom handler to process POST requests, manage session IDs, and handle requests. * **Frontend Implementation (React):** Building an interactive React-based client for debugging and visualizing MCP interactions, allowing users to test tool invocations and inspect session details in a console-like interface. * **n8n Integration:** Showcasing the use of MCP HTTP streamable APIs within n8n workflows, using both a community node and potentially the native MCP client for listing tools and executing searches. Importance of community contributions is also mentioned. * **Backward Compatibility:** How to maintain compatibility with existing SSE resources while transitioning to streamable HTTP. **3. Key Takeaways:** * **HTTP Streamable Advantages:** MCP HTTP streamable offers a powerful and simple alternative to WebSockets and SSE for real-time AI communication, providing statelessness and broad compatibility. * **React Interactive Client:** Building a custom interactive client enables efficient debugging and visualization of MCP interactions on the frontend. * **n8n Integration Flexibility:** MCP HTTP streamable can be integrated into n8n workflows using community nodes or potentially the native client (depending on specific implementation needs). * **Community Contributions are Valued:** The video highlights the significant role of community contributions in expanding the capabilities of tools like n8n. **4. Notable Quotes or Examples:** * *"So what we're going to do is we're going to take a look at this code and basically what we need to go into is our server. So, as you can see right here, we still have our SSE, our old uh transport there, and we have the ability to pull in messages, but now we want to expand this so that we can still use these same tools, but actually use our MCP streamable."* - Illustrates the transition from SSE to streamable HTTP. * Example: Showing how to list available tools and then executing a search tool via the interactive React client to showcase real time API interaction * Shout out to Community: Highlights a contributor implementing HTTP streamable support for n8n **5. Target Audience:** * Software developers working with AI models and real-time communication. * Developers using React for frontend development and n8n for workflow automation. * Individuals interested in Model Context Protocol (MCP) and its implementations. * Those seeking alternatives to WebSockets and SSE for streaming AI responses. ## Full Transcript Hey everyone, welcome to Nering.io. I'm JD and today what we're going to go through is a couple different examples of how to do MCP HTTP streamable connections. We're going to take a look at a client node in React and then we're also going to look at the back end of how you can set up your own compatible HTTP streamable events. With that, let's go ahead and get started. All right. So, MCP came out with SSE a while back and then they even came out with streamable HTTP. And I've been digging into that, but I also wanted to figure out uh this example where it's talking about backwards compatibility. And I found that interesting because I already had the SSE examples from before. So, what I want to do is take that same uh repo and actually update it so that I have the uh MCP slash, we still have our SSE and we still have our messages. So, we've kind of we know that there's other transports that kind of adhere to all of this, right? And so this is an example of how we can take the deprecated SSE and go with a more streamable HTTP endpoint which allows us for stateless applications and things like that which is super helpful with like NAD. So what we're going to do is we're going to take a look at this code and basically what we need to go into is our server. So, as you can see right here, we still have our SSE, our old uh transport there, and we have the ability to pull in messages, but now we want to expand this so that we can still use these same tools, but actually use our MCP streamable. Really, all we need to do is just add this app.all/MCP, all slashmcp use our streamable uh handler and then actually pass our server as well as our uh request. So this HTTP uh handler that I built is right here. So first we're looking to see if it's a post. We want to look for our MCP session ID. We're actually going to then make sure that we if we don't have a session ID, we're going to random UU ID it. We're going to make that into our session generator. We're going to session initialize and then we're going to actually uh pass that information as a valid request. If it's already got a session ID, then we're going to actually use the transport that it's already requested and its operation for SS uh for the session ID and then execute or handle the request in that way. If not, we have some error handling here. So based on this, let's go ahead and take a look at the inspector and let's see if we can connect to it. So I already had it uh connected. We're just going to go ahead and do a new connection. We can look. So these are the previous resources that we had before. Previous resource templates that we've had before, our list of prompts our tools. So add and search. and we haven't done much with ping or sampling or roots. So, we know that we have access to all our tools and we're hitting our NCP endpoint the same as we were hitting the SSC uh endpoint before. So, now let's take a look at what we're going to do for the front end. So, what we're going to do is this is our previous example. You can see we still have our tools. We can still connect to MCP, but now I want to make an interactive client. I actually did this I've been doing this more often where just kind of want to have like a way to visualize what's actually happening on the server and we can give it like different implementations and things like that. So we have our uh MCP we can go ahead and connect to that. It's going to let us know what our session is. We can actually do a quick select of tools and we can also see where we're have some conflict errors. We can actually see the session ID that we have available here too. We also have what tools are available. So when we click list tools, the undefined is the description, but we can actually see we can actually take that tool. If we wanted to do an add, we can just do an add and we can actually see that it's interfacing. So we're actually adding some uh custom custom abilities. We have our ability to look at prompts. Can actually see this being different kind of coded. And then we can actually do help for a little bit of what is actually going on with all these things in order to have more of an interactive service. Again, if we wanted to select a tool and go ahead and send another invocation, we can go ahead and connect. And it's going ahead and calling the tool for adding. So let's take a look at how I actually built the uh the interactive client. So basically we still have our interactive clients. We're connecting to our MCP base URL. So this is our backend. Probably do that with like a bite environment variable. But then what we're doing is we're actually using a lot of different uh basically like is there an error or starts with and in order to do color coding and actually kind of build ourselves our own little console so that we can actually debug and interact with MCP. Again, here's our client. We're initializing based on our session ID. So if we have that session ID, we can actually interact with the client otherwise create a new new client. Then we're actually fetching information pulling back what our session is. Here's our uh new transport URL. We have our on close as well as our on error. We even have notification handlers. Um and then finally we have our connect to our transport. The rest of this is essentially adding like logging and state and things like that so we can actually see what's going on. Again, we have the ability to list out our tools very similar to what we were doing with uh Brave search. And there's also one for um for prompts and we can have the ability to disconnect. So, we're adding in a lot of functionality on the front end again just to make like an interactive client of how we can actually interface with this tool. The next thing that we're going to do is uh actually go look at this in NAND. And before we do that, I just want to give a shout out to the community. You know, uh there's only so much I can put into N8 MCP. And so when you contribute, I truly appreciate it. And uh this the HTTP streamable being put into NAN was actually by a contributor. So again, huge thanks to the uh community. Uh, I know there's more bugs. If more people can help and contribute, it'll be super helpful. All right. So, now if we go into the MCP uh in NAN, there's two ways to do this. So, understand that in this example, I'm using the N8N MCP client community node, not to be confused with the N8N uh native MCP client. There's also a way to do that. They they use SSE as a way to to hit that particular endpoint. So in this example, if we want to create an HTTP streamable account for the community node, you go ahead and you click create and then you can just do MCP. And as you can see, we now have the HTTP streamable API. In this case, I'm just going to point it to the streamable URL of MCP. Uh, again, as before, you can change um, you know, message post, which you don't necessarily need, as well as our additional headers. All right. So, now what we're going to do is we're going to take a look at just a basic example. So, we have an MCP standalone, which basically has the HTTP removal account. We're just going to go ahead and list our tools so we can actually see what the schema is that it returns. So we know we have our ad. We know we have our search. And then what we're going to do is we can actually look at this agent. So again, you could connect this to a chat. What I'm doing is I'm just hard coding it saying searching for MCP. And then what we're going to do is we're going to list our tools same as before. And we're just going to execute dynamically. So you can see that we're using a streamable. You'll see that we're using streamable. I am doing the tool name, but we're autopassing the tools to override and basically look at what its uh parameters are. You can also define the uh don't have to define the tool. So now if we go ahead and run this, it's listing as well as trying to uh search. And so as part of the search, you can actually see that it was executed and that we got search information back. All right, that's it for us today everyone. So what we went through is a combination of how you can actually use HTTP streamable events in both the front-end client as well as setting up the backend server. We also took a look at how you can actually connect these in any with that. Happy nerding. --- *Generated for LLM consumption from nerding.io video library*