Session
MCP C# SDK 2.0: everything that changed and how to make the most of it - Hands-On Demo
MCP has become the standard way to connect AI agents with our applications, and version 2.0 of the C# SDK changes quite a few things. The most important one: the protocol goes stateless. There is no initialization handshake or Mcp-Session-Id anymore, so an MCP server now behaves like any other ASP.NET Core application. You can put it in a container, place it behind a load balancer, and scale it out without worrying about sticky sessions.
Throughout the session we will walk through the new features using a real example: an order management MCP server that we will keep extending live.
- First the basics: a working server in just a few lines of code, and several instances answering requests behind a load balancer with .NET Aspire, with no special configuration.
- The new standardized HTTP headers: with one attribute on a tool parameter, a gateway can route calls by region without having to look at the request body. MCP finally plays nicely with the HTTP infrastructure you already have.
- If there is no session, how does the server ask the user for something in the middle of an operation? Enter Multi Round-Trip Requests, the headline feature of this version. We will see a tool that stops, asks for confirmation, and finishes the job when the client resends the call with the answer. And we will look at the traffic to see how it works under the hood.
- We will also try the two new extensions: Tasks, for long-running tools with polling, and MCP Apps, so the server can display user interface inside the client.
- And to wrap up, the practical side of migration: what keeps working from the previous version, what is marked as obsolete, the breaking changes, and how old clients coexist with new servers without having to upgrade everything at once.
David Lorenzo
Microsoft MVP Business Apps | AI @ Automation Architect at Prodware
Adeje, Spain
Links
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top