<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ziya Abbas</title>
    <description>The latest articles on DEV Community by Ziya Abbas (@ziya_abbas_e1e5d8bbcc5c3b).</description>
    <link>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3998124%2F8a5147ed-99a8-45c6-96af-642d8450f607.png</url>
      <title>DEV Community: Ziya Abbas</title>
      <link>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ziya_abbas_e1e5d8bbcc5c3b"/>
    <language>en</language>
    <item>
      <title>Building Your First AI Agent with .NET and Azure AI Foundry</title>
      <dc:creator>Ziya Abbas</dc:creator>
      <pubDate>Sun, 19 Jul 2026 15:23:53 +0000</pubDate>
      <link>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b/building-your-first-ai-agent-with-net-and-azure-ai-foundry-13pl</link>
      <guid>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b/building-your-first-ai-agent-with-net-and-azure-ai-foundry-13pl</guid>
      <description>&lt;p&gt;If you're a .NET developer looking to break into AI engineering, agents are the single best place to start. They're the point where "calling an LLM API" turns into "building a system that reasons, uses tools, and takes action" — and Azure AI Foundry Agent Service, paired with .NET, makes this surprisingly approachable.&lt;/p&gt;

&lt;p&gt;In this post, I'll walk through exactly how to stand up your first agent end-to-end — from the Azure side setup to the actual C# code — and share the full walkthrough in video form as well.&lt;/p&gt;

&lt;p&gt;🎥 &lt;strong&gt;Watch the full hands-on video here:&lt;/strong&gt; &lt;a href="https://youtu.be/mrsEsculrNg" rel="noopener noreferrer"&gt;https://youtu.be/mrsEsculrNg&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Agents, and Why Now
&lt;/h2&gt;

&lt;p&gt;Most of us started our AI journey with a simple chat completion call — send a prompt, get text back. That's fine for Q&amp;amp;A, but it falls apart the moment you need the model to &lt;em&gt;do&lt;/em&gt; something: run code, search documents, call an API, or hold a multi-turn conversation with real state.&lt;/p&gt;

&lt;p&gt;That's exactly the gap Foundry Agent Service closes. An agent in Foundry is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Durable&lt;/strong&gt; — it lives as a resource in your Foundry project, not in your app's memory&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool-aware&lt;/strong&gt; — it can invoke built-in tools (like a code interpreter) or your own custom functions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateful&lt;/strong&gt; — conversations persist and carry context across turns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the best part for us .NET folks: the entire thing is callable from clean, typed C# — no wrestling with raw REST payloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Need
&lt;/h2&gt;

