MCP C# SDK Explained — Now with Protocol 2025‑06‑18 Support

Morteza JangjooMorteza Jangjoo
3 min read

The world of .NET keeps evolving — and so do the tools we use to build secure, model-connected applications. One of the rising stars in this ecosystem is the MCP C# SDK (Model Context Protocol), a lightweight, extensible, and secure protocol designed for building AI-connected applications in .NET.

Recently, Microsoft announced a major update for the MCP C# SDK, adding support for Protocol Version 2025‑06‑18, bringing enhanced features for authentication, structured output, and interactive user experiences.

Let’s dive into what MCP is, what the SDK offers, and what the new update means for .NET developers.


🌐 What is MCP?

MCP (Model Context Protocol) is a lightweight communication protocol designed for secure interaction between applications and external AI models, tools, or services. It facilitates:

  • Fast, reliable message exchange

  • 🔐 Secure communication with OAuth-style authentication

  • 🤖 Tool invocation via structured JSON inputs/outputs

  • 🔄 Two-way data interaction between servers and clients (including LLMs)

MCP is especially useful for developers building AI copilots, agent frameworks, or tool-augmented LLM apps within the .NET ecosystem.


🛠️ Getting Started with MCP C# SDK

Install via NuGet:

dotnet add package MCP.Server

A basic MCP server can be created like this:

using Mcp.Server;

var server = new McpServer(new McpServerOptions
{
    Endpoint = "http://localhost:5000"
});

server.OnMessage(async (session, message) =>
{
    Console.WriteLine($"Received: {message.Payload}");
    await session.SendAsync(new McpMessage
    {
        Type = "response",
        Payload = $"Echo: {message.Payload}"
    });
});

await server.StartAsync();

🚀 What’s New in Protocol 2025‑06‑18?

The latest version of MCP protocol (released June 18, 2025) introduced powerful new capabilities:

✅ 1. Upgraded Authentication Model

OAuth 2.0-style authentication is now more clearly defined, separating roles of Authorization Server and Resource Server. This enables integration with enterprise identity providers and more secure scenarios.

Client requests must now include the MCP-Protocol-Version HTTP header to indicate protocol version.


🔄 2. Elicitation Support (Ask the User)

The server can now ask users for additional inputs during tool invocation. This allows dynamic, interactive experiences with users when model context is insufficient.

await session.ElicitAsync(schema: yourJsonSchema);

Use cases include:

  • Asking for missing filter criteria

  • Choosing between options

  • Confirming actions before executing a tool


📦 3. Structured Tool Output

When using UseStructuredContent = true, tools can now produce structured outputs based on predefined JSON schema. This makes it easier for LLMs to parse, reason, and act on results — a major step for agentic workflows.


🔗 4. Resource Linking in Tool Responses

Tools can now return links to other MCP resources. This allows chaining and contextual linking between tools and datasets, enabling complex workflows and UI-enhanced exploration.


🧹 5. Simplified Protocol (No More Batching)

The batching feature introduced in March 2025 has been removed, in favor of simplicity and better compatibility with async workflows.


📝 6. Friendly Titles and Metadata

Resources (tools, prompts, datasets) now support a title field in addition to name, allowing cleaner display in UI layers like Copilot Chat, and better metadata via _meta.


🧠 Why Should .NET Developers Care?

If you're building:

  • AI copilots with LLMs

  • Interactive agents that perform tasks

  • Data pipelines with external tools/models

  • Custom assistant frameworks

… then MCP gives you a secure, open, and powerful protocol to standardize how your tools and AI communicate — all in C#.


📚 Further Resources


✨ Final Thoughts

The MCP ecosystem is growing fast. With the new 2025‑06‑18 protocol update, developers have access to deeper interactivity, stronger security, and a structured way to build intelligent, responsive apps that talk to models, tools, and users — all in the comfort of C#.

I’m Morteza Jangjoo and “Explaining things I wish someone had explained to me”


0
Subscribe to my newsletter

Read articles from Morteza Jangjoo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Morteza Jangjoo
Morteza Jangjoo