🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)

🔧 Programmierung 🕛 vor 1 Monat 3 Min Lesezeit
0

Day 26/30: MCP Transport Options

↗ Quelle (dev.to)
🗣️ Stimme:

I recently spent hours debugging a support bot built with LangGraph and MCP, only to realize that the issue wasn't with the model or the graph, but with the transport mechanism. The bot was designed to have a conversation with a user, and it worked perfectly when run locally, but when deployed to a remote server, it would frequently lose context and respond with irrelevant answers. After digging through the logs, I discovered that the problem was due to the way I was using the MCP transport.



By default, MCP uses a local stdio transport, which is great for development and testing, but not suitable for remote deployment. The local stdio transport uses the standard input and output streams to send and receive messages, which works fine when the client and server are running on the same machine. However, when the client and server are running on different machines, a remote transport mechanism is needed.



That's where the Streamable HTTP transport comes in. This transport mechanism allows MCP to send and receive messages over HTTP, making it possible to deploy the support bot to a remote server. To switch to the Streamable HTTP transport, I needed to modify the code to use the mcp.transport.http module instead of the default mcp.transport.stdio module.



Here's an example of how to use the Streamable HTTP transport with LangGraph and MCP:




CODE
import langgraph
from mcp import Client
from mcp.transport.http import HttpTransport

# Create a LangGraph model
model = langgraph.Model()

# Create an MCP client with the Streamable HTTP transport
transport = HttpTransport("https://example.com/mcp")
client = Client(transport)

# Create a state graph with a single node
graph = langgraph.StateGraph()
node = graph.add_node("start")

# Add a conditional edge to the node
graph.add_conditional_edges(node, [
("input", "hello", "output", "Hello!"),
])

# Compile the graph and deploy it to the remote server
compiled_graph = graph.compile()
client.deploy(compiled_graph)

# Send a message to the remote server and print the response
response = client.send("hello")
print(response)






In this example, we create a LangGraph model and an MCP client with the Streamable HTTP transport. We then create a state graph with a single node and add a conditional edge to the node. Finally, we compile the graph, deploy it to the remote server, and send a message to the server to test the deployment.



One practical gotcha to watch out for when using the Streamable HTTP transport is that it requires a reliable connection between the client and server. If the connection is lost, the client will need to reconnect to the server before it can send or receive messages. To handle this, you can use a retry mechanism, such as the tenacity library in Python, to automatically reconnect to the server if the connection is lost.



As we continue to build more complex agentic AI systems with LangGraph and MCP, we'll need to consider other factors that can impact the performance and reliability of our systems, such as scalability and fault tolerance. Tomorrow, we'll explore some of the strategies for building more robust and resilient agentic AI systems.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Header and Footer not showing in Excel
1 Quelle
Burn Out, Or Fade Away