&lt;p&gt;Before writing any code, set up the Azure side:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;An Azure AI Foundry project&lt;/strong&gt; with a chat model deployed (e.g., &lt;code&gt;gpt-4o-mini&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Foundry User RBAC role&lt;/strong&gt; assigned to your account at the resource/resource-group scope — this is the single most common blocker people hit (a silent 403 when calling the SDK), so don't skip it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;az login&lt;/code&gt;&lt;/strong&gt; run locally, so your code can authenticate without hardcoding any keys&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you've worked with Cognitive Services roles before, note that agent management needs this &lt;em&gt;separate&lt;/em&gt; Foundry-specific role — that trips up a lot of people coming from plain Azure OpenAI usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the .NET Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dotnet new console &lt;span class="nt"&gt;-n&lt;/span&gt; FoundryAgentLab &lt;span class="nt"&gt;-f&lt;/span&gt; net10.0
&lt;span class="nb"&gt;cd &lt;/span&gt;FoundryAgentLab
dotnet add package Azure.AI.Projects
dotnet add package Azure.Identity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set your environment variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PROJECT_ENDPOINT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://&amp;lt;your-resource&amp;gt;.services.ai.azure.com/api/projects/&amp;lt;your-project&amp;gt;"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MODEL_DEPLOYMENT_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AGENT_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"my-dotnet-agent"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating the Agent
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Azure.AI.Projects&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Azure.AI.Projects.OpenAI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Azure.Identity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;projectEndpoint&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"PROJECT_ENDPOINT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;InvalidOperationException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Missing environment variable 'PROJECT_ENDPOINT'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;modelDeploymentName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"MODEL_DEPLOYMENT_NAME"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;InvalidOperationException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Missing environment variable 'MODEL_DEPLOYMENT_NAME'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;agentName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetEnvironmentVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"AGENT_NAME"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;InvalidOperationException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Missing environment variable 'AGENT_NAME'"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;AIProjectClient&lt;/span&gt; &lt;span class="n"&gt;projectClient&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Uri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;projectEndpoint&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;AzureCliCredential&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="n"&gt;AgentDefinition&lt;/span&gt; &lt;span class="n"&gt;agentDefinition&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;PromptAgentDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modelDeploymentName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Instructions&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"You are a helpful .NET/Azure tutor that answers general questions"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="n"&gt;AgentVersion&lt;/span&gt; &lt;span class="n"&gt;newAgentVersion&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projectClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Agents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateAgentVersion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;agentName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;agentDefinition&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Agent created — Id: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;newAgentVersion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, Version: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;newAgentVersion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few things worth calling out here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;AIProjectClient&lt;/code&gt;&lt;/strong&gt; is your single entry point into the project — agents, conversations, and responses all hang off it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;PromptAgentDefinition&lt;/code&gt;&lt;/strong&gt; is a &lt;em&gt;declarative&lt;/em&gt; agent — you describe its model and instructions, and Foundry handles the execution plumbing.&lt;/li&gt;
&lt;li&gt;Notice the agent has a &lt;strong&gt;version&lt;/strong&gt;. Every time you update it, Foundry keeps a version history — helpful when you're iterating on prompts and want to roll back.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Talking to the Agent
&lt;/h2&gt;

&lt;p&gt;Creating the agent is half the story — now let's have an actual conversation with it, with context retained across turns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;OpenAI.Responses&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Create a conversation to maintain context across turns&lt;/span&gt;
&lt;span class="n"&gt;ProjectConversation&lt;/span&gt; &lt;span class="n"&gt;conversation&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projectClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Conversations&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateProjectConversation&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// A responses client pre-bound to this agent and this conversation&lt;/span&gt;
&lt;span class="n"&gt;ProjectResponsesClient&lt;/span&gt; &lt;span class="n"&gt;responsesClient&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projectClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetProjectResponsesClientForAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;defaultAgent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;agentName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;defaultConversationId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;ResponseResult&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;responsesClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"What is the size of France in square miles?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetOutputText&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// Follow-up — same conversation, so context carries over&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;responsesClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"And what is the capital city?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetOutputText&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it, and you'll see the second answer correctly reference "it" back to France — no manual history management, no prompt-stuffing. That's the conversation object doing its job.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Makes This "Agentic" Rather Than Just "A Chat Call"
&lt;/h2&gt;

&lt;p&gt;It's a fair question — at this scale, it looks a lot like calling any chat API. The distinction shows up once you scale this pattern up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attach &lt;strong&gt;built-in tools&lt;/strong&gt; (code interpreter, file search, Bing grounding) and the model decides on its own when to invoke them&lt;/li&gt;
&lt;li&gt;Attach &lt;strong&gt;your own function tools&lt;/strong&gt;, and the agent calls into your application code mid-conversation&lt;/li&gt;
&lt;li&gt;The agent persists as a named, versioned resource your whole team can reference — not a prompt buried in someone's script&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This lab is deliberately the smallest possible slice of that — enough to get something real running today, with room to grow into tool-calling and multi-agent patterns next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;If you're a .NET developer eyeing a move toward AI engineering, this is a genuinely good on-ramp — the SDK is clean, the concepts map well onto things you already know (clients, DI-friendly patterns, typed models), and Foundry handles the infrastructure you'd otherwise have to hand-roll.&lt;/p&gt;

&lt;p&gt;I go through this entire setup — including the Azure Portal steps, the RBAC gotcha, and debugging a couple of real errors — in the video below. If you're following along in Hindi/Hinglish, this one's for you:&lt;/p&gt;

&lt;p&gt;🎥 &lt;a href="https://youtu.be/mrsEsculrNg" rel="noopener noreferrer"&gt;https://youtu.be/mrsEsculrNg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you found this useful, a like/subscribe on the channel genuinely helps — and drop a comment if you get stuck anywhere, I read all of them.&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>azurefoundry</category>
      <category>agents</category>
      <category>ai</category>
    </item>
    <item>
      <title>Build an MCP Server in C# .NET — Complete Beginner Guide</title>
      <dc:creator>Ziya Abbas</dc:creator>
      <pubDate>Tue, 23 Jun 2026 07:32:11 +0000</pubDate>
      <link>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b/build-an-mcp-server-in-c-net-complete-beginner-guide-32hh</link>
      <guid>https://dev.to/ziya_abbas_e1e5d8bbcc5c3b/build-an-mcp-server-in-c-net-complete-beginner-guide-32hh</guid>
      <description>&lt;p&gt;AI models like Claude are powerful — but out of the box, they only know what they were trained on. They cannot access your database, call your APIs, or run your business logic.&lt;/p&gt;

&lt;p&gt;Model Context Protocol (MCP) changes that. It is an open protocol by Anthropic that gives AI models a standard way to connect to external tools and services. Think of it as a universal plug — your .NET code becomes a tool that Claude can actually call in real time.&lt;/p&gt;

&lt;p&gt;What We Build&lt;/p&gt;

&lt;p&gt;In this tutorial, we build a Business Advisor MCP Server in C# .NET — a server that Claude Desktop connects to and uses to suggest real business ideas based on a user’s budget and interests.&lt;/p&gt;

&lt;p&gt;The project covers:&lt;/p&gt;

&lt;p&gt;• What MCP is and how it works (stdio transport, JSON-RPC under the hood)&lt;br&gt;
• How Claude decides when to call your tool vs answer from its own knowledge&lt;br&gt;
• Clean project structure — Models, Services, Tools, all separated properly&lt;br&gt;
• The [McpServerTool] and [Description] attributes — and why Description is the most important thing you will write&lt;br&gt;
• A critical gotcha with stdout vs stderr that breaks most first attempts&lt;br&gt;
• Registering your server in Claude Desktop via claude_desktop_config.json&lt;br&gt;
• Live demo — Claude calling your C# code in real time&lt;/p&gt;

&lt;p&gt;Tech Stack&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;• .NET 9 Console App
• ModelContextProtocol NuGet SDK (official)
• Microsoft.Extensions.Hosting for DI and app lifetime
• Claude Desktop for local testing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;No database, no HTTP server, no complex setup — just a clean console app that Claude talks to directly through stdio pipes.&lt;/p&gt;

&lt;p&gt;Watch the Full Tutorial&lt;/p&gt;

&lt;p&gt;Everything above is walked through step by step, with full code and a live demo at the end.&lt;/p&gt;

&lt;p&gt;Build an MCP Server in C# .NET (Model Context Protocol) | Complete Beginner&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/4bT2VlpCnWo" rel="noopener noreferrer"&gt;https://youtu.be/4bT2VlpCnWo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>dotnet</category>
      <category>dotnetcore</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
