<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Enlighten with Amit</title><link>https://www.amitk.net/tags/mcp/</link><description>Expert insights from a Solution Architect on enterprise digital strategy, microservices architecture, and modern headless solutions (Sitecore XM Cloud, Next.js). Focused on driving business impact through scalable technology.</description><image><url>https://www.amitk.net/images/amit-kumar.jpeg</url><title>Enlighten with Amit</title><link>https://www.amitk.net/</link></image><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>amit@amitk.net (Amit Kumar)</managingEditor><webMaster>amit@amitk.net (Amit Kumar)</webMaster><lastBuildDate>Mon, 20 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.amitk.net/tags/mcp/index.xml" rel="self" type="application/rss+xml"/><item><title>Azure Functions for Dataverse CRUD in .NET</title><link>https://www.amitk.net/blog/sitecoreai-azure-functions-dataverse-crud/</link><pubDate>Mon, 20 Jul 2026 00:00:00 +0000</pubDate><author>amit@amitk.net (Amit Kumar)</author><guid>https://www.amitk.net/blog/sitecoreai-azure-functions-dataverse-crud/</guid><media:content url="https://www.amitk.net/images/sitecoreai-dataverse-integration-dotnet/azure-functions-dataverse-crud.gif" medium="image" type="image/gif"/><description>
Build production-ready Azure Functions in .NET for Microsoft Dataverse CRUD operations, ready for SitecoreAI, Next.js and MCP workflows.</description><content:encoded><![CDATA[







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-azure-functions-for-microsoft-dataverse-crud" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">⚡ Azure Functions for Microsoft Dataverse CRUD</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>In the previous article of this series, we covered how to set up authentication and a secure connection between <strong>SitecoreAI (Sitecore XM Cloud)</strong> and Microsoft Dataverse. If you haven&rsquo;t read that yet, start with <a href="https://www.amitk.net/blog/sitecoreai-dataverse-authentication-connection/" target="_blank" rel="noopener">SitecoreAI Dataverse Authentication and Connection</a>
.</p>
<p>This session moves from connection setup to actual implementation. We&rsquo;ll build a production-ready Azure Functions backend that exposes clean CRUD operations against Microsoft Dataverse.</p>
<p>The goal is straightforward:</p>
<div class="alert-box info">
                    <span class="icon">i</span>
                    <div class="alert-content">
                            Build a secure, reusable, serverless .NET API layer that SitecoreAI (Sitecore XM Cloud), Next.js, automation tools, and future MCP tools can call without touching Dataverse directly.
                    </div>
                </div>
<p>HTTP-triggered Azure Functions are a natural fit here - Microsoft&rsquo;s documentation describes the HTTP trigger as a way to invoke a function with an HTTP request, which is exactly what&rsquo;s needed to build a lightweight serverless API. For the Dataverse side, we&rsquo;ll use the modern <code>Microsoft.PowerPlatform.Dataverse.Client</code> package and its <code>ServiceClient</code> class, which Microsoft positions as the primary implementation for Dataverse operations and which authenticates through MSAL rather than the older ADAL-based clients.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-why-this-matters" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">💡 Why This Matters</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>Once you have a working Dataverse connection, the next question is usually: how should a website, a SitecoreAI workflow, or an AI agent safely create, update, and delete Dataverse records?</p>
<p>Calling Dataverse directly from a frontend is rarely the right production pattern - it exposes too much implementation detail, complicates validation, and makes security harder to reason about. A better approach keeps Dataverse behind a controlled backend layer, where each function represents one business operation rather than a generic table endpoint.</p>
<p>This pattern is a good fit when:</p>
<ul class="numbered-list primary">
<li>SitecoreAI (Sitecore XM Cloud) needs to submit structured data into Dataverse.</li>
<li>A Next.js frontend needs a secure backend endpoint.</li>
<li>An internal workflow needs lightweight automation.</li>
<li>A future MCP tool needs predictable, auditable server-side operations.</li>
<li>You want Dataverse credentials and business rules kept away from the browser.</li>
</ul>
<br/>
<div class="callout warning">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73.0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898.0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg><p>CRITICAL</p>
    </div>
    <div class="callout-body">
        <p><strong><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">For the runtime model, Microsoft&rsquo;s guidance is unambiguous going into the second half of 2026: the in-process .NET model reaches end of support on <strong>November 10, 2026</strong>, and the isolated worker model is the only path forward for .NET 9, .NET 10, and beyond. It also gives full process control, standard dependency injection, and independent versioning from the Functions host - all useful properties for a service that has to manage its own Dataverse client lifecycle.</span></strong></p>
    </div>
</div>
<p>That makes the isolated worker model the right choice for a production-grade Dataverse integration today.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-background" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📖 Background</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>This article is part of a practical Dataverse integration series:</p>
<ul class="numbered-list">
<li>Architecture and integration concept.</li>
<li>Authentication and secure connection between SitecoreAI (Sitecore XM Cloud) and Dataverse.</li>
<li>Azure Functions for CRUD operations against Dataverse (this article).</li>
<li>Calling the Azure Functions from SitecoreAI, Next.js, or MCP workflows.</li>
</ul>
<br/>
<p>In the previous article we focused on getting the connection model right. This article builds the operational layer on top of it.</p>





















  
  
    
    <img
      title="Microsoft Dataverse: Azure Functions Dataverse CRUD"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/sitecoreai-dataverse-integration-dotnet/dataverse-crud-with-azure-functions-sitecore-mvp-amit.png"
      alt="Microsoft Dataverse: Azure Functions Dataverse CRUD"
      class="img justify-self-center  "
      width=""
      height="" />
  
  













<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-architecture-overview" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧱 Architecture Overview</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>The production pattern has four layers:</p>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Layer</th><th>Responsibility</th></tr>
      </thead><tbody><tr><td><strong>API layer</strong></td><td>Azure Functions expose HTTP endpoints for create, update, and delete operations</td></tr><tr><td><strong>Validation layer</strong></td><td>Validates incoming payloads before calling Dataverse</td></tr><tr><td><strong>Service layer</strong></td><td>Wraps Dataverse <code>ServiceClient</code> operations</td></tr><tr><td><strong>Observability layer</strong></td><td>Uses <code>ILogger</code> and Application Insights for tracing and troubleshooting</td></tr></tbody>
  
</table>
</div>
<p>Azure Functions integrate directly with Application Insights, which collects the logs, performance data, and errors generated by the function app - this becomes important once you have several CRUD endpoints running in production.</p>
<p>For secrets, Azure Functions can reference values stored in Azure Key Vault as application settings, so the running code reads them like any other configuration value while the actual secret material stays in the vault.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-architecture-overview" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🗄️ Architecture Overview</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>For this article, assume we&rsquo;re storing a simple business enquiry in Dataverse.</p>
<p>Example Dataverse table:</p>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Display Name</th><th>Logical Name</th><th>Type</th><th>Required</th></tr>
      </thead><tbody><tr><td>Name</td><td><code>crf51_newcolumn</code></td><td>Text</td><td>Yes</td></tr><tr><td>Email</td><td><code>crf51_email</code></td><td>Text</td><td>Yes</td></tr><tr><td>Message</td><td><code>crf51_messag</code></td><td>Multiline Text</td><td>No</td></tr><tr><td>Source</td><td><code>crf51_source</code></td><td>Text</td><td>No</td></tr></tbody>
  
</table>
</div>
<p>Example table logical name: <strong>crf51_sitecoreenquiry</strong></p>
<p>In a real implementation, confirm the table logical name, column logical names, required fields, choice values, and security roles directly against your own Dataverse environment before wiring up code.</p>
<p>Dataverse&rsquo;s Web API basic-operations documentation walks through the same create, retrieve, update, and delete pattern we&rsquo;re implementing here, just via HTTP rather than the SDK. We&rsquo;re using the .NET <code>ServiceClient</code> instead because Microsoft explicitly positions the <code>Dataverse.Client</code> package as the client applications should transition to, replacing the older <code>CrmServiceClient</code>.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-implementation" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">⚙️ Implementation</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<br/>
<h3 id="step-1-create-the-azure-functions-project">Step 1: Create the Azure Functions Project</h3>
<p>Create a .NET isolated worker Functions project:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>func init SitecoreAI-Dataverse-Azure-Functions --worker-runtime dotnet-isolated --target-framework net9.0
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">cd</span> SitecoreAI-Dataverse-Azure-Functions
</span></span></code></pre></div><p>Add HTTP trigger functions inside <code>Functions</code> folder:</p>
<ul class="checklist check">
<li>
<p><strong>CreateDataverseRecord</strong></p>
<p>Azure Function for creating new enquiry records in Microsoft Dataverse.</p>
</li>
<li>
<p><strong>UpdateDataverseRecord</strong></p>
<p>Azure Function for updating existing enquiry records in Microsoft Dataverse.</p>
</li>
<li>
<p><strong>DeleteDataverseRecord</strong></p>
<p>Azure Function for deleting enquiry records from Microsoft Dataverse.</p>
</li>
<li>
<p><strong>GetEnquiriesFunction</strong></p>
<p>Azure Function for retrieving multiple enquiry records from Microsoft Dataverse.</p>
</li>
<li>
<p><strong>GetEnquiryFunction</strong></p>
<p>Azure Function for retrieving a single enquiry record by ID from Microsoft Dataverse.</p>
</li>
<li>
<p><strong>GetEnquiriesByEmailFunction</strong></p>
<p>Azure Function for retrieving enquiry records filtered by email address from Microsoft Dataverse.</p>
</li>
</ul>
<br/>
<div class="callout danger">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73.0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898.0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg><p>Security Updates</p>
    </div>
    <div class="callout-body">
        <p>Scaffold new projects with <code>--worker-runtime dotnet-isolated</code> rather than <code>dotnet</code>. The in-process model is pinned at .NET 8 and stops receiving security updates after November 10, 2026, so there&rsquo;s no good reason to start a new project on it today.</p>
    </div>
</div>
<hr>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="step-2-add-nuget-packages" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Step 2: Add NuGet Packages</h3>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>dotnet add package Microsoft.Azure.Functions.Worker
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.Azure.Functions.Worker.OpenTelemetry
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.Data.SqlClient
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.PowerPlatform.Dataverse.Client
</span></span><span style="display:flex;"><span>dotnet add package OpenTelemetry.Extensions.Hosting
</span></span><span style="display:flex;"><span>dotnet add package Azure.Monitor.OpenTelemetry.Exporte
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.Azure.Functions.Worker.Sdk
</span></span></code></pre></div><div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>Microsoft.PowerPlatform.Dataverse.Client</p>
    </div>
    <div class="callout-body">
        <p><code>Microsoft.PowerPlatform.Dataverse.Client</code> contains the .NET <code>ServiceClient</code> used to connect to Microsoft Dataverse, and it&rsquo;s actively maintained - the package shipped an update as recently as July 2026 with retry-logic improvements for throttling responses.</p>
    </div>
</div>
<hr>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="step-3-configure-application-settings" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Step 3: Configure Application Settings</h3>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>For local development, use <code>local.settings.json</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#ff79c6">&#34;IsEncrypted&#34;</span>: <span style="color:#ff79c6">false</span>,
</span></span><span style="display:flex;"><span>  <span style="color:#ff79c6">&#34;Values&#34;</span>: {
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;AzureWebJobsStorage&#34;</span>: <span style="color:#f1fa8c">&#34;UseDevelopmentStorage=true&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;FUNCTIONS_WORKER_RUNTIME&#34;</span>: <span style="color:#f1fa8c">&#34;dotnet-isolated&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;DataverseEnvironment&#34;</span>: <span style="color:#f1fa8c">&#34;YOUR-DATAVERSE-ENVIRONMENT&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;ClientId&#34;</span>: <span style="color:#f1fa8c">&#34;YOUR-CLIENT-ID&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;ClientSecret&#34;</span>: <span style="color:#f1fa8c">&#34;YOUR-CLIENT-SECRET&#34;</span>
</span></span><span style="display:flex;"><span>  }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><div class="alert-box warning">
                    <span class="icon">i</span>
                    <div class="alert-content">
                            For production, don&rsquo;t store secrets directly in plain application settings. Use a Key Vault reference so the secret lives in the vault and the Function App only holds a pointer to it:
                    </div>
                </div>
<hr>
<h3 id="step-4-configure-dependency-injection">Step 4: Configure Dependency Injection</h3>
<p><code>Program.cs</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Azure.Functions.Worker.Builder;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.DependencyInjection;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Hosting;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> SitecoreAI.Dataverse.AzureFunctions.Services;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Create and configure the Azure Functions application builder</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd">var</span> builder = FunctionsApplication.CreateBuilder(args);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Configure the Functions Web Application middleware</span>
</span></span><span style="display:flex;"><span>builder.ConfigureFunctionsWebApplication();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Register application services for dependency injection</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// IDataverseService: Service for interacting with Microsoft Dataverse</span>
</span></span><span style="display:flex;"><span>builder.Services.AddSingleton&lt;IDataverseService, DataverseService&gt;();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Build and run the application</span>
</span></span><span style="display:flex;"><span>builder.Build().Run();
</span></span></code></pre></div><p>Standard .NET dependency injection is one of the concrete advantages the isolated worker model gives you over in-process-you get full control of the startup pipeline instead of relying on the Functions host&rsquo;s binding infrastructure.</p>
<hr>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-code-examples" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">💻 Code Examples</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<h3 id="request-models">Request Models</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span>﻿<span style="color:#ff79c6">using</span> System;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Collections.Generic;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Linq;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Text;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Threading.Tasks;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">namespace</span> SitecoreAI.Dataverse.AzureFunctions.Models;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Response model representing an enquiry retrieved from Dataverse.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">sealed</span> <span style="color:#ff79c6">class</span> <span style="color:#50fa7b">EnquiryResponse</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the unique identifier of the enquiry.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> Guid Id { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the name of the person submitting the enquiry.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd">string?</span> Name { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the email address of the person submitting the enquiry.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd">string?</span> Email { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the message content of the enquiry.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd">string?</span> Message { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the source system from which the enquiry originated.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd">string?</span> Source { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the date and time when the enquiry was created.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> DateTime? CreatedOn { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;Gets or sets the date and time when the enquiry was last modified.&lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> DateTime? ModifiedOn { <span style="color:#ff79c6">get</span>; <span style="color:#ff79c6">set</span>; }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Scan the QR code below to view and access the complete code repository.</span>
</span></span></code></pre></div><hr>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="dataverse-service-layer" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Dataverse Service Layer</h3>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#ff79c6">namespace</span> SitecoreAI.Dataverse.AzureFunctions.Services;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Service interface for managing enquiry records in Microsoft Dataverse.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Provides CRUD operations and query capabilities for enquiry data.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#ff79c6">interface</span> <span style="color:#50fa7b">IDataverseService</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// Creates a new enquiry record in Dataverse.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;request&#34;&gt;The request containing enquiry details to create.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;cancellationToken&#34;&gt;Token to cancel the operation.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;returns&gt;The unique identifier (GUID) of the newly created enquiry.&lt;/returns&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;exception cref=&#34;ArgumentException&#34;&gt;Thrown when validation fails or field lengths exceed maximum allowed values.&lt;/exception&gt;</span>
</span></span><span style="display:flex;"><span>    Task&lt;Guid&gt; CreateEnquiryAsync(CreateEnquiryRequest request, CancellationToken cancellationToken);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Scan the QR code below to view and access the complete code repository.</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Configuration;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Logging;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.PowerPlatform.Dataverse.Client;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Xrm.Sdk;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Xrm.Sdk.Query;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> SitecoreAI.Dataverse.AzureFunctions.Models;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">namespace</span> SitecoreAI.Dataverse.AzureFunctions.Services;
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Service implementation for managing enquiry records in Microsoft Dataverse.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Provides CRUD operations, validation, and data mapping for enquiry entities.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">sealed</span> <span style="color:#ff79c6">class</span> <span style="color:#50fa7b">DataverseService</span> : IDataverseService
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">private</span> <span style="color:#ff79c6">readonly</span> IConfiguration _configuration;
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">private</span> <span style="color:#ff79c6">readonly</span> ILogger&lt;DataverseService&gt; _logger;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Scan the QR code below to view and access the complete code repository.</span>
</span></span></code></pre></div><hr>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="create-function" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Create Function</h3>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#ff79c6">using</span> SitecoreAI.Dataverse.AzureFunctions.Services;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Azure.Functions.Worker;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Azure.Functions.Worker.Http;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Logging;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Net;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> System.Text.Json;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> SitecoreAI.Dataverse.AzureFunctions.Models;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">namespace</span> SitecoreAI.Dataverse.AzureFunctions.Functions;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// Azure Function for creating new enquiry records in Microsoft Dataverse.</span>
</span></span><span style="display:flex;"><span><span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">sealed</span> <span style="color:#ff79c6">class</span> <span style="color:#50fa7b">CreateDataverseRecord</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">private</span> <span style="color:#ff79c6">readonly</span> IDataverseService _dataverseService;
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">private</span> <span style="color:#ff79c6">readonly</span> ILogger&lt;CreateDataverseRecord&gt; _logger;
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// Initializes a new instance of the &lt;see cref=&#34;CreateDataverseRecord&#34;/&gt; class.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;dataverseService&#34;&gt;Service for interacting with Dataverse.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;logger&#34;&gt;Logger for tracking function execution.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> CreateDataverseRecord(
</span></span><span style="display:flex;"><span>        IDataverseService dataverseService,
</span></span><span style="display:flex;"><span>        ILogger&lt;CreateDataverseRecord&gt; logger)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        _dataverseService = dataverseService;
</span></span><span style="display:flex;"><span>        _logger = logger;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// HTTP-triggered function that creates a new enquiry record in Dataverse.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;/summary&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;req&#34;&gt;The HTTP request containing the enquiry data in the body.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;param name=&#34;executionContext&#34;&gt;The function execution context.&lt;/param&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">/// &lt;returns&gt;An HTTP response with the created record ID or an error message.&lt;/returns&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">    [Function(&#34;CreateDataverseRecord&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">async</span> Task&lt;HttpResponseData&gt; Run(
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">        [HttpTrigger(AuthorizationLevel.Function, &#34;post&#34;, Route = &#34;dataverse/enquiries&#34;)]</span>
</span></span><span style="display:flex;"><span>        HttpRequestData req,
</span></span><span style="display:flex;"><span>        FunctionContext executionContext)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#8be9fd">var</span> cancellationToken = executionContext.CancellationToken;
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span>        
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The update and delete functions follow the same shape - an HTTP trigger, a thin validation step, a call into <code>IDataverseService</code>, and a structured JSON response. Update binds the route parameter to <code>{id:guid}</code> and issues a <code>PATCH</code>; delete binds the same route and issues a <code>DELETE</code>.</p>
<p><div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"/></svg><p>Explore More & Share Your Feedback</p>
    </div>
    <div class="callout-body">
        <p><p><span class="dark:text-gray-300 font-semibold gradient-text-aqua">📱 Scan to access the complete SitecoreAI Dataverse Azure Functions repository</span>
<br/>
<span class="dark:text-gray-300 font-semibold gradient-text-par-four">💻 Azure Functions integration, .NET 8 code, authentication setup &amp; CRUD examples</span></p>
<img src="https://www.amitk.net/images/sitecoreai-dataverse-integration-dotnet/sitecoreai-dataverse-azure-functions-dotnet-Sitecore-MVP-Amit-Kumar.png" class="img justify-self-center medium-zoom-image" style="max-width: 40%;"/>
<p><br/><br/>
<strong><em>Share your feedback or contribute to support the Sitecore developer community!</em></strong></p>
</p>
    </div>
</div>
<div class="github-card-wrapper">
    <a id="github-056f2ddc8b277b03a78c5cde00100d39" target="_blank" href="https://github.com/AmitKumar-AK/sitecoreai-dataverse-connector" class="cursor-pointer">
      <div
        class="w-full md:w-auto p-0 m-0 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl"><div class="w-full nozoom">
            <img
              src="https://opengraph.githubassets.com/0/AmitKumar-AK/sitecoreai-dataverse-connector"
              alt="GitHub Repository Thumbnail"
              class="nozoom mt-0 mb-0 w-full h-full object-cover">
          </div><div class="w-full md:w-auto pt-3 p-5">
          <div class="flex items-center">
            <span class="text-2xl text-neutral-800 dark:text-gray-300 me-2"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="currentColor" viewBox="3 3 18 18">
  <path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
</svg>
</span>
            <div
              id="github-056f2ddc8b277b03a78c5cde00100d39-full_name"
              class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-gray-300">
              AmitKumar-AK/sitecoreai-dataverse-connector
            </div>
          </div>

          <p id="github-056f2ddc8b277b03a78c5cde00100d39-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-gray-300">
            Azure Functions-based integration connecting SitecoreAI (XM Cloud) forms to Microsoft Dataverse.  Includes certificate-based authentication, CRUD operations, and console app demos.
          </p>

          <div class="m-0 mt-2 flex items-center">
            <span class="mr-1 inline-block h-3 w-3 rounded-full language-dot" data-language="C#"></span>
            <div class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              C#
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"/></svg></span>
            <div id="github-056f2ddc8b277b03a78c5cde00100d39-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7 5C7 3.89543 7.89543 3 9 3C10.1046 3 11 3.89543 11 5C11 5.74028 10.5978 6.38663 10 6.73244V14.0396H11.7915C12.8961 14.0396 13.7915 13.1441 13.7915 12.0396V10.7838C13.1823 10.4411 12.7708 9.78837 12.7708 9.03955C12.7708 7.93498 13.6662 7.03955 14.7708 7.03955C15.8753 7.03955 16.7708 7.93498 16.7708 9.03955C16.7708 9.77123 16.3778 10.4111 15.7915 10.7598V12.0396C15.7915 14.2487 14.0006 16.0396 11.7915 16.0396H10V17.2676C10.5978 17.6134 11 18.2597 11 19C11 20.1046 10.1046 21 9 21C7.89543 21 7 20.1046 7 19C7 18.2597 7.4022 17.6134 8 17.2676V6.73244C7.4022 6.38663 7 5.74028 7 5Z" fill="#000000"></path> </g></svg></span>
            <div id="github-056f2ddc8b277b03a78c5cde00100d39-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>
          </div>
        </div>
      </div>
      
      
      <script
        async
        type="text/javascript"
        src="/js/fetch-repo.min.dc5533c50cefd50405344b235937142271f26229fe39cbee27fd4960e8bb897a0beebfad77a1091ca91cd0d1fb14e70fc37cc114dd9674fb2c32e0ab512ec8a4.js"
        integrity="sha512-3FUzxQzv1QQFNEsjWTcUInHyYin&#43;OcvuJ/1JYOi7iXoL7r&#43;td6EJHKkc0NH7FOcPw3zBFN2WdPssMuCrUS7IpA=="
        data-repo-url="https://api.github.com/repos/AmitKumar-AK/sitecoreai-dataverse-connector"
        data-repo-id="github-056f2ddc8b277b03a78c5cde00100d39"></script>
    </a>
  </div>
<br/></p>
<p>







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-best-practices" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">✅ Best Practices</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<br/>
<ul class="checklist check">
<li>
<p><strong>Keep functions business-focused.</strong> Avoid a single generic <code>POST /api/dataverse/{tableName}</code> endpoint - it exposes too much Dataverse implementation detail. Prefer purpose-built routes like <code>/api/dataverse/enquiries</code>.</p>
</li>
<li>
<p><strong>Validate before calling Dataverse.</strong> Check required fields, email format, field lengths, and choice values before the SDK call, not after.</p>
</li>
<li>
<p><strong>Keep secrets in Key Vault.</strong> Give the Function App&rsquo;s managed identity read access to the secret rather than pasting connection strings into plain app settings.</p>
</li>
<li>
<p><strong>Log with Application Insights.</strong> Capture operation name, correlation ID, Dataverse record ID, and execution duration so failed submissions are traceable.</p>
</li>
<li>
<p><strong>Return structured responses.</strong> MCP tools and AI agents work far better against predictable JSON shapes than raw exception text.</p>
</li>
<li>
<p><strong>Update only changed fields.</strong> Sending every retrieved property back on update can unnecessarily trigger Dataverse business logic, plugins, and audit history even when values haven&rsquo;t changed.</p>
</li>
</ul></p>
<br/>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-frequent-errors" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">⚠️ Frequent errors</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Errors</th><th>Why It Hurts</th><th>Better Approach</th></tr>
      </thead><tbody><tr><td>Calling Dataverse directly from the frontend</td><td>Exposes implementation detail and increases security risk</td><td>Route through Azure Functions</td></tr><tr><td>One generic CRUD endpoint for every table</td><td>Harder to secure and validate</td><td>Business-specific endpoints</td></tr><tr><td>Returning raw Dataverse exceptions</td><td>Not friendly for users or AI tools</td><td>Structured <code>ApiResponse&lt;T&gt;</code> payloads</td></tr><tr><td>Updating every field on every request</td><td>Can trigger unnecessary plugins and audit noise</td><td>Update only changed fields</td></tr><tr><td>Secrets in plain app settings</td><td>Increases operational risk</td><td>Key Vault references</td></tr><tr><td>Staying on the in-process model</td><td>Loses support after November 10, 2026</td><td>Scaffold new projects as <code>dotnet-isolated</code></td></tr></tbody>
  
</table>
</div>
<p>







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-performance-considerations" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📈 Performance Considerations</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<br/>
<ul class="numbered-list">
<li>Reuse <code>ServiceClient</code> connection pooling where possible rather than reconnecting per call.</li>
<li>Prefer async patterns throughout, and log dependency latency via Application Insights.</li>
<li>Add retry handling only where it&rsquo;s safe - the current ServiceClient already respects server-specified Retry-After values for throttling, so avoid layering an additional blind retry loop on top.</li>
<li>Use idempotency keys for operations where a duplicate write would matter.</li>
</ul></p>
<br/>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-security-considerations" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🛡️ Security Considerations</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>A production-ready setup should include:</p>
<ul class="checklist accent check">
<li>Function-level authentication, or API Management in front of the Functions app.</li>
<li>Managed identity for Key Vault access instead of static secrets where feasible.</li>
<li>Least-privilege Dataverse application user permissions.</li>
<li>Input validation and request size limits.</li>
<li>Environment-specific app registrations for dev, test, and production.</li>
<li>Logging that never includes sensitive payload data.</li>
</ul>
<br/>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-real-world-example" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🌍 Real-World Example</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<ul>
<li>
<p>Imagine a SitecoreAI (Sitecore XM Cloud) landing page capturing interest in a product demo. The form collects a name, email, company, message, and campaign source.</p>
</li>
<li>
<p>Instead of calling Dataverse directly, the page calls <code>POST /api/dataverse/enquiries</code>. The Azure Function validates the payload, maps fields to Dataverse columns, creates the row, logs the operation, and returns a structured response.</p>
</li>
<li>
<p>Later, a support workflow - or an MCP tool - can update the same record with <code>PATCH /api/dataverse/enquiries/{id}</code>, and an authorised cleanup process can remove test data with <code>DELETE /api/dataverse/enquiries/{id}</code>. One backend now safely serves SitecoreAI, Next.js, automation scripts, and future AI agents.</p>
</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-faq" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">💬 FAQ</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<br/>


          
          
          

          <div class="not-prose accordion-group " data-accordion-mode="single"
            data-first-open="true">
            



  
  
  
  
  

  
  

  <div class="accordion-item" data-open="">
    <h3 class="m-0"><button type="button" class="accordion-header" data-accordion-header aria-expanded="false"><span
      class="accordion-title font-display text-xl md:text-2xl font-bold gradient-text-amitk-aurora">Why use Azure Functions with Microsoft Dataverse?</span><svg class="accordion-icon"
      viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <path fill="currentColor"
        d="M505.755,123.592c-8.341-8.341-21.824-8.341-30.165,0L256.005,343.176L36.421,123.592c-8.341-8.341-21.824-8.341-30.165,0 s-8.341,21.824,0,30.165l234.667,234.667c4.16,4.16,9.621,6.251,15.083,6.251c5.462,0,10.923-2.091,15.083-6.251l234.667-234.667 C514.096,145.416,514.096,131.933,505.755,123.592z">
      </path>
    </svg></button></h3>
    
    <div class="accordion-panel">
      <div>
        <div class="accordion-body pb-4 pr-8 text-base md:text-lg leading-relaxed text-gray-700 dark:text-gray-300">
          Azure Functions give you a lightweight, serverless API layer so SitecoreAI, Next.js, or MCP tools can create, update, or delete Dataverse rows without touching Dataverse directly.
        </div>
      </div>
    </div>
  </div>



  
  
  
  
  

  
  

  <div class="accordion-item" data-open="">
    <h3 class="m-0"><button type="button" class="accordion-header" data-accordion-header aria-expanded="false"><span
      class="accordion-title font-display text-xl md:text-2xl font-bold gradient-text-amitk-midnight-violet">Should I use the Dataverse Web API or ServiceClient?</span><svg class="accordion-icon"
      viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <path fill="currentColor"
        d="M505.755,123.592c-8.341-8.341-21.824-8.341-30.165,0L256.005,343.176L36.421,123.592c-8.341-8.341-21.824-8.341-30.165,0 s-8.341,21.824,0,30.165l234.667,234.667c4.16,4.16,9.621,6.251,15.083,6.251c5.462,0,10.923-2.091,15.083-6.251l234.667-234.667 C514.096,145.416,514.096,131.933,505.755,123.592z">
      </path>
    </svg></button></h3>
    
    <div class="accordion-panel">
      <div>
        <div class="accordion-body pb-4 pr-8 text-base md:text-lg leading-relaxed text-gray-700 dark:text-gray-300">
          Both are valid. For .NET server-side code, <code>Microsoft.PowerPlatform.Dataverse.Client.ServiceClient</code> is the client Microsoft recommends applications transition to, and it authenticates via MSAL.
        </div>
      </div>
    </div>
  </div>



  
  
  
  
  

  
  

  <div class="accordion-item" data-open="">
    <h3 class="m-0"><button type="button" class="accordion-header" data-accordion-header aria-expanded="false"><span
      class="accordion-title font-display text-xl md:text-2xl font-bold gradient-text-sea-salt">Is the in-process Azure Functions model still an option for new projects?</span><svg class="accordion-icon"
      viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <path fill="currentColor"
        d="M505.755,123.592c-8.341-8.341-21.824-8.341-30.165,0L256.005,343.176L36.421,123.592c-8.341-8.341-21.824-8.341-30.165,0 s-8.341,21.824,0,30.165l234.667,234.667c4.16,4.16,9.621,6.251,15.083,6.251c5.462,0,10.923-2.091,15.083-6.251l234.667-234.667 C514.096,145.416,514.096,131.933,505.755,123.592z">
      </path>
    </svg></button></h3>
    
    <div class="accordion-panel">
      <div>
        <div class="accordion-body pb-4 pr-8 text-base md:text-lg leading-relaxed text-gray-700 dark:text-gray-300">
          Not really. In-process support ends November 10, 2026, and it&rsquo;s capped at .NET 8. New projects should scaffold with <code>--worker-runtime dotnet-isolated</code>.
        </div>
      </div>
    </div>
  </div>



  
  
  
  
  

  
  

  <div class="accordion-item" data-open="">
    <h3 class="m-0"><button type="button" class="accordion-header" data-accordion-header aria-expanded="false"><span
      class="accordion-title font-display text-xl md:text-2xl font-bold gradient-text-ooey-gooey">Can these functions become MCP tools later?</span><svg class="accordion-icon"
      viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <path fill="currentColor"
        d="M505.755,123.592c-8.341-8.341-21.824-8.341-30.165,0L256.005,343.176L36.421,123.592c-8.341-8.341-21.824-8.341-30.165,0 s-8.341,21.824,0,30.165l234.667,234.667c4.16,4.16,9.621,6.251,15.083,6.251c5.462,0,10.923-2.091,15.083-6.251l234.667-234.667 C514.096,145.416,514.096,131.933,505.755,123.592z">
      </path>
    </svg></button></h3>
    
    <div class="accordion-panel">
      <div>
        <div class="accordion-body pb-4 pr-8 text-base md:text-lg leading-relaxed text-gray-700 dark:text-gray-300">
          Yes - the same business-focused endpoints can later be wrapped as MCP tools so an AI assistant calls a controlled operation like <code>create_enquiry</code> instead of touching Dataverse directly.
        </div>
      </div>
    </div>
  </div>



  
  
  
  
  

  
  

  <div class="accordion-item" data-open="">
    <h3 class="m-0"><button type="button" class="accordion-header" data-accordion-header aria-expanded="false"><span
      class="accordion-title font-display text-xl md:text-2xl font-bold gradient-text-vital-ocean">Should Dataverse credentials live in `local.settings.json`?</span><svg class="accordion-icon"
      viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
      <path fill="currentColor"
        d="M505.755,123.592c-8.341-8.341-21.824-8.341-30.165,0L256.005,343.176L36.421,123.592c-8.341-8.341-21.824-8.341-30.165,0 s-8.341,21.824,0,30.165l234.667,234.667c4.16,4.16,9.621,6.251,15.083,6.251c5.462,0,10.923-2.091,15.083-6.251l234.667-234.667 C514.096,145.416,514.096,131.933,505.755,123.592z">
      </path>
    </svg></button></h3>
    
    <div class="accordion-panel">
      <div>
        <div class="accordion-body pb-4 pr-8 text-base md:text-lg leading-relaxed text-gray-700 dark:text-gray-300">
          Only for local development. In production, use Key Vault references or managed identity.
        </div>
      </div>
    </div>
  </div>


          </div>

          
          
          

          
<p>







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-summary" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧾 Summary</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<br/>

















<section
    class="not-prose relative overflow-hidden rounded-xl bg-gradient-to-br from-slate-9001 to-blue-8001 from-main-color-1-dark px-6 py-9 text-white mb-10 dark:ring-1 dark:ring-white/10 hero-banner">

    
    <div class="pointer-events-none absolute -right-16 -top-20 h-72 w-72 rounded-full bg-white/10 blur-3xl"
        aria-hidden="true"></div>

    <div class="relative">
        <h2 class="font-display text-xl md:text-2xl font-medium mb-3 leading-snug"></h2>
        <p class="text-[15.5px] leading-relaxed text-white/90 max-w-4xl">We built a production-ready pattern for using Azure Functions as a Dataverse CRUD backend on the isolated worker model: separate create, update, and delete endpoints, a shared Dataverse service layer using <strong>ServiceClient</strong>, structured request and response models, Application Insights logging, and Key Vault-ready configuration - an architecture that can support SitecoreAI (Sitecore XM Cloud), Next.js, and MCP tools going forward.</p>

        
    </div>
</section></p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-next-steps" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">👣 Next Steps</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>In the next article, we&rsquo;ll explore how to connect these Azure Functions with SitecoreAI and store the processed records in Microsoft Dataverse.</p>
<p><strong>Stay tuned!</strong> 👀</p>
<div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>SitecoreAI and Microsoft Dataverse integrations</p>
    </div>
    <div class="callout-body">
        <p><strong><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">If you&rsquo;re building SitecoreAI and Microsoft Dataverse integrations, start with a clean backend boundary. Don&rsquo;t expose Dataverse complexity to the frontend or AI layer - use Azure Functions to create a secure, observable, MCP-ready service layer instead.</strong>
<br/><br/>
Read the previous article in this series here: <a href="https://www.amitk.net/blog/sitecoreai-dataverse-authentication-connection/" target="_blank" rel="noopener">SitecoreAI Dataverse Authentication and Connection</a>
</span></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="creditreferences" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧾Credit/References</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>



<div class="table-wrapper">
<table class="style-table"><tbody><tr><td><a href="https://www.amitk.net/blog/sitecoreai-dataverse-integration-dotnet/" target="_blank" rel="noopener"><strong>Introduction to SitecoreAI and Microsoft Dataverse Integration</strong></a>
 Complete architecture guide for connecting SitecoreAI, .NET, Azure Functions, and Microsoft Dataverse</td><td><a href="https://www.amitk.net/blog/sitecoreai-dataverse-authentication-connection/" target="_blank" rel="noopener"><strong>SitecoreAI Dataverse Authentication and Connection</strong></a>
 Configure secure authentication and application access between SitecoreAI and Dataverse</td><td><a href="https://doc.sitecore.com/sai/en/developers/sitecoreai/sitecoreai.html" target="_blank" rel="noopener"><strong>SitecoreAI Documentation for Developers</strong></a>
 Official developer documentation covering SitecoreAI architecture and capabilities</td></tr><tr><td><a href="https://www.amitk.net/blog/build-custom-mcp-server-dotnet-csharp/" target="_blank" rel="noopener"><strong>Building Custom Sitecore MCP Tools in .NET</strong></a>
 Learn how to build custom Model Context Protocol tools using .NET</td><td><a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/" target="_blank" rel="noopener"><strong>Sitecore Marketer MCP Integration with VS Code</strong></a>
 Explore Sitecore MCP capabilities and AI-assisted development workflows</td><td><a href="https://www.amitk.net/blog/mcp-server-vs-copilot-genai-agentic-ai/" target="_blank" rel="noopener"><strong>MCP Server vs Copilot vs GenAI Agentic AI</strong></a>
 Understand differences between MCP servers, copilots, and AI agents</td></tr><tr><td><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger" target="_blank" rel="noopener"><strong>Azure Functions HTTP Trigger</strong></a>
 Build HTTP-based serverless integrations for SitecoreAI and external systems</td><td><a href="https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide" target="_blank" rel="noopener"><strong>Guide for running C# Azure Functions in the isolated worker model</strong></a>
 Implement modern .NET Azure Functions using isolated worker architecture</td><td><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/sdk-client-transition" target="_blank" rel="noopener"><strong>Dataverse ServiceClient SDK for .NET</strong></a>
 Use Microsoft.PowerPlatform.Dataverse.Client for enterprise Dataverse integrations</td></tr><tr><td><a href="https://www.nuget.org/packages/Microsoft.PowerPlatform.Dataverse.Client/" target="_blank" rel="noopener"><strong>Microsoft.PowerPlatform.Dataverse.Client NuGet Package</strong></a>
 Official .NET SDK package for connecting applications with Microsoft Dataverse</td><td><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/web-api-basic-operations-sample" target="_blank" rel="noopener"><strong>Dataverse Web API Basic Operations Sample</strong></a>
 Learn CRUD operations using Dataverse Web API</td><td><a href="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/update-delete-entities-using-web-api" target="_blank" rel="noopener"><strong>Update and Delete Dataverse Records Using Web API</strong></a>
 Manage Dataverse records through REST APIs</td></tr><tr><td><a href="https://doc.sitecore.com/sai/en/developers/sitecoreai/deploying-sitecoreai/deploying-sitecoreai.html" target="_blank" rel="noopener"><strong>SitecoreAI Deployment and Environment Management</strong></a>
 Understand SitecoreAI deployment workflows and environment management</td><td><a href="https://doc.sitecore.com/sai/en/developers/sitecoreai/xm-cloud-plugin.html" target="_blank" rel="noopener"><strong>SitecoreAI XM Cloud Plugin</strong></a>
 Automate SitecoreAI projects using Sitecore CLI tooling</td><td><a href="https://developers.sitecore.com/learn/accelerate/sitecoreai/xmc-quick-reference" target="_blank" rel="noopener"><strong>SitecoreAI Quick Reference Guide</strong></a>
 Practical guidance for planning and implementing SitecoreAI solutions</td></tr><tr><td><a href="https://learn.microsoft.com/en-us/azure/app-service/app-service-key-vault-references" target="_blank" rel="noopener"><strong>Azure Key Vault References for Application Settings</strong></a>
 Secure SitecoreAI integration secrets using Azure Key Vault</td><td><a href="https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring" target="_blank" rel="noopener"><strong>Configure Monitoring for Azure Functions</strong></a>
 Monitor serverless integrations with logging and diagnostics</td><td><a href="https://learn.microsoft.com/en-us/azure/architecture/" target="_blank" rel="noopener"><strong>Azure Architecture Center</strong></a>
 Enterprise architecture patterns for Azure cloud solutions</td></tr></tbody>
  
</table>
</div>
]]></content:encoded></item><item><title>Build Custom Sitecore MCP Tools in .NET C#: A Practical Guide for .NET Developers</title><link>https://www.amitk.net/blog/build-custom-mcp-server-dotnet-csharp/</link><pubDate>Tue, 24 Mar 2026 00:00:00 +0000</pubDate><author>amit@amitk.net (Amit Kumar)</author><guid>https://www.amitk.net/blog/build-custom-mcp-server-dotnet-csharp/</guid><media:content url="https://www.amitk.net/images/build-custom-mcp-server-dotnet-csharp/build-custom-mcp-server-dotnet-csharp.gif" medium="image" type="image/gif"/><description>
Build custom Sitecore MCP tools in .NET C#: step-by-step tutorial with code examples to extend ChatGPT, Claude &amp; GitHub Copilot using enterprise data integration.</description><content:encoded><![CDATA[







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-introduction" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📊 Introduction</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>What if your AI assistant could securely tap into your company&rsquo;s <strong>database</strong>, browse your <a href="https://www.amitk.net/tags/sitecore-ai/" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">SitecoreAI (FKA XM Cloud)</span></a>
 content, query your <strong>CRM</strong>, or talk directly to your internal <strong>business systems</strong> - all without you lifting a finger?</p>
<p>That&rsquo;s exactly what <a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Model Context Protocol (MCP)</span></a>
 makes possible. And if you&rsquo;re a <strong>.NET developer</strong>, building <strong>custom MCP tools in C#</strong> is the most practical way to get there.</p>
<p>In my <span class="dark:text-gray-300 font-semibold gradient-text">previous articles</span>, I explained:</p>
<ul>
<li><a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">How MCP works with Sitecore Marketer MCP</span></a>
</li>
<li><a href="https://www.amitk.net/blog/mcp-server-vs-copilot-genai-agentic-ai/" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">Why MCP is needed compared to Copilot, GenAI, and Agentic AI</span></a>
</li>
</ul>
<p>Now the next step is understanding how to <span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">create your own MCP tool in .NET C# </span>using the official <a href="https://csharp.sdk.modelcontextprotocol.io" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-par-four">MCP SDK</span></a>
.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-why-create-custom-mcp-tools" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🛠️ Why Create Custom MCP Tools</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p><strong>Out-of-the-box MCP servers</strong> are useful, but <strong>enterprise projects</strong> often require custom tools.</p>


<p class="font-semibold text-xl  text-primary dark:text-gray-300">Examples:</p>
<ul>
<li>Internal APIs</li>
<li>Sitecore CMS operation / automation</li>
<li>DevOps utilities</li>
<li>Data services</li>
<li>Marketing workflows</li>
<li>Reporting tools</li>
</ul>
<p>Creating a <span class="dark:text-gray-300 font-semibold gradient-text-aqua">custom MCP tool</span> allows AI agents to interact with your system safely.</p>
<p>This becomes <strong>important</strong> when using:</p>
<ul>
<li>Copilot</li>
<li>AI Agents</li>
<li>Agentic AI</li>
<li>Claude / ChatGPT with MCP</li>
<li>VS Code MCP integration</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-mcp-and-net-why-c-is-a-strong-fit" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧱 MCP and .NET: Why C# Is a Strong Fit</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p><strong>Microsoft</strong> and <strong>Anthropic</strong> jointly maintain the <a href="https://developer.microsoft.com/blog/microsoft-partners-with-anthropic-to-create-official-c-sdk-for-model-context-protocol" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">official MCP C# SDK</span></a>
, making <strong>.NET a first‑class platform</strong> for <strong>MCP development</strong>.</p>
<p>With the <strong>C# SDK</strong>, you can:</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Build MCP servers as simple console apps or ASP.NET services</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Expose tools using familiar .NET patterns</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">Integrate cleanly with dependency injection and hosting</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Run locally (stdio) or remotely (HTTP/SSE)</span></li>
</ul>
<div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>Official Repository</p>
    </div>
    <div class="callout-body">
        <p><strong>You can explore the <span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">official implementation over at the MCP C# SDK</span> on <a href="https://github.com/modelcontextprotocol/csharp-sdk" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">GitHub</span></a>
 - <span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">it&rsquo;s the best starting point for .NET developers diving into Model Context Protocol.</span></strong></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="-nuget-package" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📦 NuGet Package</h3>
  
  
</div>
<p>The <span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">ModelContextProtocol</span> SDK provides:</p>
<ul>
<li>Core MCP protocol implementation (transport layer, message handling)</li>
<li>Attribute-based tool registration (<code>[McpServerTool]</code>, <code>[McpServerToolType]</code>)</li>
<li>Built-in dependency injection support</li>
<li>Async/await patterns for I/O operations</li>
<li>Type-safe parameter handling with validation</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-starting-point-the-quickstart-weather-server" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🏁 Starting Point: The Quickstart Weather Server</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>The best place to start is the official <a href="https://github.com/modelcontextprotocol/csharp-sdk/tree/main/samples/QuickstartWeatherServer" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">QuickstartWeatherServer</span></a>
 sample from the MCP C# SDK repository - <strong><em>a minimal, well-structured example that shows exactly how to build your first MCP server in .NET</em></strong>.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">This sample demonstrates:</p>
<ul>
<li>Creating a minimal MCP server</li>
<li>Registering tools using attributes</li>
<li>Exposing those tools to MCP clients</li>
<li>Returning structured responses</li>
</ul>
<p><span class="dark:text-gray-300 font-semibold gradient-text">Simple by design</span> - but it <span class="dark:text-gray-300 font-semibold gradient-text-aqua">demonstrates the exact pattern you'll repeat for every custom MCP tool you build.</span></p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-how-mcp-server-works-in-net-high-level" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🏗️ How MCP Server Works in .NET (High Level)</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">Basic flow:</p>
<ol>
<li>Create MCP server project</li>
<li>Define tools using SDK attributes</li>
<li>Register tools in server</li>
<li>Run MCP server</li>
<li>Connect from client (VS Code / Copilot / AI Agent)</li>
</ol>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Example concept:</p>





















  
  
    
    <img
      title="The diagram above illustrates how a Model Context Protocol (MCP) request flows end-to-end - from the user&#39;s prompt, through the AI, down to the MCP client and server, all the way to tool execution, and back with a result."
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/build-custom-mcp-server-dotnet-csharp/creating-mcp-tools-dotnet.png"
      alt="The diagram above illustrates how a Model Context Protocol (MCP) request flows end-to-end - from the user&#39;s prompt, through the AI, down to the MCP client and server, all the way to tool execution, and back with a result."
      class="img justify-self-center  "
      width=""
      height="" />
  
  













<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-getting-started-with-mcp-in-net" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📦 Getting Started with MCP in .NET</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>Below is a high-level overview of how to build a custom MCP server in .NET. For the complete implementation, full source code, and a real-world <span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">SitecoreAI (FKA XM Cloud)</span> example, check out the <strong>GitHub repository</strong>: <a href="https://github.com/AmitKumar-AK/mcp-dotnet-tutorial" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">MCP C# SDK Tutorial with SitecoreAI Example</span></a>
</p>
<h3 id="1-hahahugoshortcode12s32hbhb"><strong>1.</strong> <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Create a new .NET project Start with a minimal ASP.NET Core or console host:</span> <br/></h3>
<p>Target .NET 8 or later, as most MCP examples assume current LTS or preview runtimes.</p>
<p>Add the following <strong>package references</strong> :</p>
<ul>
<li><strong><em>Microsoft.Data.Sqlite</em></strong></li>
<li><strong><em>Microsoft.Extensions.Hosting</em></strong></li>
<li><strong><em>ModelContextProtocol</em></strong></li>
</ul>
<h3 id="2-hahahugoshortcode12s33hbhb"><strong>2.</strong> <span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Register the MCP server and transport Using an approach similar to the examples, you configure MCP in Program.cs:</span> <br/></h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.DependencyInjection;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Hosting;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> Microsoft.Extensions.Logging;
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">using</span> McpSitecoreAiExample;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd">var</span> builder = Host.CreateApplicationBuilder(args);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>builder.Services.AddSingleton&lt;MonkeyService&gt;();
</span></span><span style="display:flex;"><span>builder.Services.AddSingleton&lt;SellingService&gt;();
</span></span><span style="display:flex;"><span>builder.Services.AddSingleton&lt;SitecoreAIService&gt;();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>builder.Logging.AddConsole(consoleLogOptions =&gt;
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">// Configure all logs to go to stderr</span>
</span></span><span style="display:flex;"><span>    consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace;
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>builder.Services
</span></span><span style="display:flex;"><span>    .AddMcpServer()
</span></span><span style="display:flex;"><span>    .WithStdioServerTransport()
</span></span><span style="display:flex;"><span>    .WithToolsFromAssembly();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#ff79c6">await</span> builder.Build().RunAsync();</span></span></code></pre></div>
<p><strong>📦 Service Registration</strong></p>
<ul>
<li><code>MonkeyService</code>, <code>SellingService</code>, <code>SitecoreAIService</code> registered as Singletons - one shared instance per app lifetime</li>
<li><strong>SitecoreAIService</strong> is the key bridge connecting your MCP server to <strong>SitecoreAI</strong></li>
</ul>
<p><strong>📋 Logging Configuration</strong></p>
<ul>
<li>All logs redirected to stderr from Trace level upward</li>
<li>Critical for Stdio transport - keeps stdout clean exclusively for MCP protocol messages</li>
</ul>
<p><strong>⚙️ MCP Server Wiring</strong></p>
<ul>
<li><code>AddMcpServer()</code> - registers MCP into the .NET DI pipeline; server name &amp; version auto-resolved via assembly reflection</li>
<li><code>WithStdioServerTransport()</code> - sets Stdio as the communication channel; swap with WithHttpTransport() for web-hosted scenarios</li>
<li><code>WithToolsFromAssembly()</code> - auto-discovers all MCP tools via reflection; no manual registration needed</li>
</ul>
<p><strong>🔐 Optional Authentication</strong></p>
<ul>
<li>Plug in <strong>API-key authentication</strong> via standard ASP.NET Core middleware for production-grade security</li>
</ul>
<p><strong>🚀 Host Execution</strong></p>
<ul>
<li><code>RunAsync()</code> keeps the process alive, listening for MCP messages from AI hosts like <strong>Claude Desktop</strong> or <strong>GitHub Copilot</strong></li>
</ul>
<h3 id="3-hahahugoshortcode12s35hbhb"><strong>3.</strong> <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Create the tool class:</span></h3>
<p>This is where your MCP server comes to life. In C#, MCP tools are simply well-designed methods that your AI model can discover and call - think of them as structured entry points into your business logic.</p>
<p>A typical MCP tool class in .NET looks like this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#50fa7b">[McpServerToolType]</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">static</span> <span style="color:#ff79c6">class</span> <span style="color:#50fa7b">SitecoreAITool</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">
</span></span></span><span style="display:flex;"><span><span style="color:#50fa7b">    [McpServerTool, Description(&#34;Retrieves child item details from Sitecore by specifying an item path or ID and language.&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">static</span> <span style="color:#8be9fd;font-style:italic">async</span> Task&lt;<span style="color:#8be9fd">string</span>&gt; GetChildDetails(SitecoreAIService sitecoreAIService,
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">            [Description(&#34;The item path (e.g., /sitecore/content/site-name/home) or item GUID (e.g., &#39;{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&#39;)&#34;)]</span> <span style="color:#8be9fd">string</span> path,
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">            [Description(&#34;Language code for the item (e.g., &#39;en&#39; for English, &#39;de&#39; for German). Default is &#39;en&#39;.&#34;)]</span> <span style="color:#8be9fd">string</span> language = <span style="color:#f1fa8c">&#34;en&#34;</span>,
</span></span><span style="display:flex;"><span>            CancellationToken cancellationToken = <span style="color:#ff79c6">default</span>)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#8be9fd">var</span> childDetails = <span style="color:#ff79c6">await</span> sitecoreAIService.GetChildDetails(path, language);
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">return</span> JsonSerializer.Serialize(childDetails);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div>
<ul>
<li>A class decorated with <code>[McpServerToolType]</code> - this tells the SDK it&rsquo;s a tool container</li>
<li>Individual methods marked with <code>[McpServerTool]</code>, each with a clear Description so the AI understands what the tool does and when to use it</li>
</ul>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">A few design principles worth following:
</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Be goal-oriented, not CRUD-driven - </span> instead of exposing a raw <code>GetSales()</code> method, name and describe it as <strong>&ldquo;Summarise daily sales by channel&rdquo;</strong> so the model can use it intelligently</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Separate reads from writes - </span> mark read-only tools clearly and keep write operations minimal and auditable</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Fail gracefully - </span> validate inputs early and return descriptive error messages, this helps the AI model self-correct rather than stall</li>
</ul>
<div class="callout success">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>Explore More & Share Your Feedback</p>
    </div>
    <div class="callout-body">
        <p><p>I built the <span class="dark:text-gray-300 font-semibold gradient-text">SitecoreAI MCP tool</span> to fetch <strong>child item details</strong> from Sitecore directly via the <strong>configured</strong> SaaS <strong>Edge GraphQL endpoint</strong> - keeping everything clean, secure, and governed through the injected <strong>SitecoreAIService</strong>.<br/><br/></p>
<p>The tool accepts a required <strong>path</strong> parameter (either an item path like <code>/sitecore/content/sitename/home</code> or an item <code>GUID</code>) and an optional <strong>language</strong> code parameter for the item (e.g., &rsquo;en&rsquo; for English, &lsquo;de&rsquo; for German),defaults to &ldquo;en&rdquo;. It also supports graceful cancellation via CancellationToken.<br/><br/></p>
<p>Internally, it calls <code>sitecoreAIService.GetChildDetails(path, language)</code> and <strong>returns</strong> the result as a <strong>JSON string</strong> - typically containing the <strong>child item details</strong> along with its metadata.<br/><br/></p>
<p><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">This tool is ideal when your AI assistant needs to retrieve <strong>Sitecore child item information</strong> while ensuring the right governance, security controls, and auditable access boundaries are in place.</span> ⬇</p>
</p>
    </div>
</div>
<div class="github-card-wrapper">
    <a id="github-342ed376efcdbc40625ca89312dd979b" target="_blank" href="https://github.com/AmitKumar-AK/mcp-dotnet-tutorial" class="cursor-pointer">
      <div
        class="w-full md:w-auto p-0 m-0 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl"><div class="w-full nozoom">
            <img
              src="https://opengraph.githubassets.com/0/AmitKumar-AK/mcp-dotnet-tutorial"
              alt="GitHub Repository Thumbnail"
              class="nozoom mt-0 mb-0 w-full h-full object-cover">
          </div><div class="w-full md:w-auto pt-3 p-5">
          <div class="flex items-center">
            <span class="text-2xl text-neutral-800 dark:text-gray-300 me-2"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="currentColor" viewBox="3 3 18 18">
  <path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
</svg>
</span>
            <div
              id="github-342ed376efcdbc40625ca89312dd979b-full_name"
              class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-gray-300">
              AmitKumar-AK/mcp-dotnet-tutorial
            </div>
          </div>

          <p id="github-342ed376efcdbc40625ca89312dd979b-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-gray-300">
            Complete tutorial and guide for building Model Context Protocol (MCP) tools using C# .NET SDK. Includes step-by-step instructions, code examples, and a practical SitecoreAI MCP tool implementation to integrate AI capabilities with Sitecore content management.
          </p>

          <div class="m-0 mt-2 flex items-center">
            <span class="mr-1 inline-block h-3 w-3 rounded-full language-dot" data-language="C#"></span>
            <div class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              C#
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"/></svg></span>
            <div id="github-342ed376efcdbc40625ca89312dd979b-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7 5C7 3.89543 7.89543 3 9 3C10.1046 3 11 3.89543 11 5C11 5.74028 10.5978 6.38663 10 6.73244V14.0396H11.7915C12.8961 14.0396 13.7915 13.1441 13.7915 12.0396V10.7838C13.1823 10.4411 12.7708 9.78837 12.7708 9.03955C12.7708 7.93498 13.6662 7.03955 14.7708 7.03955C15.8753 7.03955 16.7708 7.93498 16.7708 9.03955C16.7708 9.77123 16.3778 10.4111 15.7915 10.7598V12.0396C15.7915 14.2487 14.0006 16.0396 11.7915 16.0396H10V17.2676C10.5978 17.6134 11 18.2597 11 19C11 20.1046 10.1046 21 9 21C7.89543 21 7 20.1046 7 19C7 18.2597 7.4022 17.6134 8 17.2676V6.73244C7.4022 6.38663 7 5.74028 7 5Z" fill="#000000"></path> </g></svg></span>
            <div id="github-342ed376efcdbc40625ca89312dd979b-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>
          </div>
        </div>
      </div>
      
      
      <script
        async
        type="text/javascript"
        src="/js/fetch-repo.min.dc5533c50cefd50405344b235937142271f26229fe39cbee27fd4960e8bb897a0beebfad77a1091ca91cd0d1fb14e70fc37cc114dd9674fb2c32e0ab512ec8a4.js"
        integrity="sha512-3FUzxQzv1QQFNEsjWTcUInHyYin&#43;OcvuJ/1JYOi7iXoL7r&#43;td6EJHKkc0NH7FOcPw3zBFN2WdPssMuCrUS7IpA=="
        data-repo-url="https://api.github.com/repos/AmitKumar-AK/mcp-dotnet-tutorial"
        data-repo-id="github-342ed376efcdbc40625ca89312dd979b"></script>
    </a>
  </div>
<h3 id="4-hahahugoshortcode12s43hbhb"><strong>4.</strong> <span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Run and connect from an AI host:</span></h3>
<p>Once the server is running locally or in a container:</p>
<ul>
<li>Configure an MCP‑aware host like Claude Desktop, Gemini CLI or VS Code Copilot to connect to your server via stdio or HTTP.</li>
<li>Point it at your executable or remote endpoint and provide any required API keys or environment variables.</li>
<li>Ask natural language queries like <strong>Use the .NET MCP server to list the latest orders and highlight any anomalies</strong> and watch the host call your tools.</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#6272a4">// .vscode/mcp.json
</span></span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;servers&#34;</span>: {
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;mcp-sitecoreai&#34;</span>: {
</span></span><span style="display:flex;"><span>			<span style="color:#ff79c6">&#34;type&#34;</span>: <span style="color:#f1fa8c">&#34;stdio&#34;</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#ff79c6">&#34;command&#34;</span>: <span style="color:#f1fa8c">&#34;dotnet&#34;</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#ff79c6">&#34;args&#34;</span>: [
</span></span><span style="display:flex;"><span>                <span style="color:#f1fa8c">&#34;run&#34;</span>,
</span></span><span style="display:flex;"><span>                <span style="color:#f1fa8c">&#34;--project&#34;</span>,
</span></span><span style="display:flex;"><span>				<span style="color:#f1fa8c">&#34;McpSitecoreAiExample.csproj&#34;</span>,
</span></span><span style="display:flex;"><span>            ]
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    },
</span></span><span style="display:flex;"><span>	<span style="color:#ff79c6">&#34;inputs&#34;</span>: []
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div>
<span class="dark:text-gray-300 font-semibold gradient-text">Once your foundation is set, start layering in custom MCP tools, sharpen your responses, and ship your MCP server as a reusable NuGet package for your team.</span>





















  
  
    
    <img
      title="Building a Custom MCP Server in .NET - Step-by-Step Overview"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/build-custom-mcp-server-dotnet-csharp/how_to_build_a_custom_mcp_server_in_c-sharp-sitecore-mvp-amit-kumar.gif"
      alt="Building a Custom MCP Server in .NET - Step-by-Step Overview"
      class="img justify-self-center  "
      width=""
      height="" />
  
  













<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-mcp-tool-structure-the-three-fundamental-elements" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🔩 MCP Tool Structure: The Three Fundamental Elements</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>


<p class="font-semibold text-xl  text-todo-color dark:text-gray-300">Every MCP tool in .NET consists of three essential parts:</p>
<ol>
<li><strong>Tool Class with [McpServerToolType] Attribute</strong> </br>
This decorator tells the MCP server that this class contains tool definitions.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#50fa7b">[McpServerToolType]</span> <span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#ff79c6">class</span> <span style="color:#50fa7b">CustomerTools</span> { 
</span></span><span style="display:flex;"><span><span style="color:#6272a4">// Tool methods go here </span>
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div>
<ol start="2">
<li><strong>Tool Methods with [McpServerTool] Attribute</strong> </br>
Each public method decorated with <code>[McpServerTool]</code> becomes an AI-accessible tool.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#50fa7b">[McpServerTool]</span>
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">[Description(&#34;Retrieves customer information by customer ID&#34;)]</span>
</span></span><span style="display:flex;"><span><span style="color:#8be9fd;font-style:italic">public</span> <span style="color:#8be9fd;font-style:italic">async</span> Task&lt;CustomerData&gt; GetCustomerById(
</span></span><span style="display:flex;"><span><span style="color:#50fa7b">    [Description(&#34;The unique customer identifier&#34;)]</span> <span style="color:#8be9fd">int</span> customerId,
</span></span><span style="display:flex;"><span>    CancellationToken cancellationToken = <span style="color:#ff79c6">default</span>)
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#6272a4">// Implementation here</span>
</span></span><span style="display:flex;"><span>}</span></span></code></pre></div>
<ol start="3">
<li><strong>Method Descriptions Using [Description] Attribute</strong> </br>
<code>Descriptions</code> are critical - they tell the AI when and how to use your tool. Write them as if you&rsquo;re instructing a human colleague.</li>
</ol>


<p class="font-semibold text-xl  text-danger-color dark:text-gray-300">❌ Bad Description:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#50fa7b">[Description(&#34;Gets customer&#34;)]</span></span></span></code></pre></div>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">✅ Good Description:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#50fa7b">[Description(&#34;Retrieves complete customer profile including contact info, purchase history, and support tickets by customer ID. Use this when the user asks about a specific customer or needs detailed customer information.&#34;)]</span></span></span></code></pre></div>
<span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">The AI uses these descriptions to decide which tool to call, so clarity is paramount.</span>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-why-this-matters-for-sitecore-enterprise-projects" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🔑 Why This Matters for Sitecore / Enterprise Projects</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>In earlier articles, we explored how <span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Model Context Protocol (MCP)</span> enables AI assistants to perform real, meaningful actions - not just generate text. The <span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Sitecore Marketer MCP</span> server puts that theory into practice with a working, real-world implementation.</p>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">With custom MCP tools we can:
</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Extend Sitecore automation</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Integrate internal services</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Build developer tools</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-par-four">Enable AI-driven operations</span></li>
</ul>
<p><strong><em>This makes MCP a key part of modern architecture.</em></strong></p>
<p><strong>Enjoyed this guide? Give it a ⭐ and show your support!</strong></p>
<div class="callout tip">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"/></svg><p>Support</p>
    </div>
    <div class="callout-body">
        <p><strong>If you enjoy this content, consider <a href="https://www.youtube.com/@AmitKumar-Info?sub_confirmation=1" target="_blank" rel="noopener">subscribing</a>
 📰 for more updates and insights. Your engagement is very important to me and helps me keep providing valuable resources! 🌟</strong></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-conclusion-empowering-ai-with-net" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🏁 Conclusion: Empowering AI with .NET</h2>
  
  
</div>
<p>Building custom MCP tools in .NET C# transforms AI assistants from generic chatbots into powerful, context-aware agents that understand your business. With the official C# SDK, dependency injection support, and .NET&rsquo;s robust ecosystem, you can create production-ready MCP servers that securely bridge AI and enterprise systems.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Key Takeaways:</p>
<ol>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">MCP tools are simple - </span> Just C# classes with attributes</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Descriptions matter - </span> They guide AI decision-making</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">Follow .NET patterns - </span> Async/await, DI, separation of concerns</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Start small, iterate - </span> Begin with 2-3 tools, expand based on usage</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Security first - </span> Never expose credentials, validate inputs, audit access</li>
</ol>
<span class="dark:text-gray-300 font-semibold gradient-text">Whether you're building AI-powered customer service, intelligent data analytics, or autonomous business workflows, MCP tools in .NET give you the foundation to make it real.</span>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="creditreferences" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧾Credit/References</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>



<div class="table-wrapper">
<table class="style-table"><tbody><tr><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html" target="_blank" rel="noopener">Sitecore Marketer MCP Documentation</a></td><td><a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/" target="_blank" rel="noopener">Sitecore Marketer MCP</a></td><td><a href="https://modelcontextprotocol.io" target="_blank" rel="noopener">Model Context Protocol</a></td></tr><tr><td><a href="https://github.com/modelcontextprotocol/csharp-sdk" target="_blank" rel="noopener">C# MCP SDK</a></td><td><a href="https://www.amitk.net/blog/mcp-server-vs-copilot-genai-agentic-ai/" target="_blank" rel="noopener">MCP vs Copilot vs GenAI Article</a></td><td><a href="https://github.com/modelcontextprotocol/csharp-sdk" target="_blank" rel="noopener">Official MCP C# SDK (GitHub)</a></td></tr><tr><td><a href="https://csharp.sdk.modelcontextprotocol.io" target="_blank" rel="noopener">MCP C# SDK Documentation</a></td><td><a href="https://github.com/iamgauravn/mcp_server/tree/main" target="_blank" rel="noopener">Gaurav Nandankar&rsquo;s GitHub Repo</a></td><td><a href="https://devblogs.microsoft.com/dotnet/build-a-model-context-protocol-mcp-server-in-csharp/" target="_blank" rel="noopener">Build a Model Context Protocol (MCP) server in C#</a></td></tr><tr><td><a href="https://www.anthropic.com/news/model-context-protocol" target="_blank" rel="noopener">Anthropic MCP Documentation</a></td><td><a href="https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection/overview" target="_blank" rel="noopener">Dependency Injection in .NET</a></td><td><a href="https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/async-scenarios" target="_blank" rel="noopener">Asynchronous programming scenarios</a></td></tr></tbody>
  
</table>
</div>
]]></content:encoded></item><item><title>Why MCP Server Matters: Copilot vs GenAI vs Agentic AI vs AI Agents Explained</title><link>https://www.amitk.net/blog/mcp-server-vs-copilot-genai-agentic-ai/</link><pubDate>Thu, 26 Feb 2026 00:00:00 +0000</pubDate><author>amit@amitk.net (Amit Kumar)</author><guid>https://www.amitk.net/blog/mcp-server-vs-copilot-genai-agentic-ai/</guid><media:content url="https://www.amitk.net/images/mcp-server-vs-copilot-genai-agentic-ai/mcp-server-vs-agentic-ai-comparison.gif" medium="image" type="image/gif"/><description>
Understand the difference between Copilot, GenAI, Agentic AI, AI Agents, and MCP Server - and why MCP is becoming critical for secure, enterprise-grade AI automation.</description><content:encoded><![CDATA[







<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-mcp-server-turning-ai-thinking-into-real-action" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📘 MCP Server: Turning AI Thinking into Real Action</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>Modern enterprises no longer want AI that only <strong><em>writes</em></strong> or <strong><em>suggests</em></strong> - they want AI that can <strong>act</strong>.</p>
<p>The <a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Model Context Protocol (MCP) Server</span></a>
 is the missing infrastructure that makes this possible. It acts as a secure, standardized bridge that allows <strong>Copilot</strong>, <strong>Generative AI</strong>, and <strong>AI agents</strong> to interact with real enterprise systems, tools, and data - safely, audibly, and at scale.</p>
<p>By connecting AI models to real tools, MCP Servers enable <span class="dark:text-gray-300 font-semibold gradient-text">Agentic AI</span> and <span class="dark:text-gray-300 font-semibold gradient-text-aqua">autonomous AI agents</span> to perform <strong>real tasks</strong> such as <strong>creating content</strong>, <strong>validating changes</strong>, <strong>orchestrating workflows</strong>, and <strong>publishing results</strong> - all while enforcing <strong>permissions</strong>, <strong>audit trails</strong>, and <strong>enterprise governance</strong>.</p>
<p>This is why <strong>MCP Server</strong> is quickly becoming <span class="dark:text-gray-300 font-semibold gradient-text">foundational infrastructure</span> for modern AI architectures.</p>


<p class="font-semibold text-xl  text-todo-color dark:text-gray-300">In this article, we'll clarify:</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text">What MCP Server actually does</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">How it differs from related AI concepts</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Why it matters for enterprises</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">How it works in practice using Sitecore Marketer MCP examples</span></li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-the-core-problem-ai-can-think-but-it-cant-act" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🚧 The Core Problem: AI Can Think, But It Can&#39;t Act</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>Most AI systems - whether <strong>GenAI</strong>, <strong>Copilot</strong>, or even <strong>Agentic AI</strong> - can generate content or propose plans, but they <strong>cannot safely act on enterprise systems</strong> like Sitecore CMS, CRM, or business platforms on their own.</p>


<p class="font-semibold text-xl  text-primary dark:text-gray-300">Without additional infrastructure, AI cannot:</p>
<ul>
<li>Create or update CMS content</li>
<li>Trigger enterprise workflows</li>
<li>Access live business data</li>
<li>Execute multi‑step operations</li>
<li>Work with enterprise permissions and security</li>
</ul>
<p>This is where <strong><em>MCP Server (Model Context Protocol)</em></strong> fills the gap.</p>
<p>MCP Server allows AI systems to <span class="dark:text-gray-300 font-semibold gradient-text-aqua">discover, understand, and invoke tools</span> in a controlled way. It provides:</p>
<ul>
<li>Permission‑scoped execution</li>
<li>Typed schemas for predictable behavior</li>
<li>Tool discovery</li>
<li>Full auditability</li>
</ul>
<div class="callout warning">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>Information</p>
    </div>
    <div class="callout-body">
        <p>In short, MCP Server standardizes how AI applications move from <strong>text generation to real-world action</strong>.</p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-understanding-the-key-components" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧠 Understanding the Key Components</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="generative-ai-genai-the-brain" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Generative AI (GenAI): The Brain</h3>
  
  
</div>
<p>Generative AI models (such as GPT-4 or Claude) are the core intelligence layer / underlying engine. They excel at producing new content - text, code, summaries, and ideas - based on prompts.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Strengths</p>
<ul>
<li>Content creation</li>
<li>Summaries and ideation</li>
</ul>


<p class="font-semibold text-xl  text-danger-color dark:text-gray-300">Limitations</p>
<ul>
<li>No execution capability</li>
<li>No direct access to tools or systems</li>
<li>No planning beyond a single response</li>
</ul>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">Example</p>
<ul>
<li>Using ChatGPT to draft a blog post</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="copilot-the-assistant" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Copilot: The Assistant</h3>
  
  
</div>
<p>Copilots embed GenAI directly into tools like VS Code, Microsoft 365, or Cursor. They observe user context and provide suggestions in real time.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Strengths</p>
<ul>
<li>In‑context recommendations</li>
<li>Code completion and productivity boosts</li>
<li>Excellent user experience</li>
</ul>


<p class="font-semibold text-xl  text-danger-color dark:text-gray-300">Limitations</p>
<ul>
<li>Not autonomous</li>
<li>Limited to the host application</li>
<li>Cannot orchestrate workflows across systems</li>
</ul>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">Example</p>
<ul>
<li>GitHub Copilot recommending code snippets</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="ai-agents-the-specialist" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">AI Agents: The Specialist</h3>
  
  
</div>
<p>AI Agents wrap GenAI with a specific goal and a set of tools. They can execute predefined tasks such as fetching data, find all broken links, filtering results, or performing simple operations.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Strengths</p>
<ul>
<li>Task execution</li>
<li>API-based automation</li>
<li>Goal‑oriented behavior</li>
</ul>


<p class="font-semibold text-xl  text-danger-color dark:text-gray-300">Limitations</p>
<ul>
<li>Dependent on available integrations</li>
<li>Often rely on custom or fragile API wrappers</li>
<li>Limited planning unless combined with Agentic AI</li>
</ul>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">Example</p>
<ul>
<li>An agent retrieving flight data from an API</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="agentic-ai-the-manager" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">Agentic AI: The Manager</h3>
  
  
</div>
<p>Agentic AI introduces autonomy, reasoning, and planning. Instead of following a script, it breaks goals into steps, selects tools, retries failures, and evaluates outcomes.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">Strengths</p>
<ul>
<li>Multi-step planning</li>
<li>Tool selection</li>
<li>Self-evaluation and retries</li>
</ul>


<p class="font-semibold text-xl  text-danger-color dark:text-gray-300">Limitations</p>
<ul>
<li>Still needs secure access to systems</li>
<li>Requires guardrails and validation</li>
<li>Cannot safely discover tools without MCP</li>
</ul>


<p class="font-semibold text-xl  text-example-color dark:text-gray-300">Example</p>
<ul>
<li>Planning a trip by checking weather, comparing flights, and booking within constraints</li>
</ul>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h3 id="mcp-server-model-context-protocol-the-hands-and-eyes" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">MCP Server (Model Context Protocol): The Hands and Eyes</h3>
  
  
</div>
<p>MCP Server is the <strong>execution and integration layer</strong> that allows AI systems to act safely.</p>


<p class="font-semibold text-xl  text-success-color dark:text-gray-300">What MCP Server Provides</p>
<ul>
<li>Standardized interface for AI-to-tool communication</li>
<li>Tool discovery and invocation</li>
<li>Secure, scoped permissions</li>
<li>Typed schemas for predictable behavior</li>
<li>Full audit logs and governance</li>
</ul>
<div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" width="22" height="22" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875.0 112.652 2.652L6.832 19.82a4.5 4.5.0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5.0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"></path></svg><p>In simple terms:</p>
    </div>
    <div class="callout-body">
        <p><strong>MCP Server is an API layer designed specifically for AI agents and LLMs.</strong></p>
    </div>
</div>


<p class="font-semibold text-xl  text-todo-color dark:text-gray-300">It tells the AI:</p>
<ul>
<li>What actions are allowed</li>
<li>Which tools can be used</li>
<li>How to call them</li>
<li>What inputs and outputs are expected</li>
</ul>
<p>Without <span class="dark:text-gray-300 font-semibold text-abstract-color">MCP Server</span>, <span class="dark:text-gray-300 font-semibold text-bug-color">Agentic AI cannot reliably interact with enterprise systems</span>.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-simple-comparison" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">📊 Simple Comparison</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<h3 id="enterprise-execution-comparison-genai-copilot-agentic-ai-and-mcp-server">Enterprise Execution Comparison: GenAI, Copilot, Agentic AI, and MCP Server</h3>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Technology</th><th>Primary Role</th><th>Can Take Actions</th><th>Enterprise‑Safe</th><th>Best For</th></tr>
      </thead><tbody><tr><td><strong>GenAI</strong></td><td>Content generation</td><td>❌</td><td>❌</td><td>Ideation</td></tr><tr><td><strong>Copilot</strong></td><td>In‑tool assistance</td><td>⚠️ Limited</td><td>⚠️ Limited</td><td>Productivity</td></tr><tr><td><strong>AI Agent</strong></td><td>Task execution</td><td>✅</td><td>⚠️ Depends</td><td>Automation</td></tr><tr><td><strong>Agentic AI</strong></td><td>Plan + reason + act</td><td>✅</td><td>❌ (without MCP)</td><td>Complex goals</td></tr><tr><td><strong>MCP Server</strong></td><td>Enable secure actions</td><td>🔑 Enables all</td><td>✅</td><td>Integration</td></tr></tbody>
  
</table>
</div>
<h3 id="capability-comparison-across-ai-models-and-mcp-server">Capability Comparison Across AI Models and MCP Server</h3>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Capability</th><th>GenAI</th><th>Copilot</th><th>AI Agent</th><th>Agentic AI</th><th>MCP Server</th></tr>
      </thead><tbody><tr><td><strong>Generates Content</strong></td><td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>❌ (It&rsquo;s a Bridge)</td></tr><tr><td><strong>Operates Autonomously</strong></td><td>❌</td><td>❌</td><td>✅</td><td>✅</td><td>❌</td></tr><tr><td><strong>Reasons &amp; Plans</strong></td><td>❌</td><td>❌</td><td>❌</td><td>✅</td><td>❌</td></tr><tr><td><strong>Standardized Tool Access</strong></td><td>❌</td><td>❌</td><td>❌</td><td>❌</td><td>✅</td></tr></tbody>
  
</table>
</div>
<div class="callout success">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg><p>Key takeaway:</p>
    </div>
    <div class="callout-body">
        <p><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">MCP Server is not an AI model - it is the bridge that allows AI systems to operate safely in the real world.</span></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-how-agentic-ai-and-mcp-server-work-together" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">⚒️ How Agentic AI and MCP Server Work Together</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>





















  
  
    
    <img
      title="Agentic AI, AI Agents, Copilot and GenAI"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/mcp-server-vs-copilot-genai-agentic-ai/MCP-vs-Agentic-AI.png"
      alt="The Role of MCP Servers in AI Evolution: Comparing GenAI, Copilots, Agents, and Agentic Systems"
      class="img justify-self-center  "
      width=""
      height="" />
  
  







<p class="font-semibold text-xl  text-primary dark:text-gray-300">What it shows (at a glance):</p>
<p><strong>Agentic AI and MCP Server play very different but complementary roles.</strong></p>
<p><strong>Agentic AI</strong> is responsible for <strong><em>thinking</em></strong>: understanding goals, reasoning, planning steps, choosing actions, and learning from outcomes. It behaves like a <strong>manager</strong>, deciding <strong><em>what should happen next.</em></strong></p>
<p><strong>MCP Server</strong>, on the other hand, is responsible for <strong><em>doing things safely</em></strong>. It acts as the <strong>execution and governance layer</strong>, exposing enterprise tools (CMS, CRM, APIs, databases) in a standardized, permission‑controlled way.</p>
<p>When Agentic AI decides to take action, it does not call enterprise systems directly. Instead, it invokes tools through the <strong>MCP Server</strong>, which:</p>
<ul>
<li>Validates permissions</li>
<li>Enforces schemas</li>
<li>Executes actions securely</li>
<li>Records audit logs</li>
</ul>
<p>This separation ensures that AI can act autonomously <strong>without bypassing enterprise security or governance.</strong></p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-why-mcp-server-is-critical-for-enterprises-and-sitecore" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🏢 Why MCP Server Is Critical for Enterprises (and Sitecore)</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>MCP Server turns GenAI and Copilots into <strong>secure</strong>, <strong>action-capable digital teammates</strong>.</p>
<p>For Sitecore, the <strong>Marketer MCP</strong> enables AI to:</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Create and update pages</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-ooey-gooey">Add or modify components</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">Search and manage assets</span></li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Update Fields</span></li>
</ul>
<p>Using natural language commands from tools like <strong>VS Code Copilot</strong>, the MCP Server:</p>
<ul>
<li>Authenticates securely</li>
<li>Maps intent to Sitecore Agent APIs</li>
<li>Executes actions with governance</li>
<li>Returns auditable results</li>
</ul>
<p>This removes fragile custom integrations and standardizes AI-to-CMS communication across teams.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-practical-example-sitecore-marketer-mcp" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧩 Practical Example: Sitecore Marketer MCP</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>


<p class="font-semibold text-xl  text-todo-color dark:text-gray-300">With Sitecore Marketer MCP:</p>
<ul>
<li>Agentic AI plans the steps</li>
<li>MCP Server exposes the correct tools</li>
<li>Sitecore Agent API executes securely</li>
</ul>
<p>Developers can configure MCP in <code>.vscode/mcp.json</code>, turning the IDE into a <strong>Sitecore command center</strong>.</p>
<div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>Sitecore Marketer MCP & VS Code Integration</p>
    </div>
    <div class="callout-body">
        <p><strong>A detailed walkthrough is available here</strong> 🔗 <a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/" target="_blank" rel="noopener">Unlocking the Power of Sitecore Marketer MCP with Visual Studio Code</a></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-when-to-use-what" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧑‍💻 When to Use What</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Use GenAI</span> for writing, summaries, ideation</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Use Copilot</span> for productivity inside tools</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-vital-ocean">Use AI Agents</span> for predefined automation</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-par-four">Use Agentic AI</span> for reasoning and orchestration</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text-sea-salt">Use MCP Server</span> when AI must securely interact with real enterprise systems</li>
</ul>
<div class="callout success">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14.0 01.865-.501 48.172 48.172.0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394.0 0012 3c-2.392.0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"></path></svg><p>Final Thought</p>
    </div>
    <div class="callout-body">
        <p><strong>MCP Server doesn&rsquo;t replace GenAI, Copilot, or Agentic AI -</strong> <span class="dark:text-gray-300 font-semibold gradient-text">it empowers them</span>.
<br/><br/>
It is the connective layer that allows AI to move from <strong><em>thinking</em></strong> to <strong>doing</strong>, safely and at enterprise scale.</p>
    </div>
</div>
<p><strong>Enjoyed this guide? Give it a ⭐ and show your support!</strong></p>
<div class="callout tip">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"/></svg><p>Support</p>
    </div>
    <div class="callout-body">
        <p><strong>If you enjoy this content, consider <a href="https://www.youtube.com/@AmitKumar-Info?sub_confirmation=1" target="_blank" rel="noopener">subscribing</a>
 📰 for more updates and insights. Your engagement is very important to me and helps me keep providing valuable resources! 🌟</strong></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="creditreferences" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧾Credit/References</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>



<div class="table-wrapper">
<table class="style-table"><tbody><tr><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html" target="_blank" rel="noopener">Sitecore Marketer MCP Documentation</a></td><td><a href="https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/" target="_blank" rel="noopener">Sitecore Marketer MCP</a></td><td><a href="https://modelcontextprotocol.io" target="_blank" rel="noopener">Official Model Context Protocol (MCP) Introduction</a></td></tr><tr><td><a href="https://code.visualstudio.com" target="_blank" rel="noopener">VS Code MCP Servers</a></td><td><a href="https://www.cloudflare.com/en-gb/learning/ai/what-is-model-context-protocol-mcp/" target="_blank" rel="noopener">Cloudflare: What Is MCP?</a></td><td><a href="https://www.flux-digital.com/blog/setting-up-sitecore-mcp-server-with-xp-vscode-copilot" target="_blank" rel="noopener">Setting up Sitecore MCP Server with XP &amp; VS Code</a></td></tr><tr><td><a href="https://www.geeksforgeeks.org/artificial-intelligence/what-is-agentic-ai/" target="_blank" rel="noopener">What is Agentic AI?</a></td><td><a href="https://www.descope.com/learn/post/mcp" target="_blank" rel="noopener">Descope&rsquo;s MCP Guide</a></td><td><a href="https://www.geeksforgeeks.org/artificial-intelligence/gen-ai-vs-ai-agents-vs-agentic-ai" target="_blank" rel="noopener">AI Comparisons</a></td></tr><tr><td><a href="https://www.ibm.com/think/topics/agentic-ai" target="_blank" rel="noopener">Agentic AI</a></td><td><a href="https://www.freshworks.com/freshdesk/ai-agent/vs-agentic-ai/" target="_blank" rel="noopener">Agentic AI vs AI agents: what’s the difference?</a></td><td><a href="https://www.moveworks.com/us/en/resources/blog/agentic-ai-vs-ai-agents-definitions-and-differences" target="_blank" rel="noopener">AI agent vs. agentic AI: definitions, comparison, and 5 key differences</a></td></tr></tbody>
  
</table>
</div>
]]></content:encoded></item><item><title>Sitecore Marketer MCP &amp; VS Code Integration</title><link>https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/</link><pubDate>Sat, 31 Jan 2026 00:00:00 +0000</pubDate><author>amit@amitk.net (Amit Kumar)</author><guid>https://www.amitk.net/blog/sitecore-marketer-mcp-vscode-integration/</guid><media:content url="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/sitecore-marketer-mcp-Sitecore.gif" medium="image" type="image/gif"/><description>
Discover how to integrate Sitecore Marketer MCP with Visual Studio Code for enhanced AI-driven content management, streamlining tasks and boosting productivity.</description><content:encoded><![CDATA[<p>This article explores how to connect <a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Sitecore Marketer MCP (Model Context Protocol)</span></a>
 with <strong>Visual Studio Code</strong> to improve <span class="dark:text-gray-300 font-semibold gradient-text-aqua">AI-driven content management</span>. It shows <strong>how Sitecore Marketer MCP</strong>, using the <a href="https://api-docs.sitecore.com/ai-capabilities/agent-api" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">SitecoreAI Agent API</span></a>
, helps with <strong>creating</strong> and <strong>updating content</strong> including <strong>marketing tasks</strong>. The guide explains the <strong>benefits of Sitecore Marketer MCP</strong> compared to regular Copilot solutions and provides a step-by-step tutorial for easy <strong>integration</strong> with <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Visual Studio Code</span>, boosting your <strong>content workflows</strong> with advanced <strong>AI technology</strong>.</p>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-what-is-mcp-model-context-protocol" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🤖 What is MCP (Model Context Protocol)?</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>The <a href="https://modelcontextprotocol.io" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Model Context Protocol (MCP)</span></a>
 is an <strong>open standard</strong> that changes how <strong>AI tools</strong> work by <strong>linking AI apps</strong> to <strong>outside systems</strong> like <strong>data sources</strong>, <strong>tools</strong>, and <strong>workflows</strong>. Instead of using fragile, custom connections, it <strong>offers</strong> a <strong>unified</strong>, <strong>neutral way</strong> for <strong>any AI</strong> that <strong>supports MCP</strong> to easily <strong>connect</strong> with <strong>MCP servers</strong>. With more than 17,000 servers, MCP works with many applications, from web browsing to <strong>managing enterprise content</strong>.</p>
<p>In <strong>enterprise projects</strong> like <a href="https://www.amitk.net/blog/nextjs-app-router-content-sdk-sitecore-wildcard-pages/" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Sitecore implementations</span></a>
, it&rsquo;s important to use curated, secure, and <strong>well-managed MCP servers</strong>. Created by <a href="https://www.anthropic.com/news/model-context-protocol" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Anthropic</span></a>
, <strong>MCP</strong> sets a standard for how AI models <strong>connect</strong> to <strong>outside systems</strong>, ensuring they work well with AI clients like <a href="https://claude.com/product/overview" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Claude</span></a>
, <a href="https://openai.com/index/chatgpt/" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">ChatGPT</span></a>
, and <a href="https://code.visualstudio.com/docs/copilot/overview" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">VS Code Copilot</span></a>
. <strong><em>This protocol allows AI models to safely access data, tools, and business workflows, improving flexibility and integration</em></strong>.</p>





















  
  
    
    <img
      title="Introduction to Model Context Protocol (MCP)"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/what-is-mcp-Sitecore-Marketer-MCP-Sitecore-MVP-Amit-Kumar.png"
      alt="Unlocking the Power of Sitecore Marketer MCP with Visual Studio Code"
      class="img justify-self-center  "
      width=""
      height="" />
  
  







<p class="font-semibold text-xl  text-primary dark:text-gray-300">What it shows (at a glance):</p>
<ul>
<li>An AI app (host) uses an MCP client to connect to an MCP server.</li>
<li>Messages use JSON‑RPC over stdio (local) or Streamable HTTP (remote).</li>
<li>The server exposes three core capabilities: Tools, Resources, and Prompts.</li>
<li>Basic flow: discover → invoke tool → return results/context</li>
</ul>
<p>📹 <strong>Learn More About MCP</strong></p>
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/agBbdiOPLQA?autoplay=0&amp;controls=1&amp;end=60&amp;loop=0&amp;mute=0&amp;start=30" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
    </div>

<br/>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-introduction-to-sitecore-marketer-mcp" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧠 Introduction to Sitecore Marketer MCP</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Sitecore Marketer MCP</span></a>
 is a <strong>powerful tool</strong> that changes <strong>content management</strong> by adding <strong>advanced AI features</strong> to the <strong>SitecoreAI</strong> platform. This <strong>server</strong> uses the <strong>SitecoreAI Agent API</strong> to allow smooth <strong>interactions between AI assistants</strong> and <a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html#marketer-mcp-tools-reference" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Sitecore's marketing tools</span></a>
. It lets users manage <strong>content</strong>, <strong>assets</strong>, and <strong>data</strong> with <a href="https://www.nuance.com/products/help/dragon152/dragon-for-pc/enx/professionalindividual/Content/Commands/about_natural_language_commands.htm?srsltid=AfmBOoouRJD_TEQhM6jYLmnHq-dwMW2jWIlOQ73gmvvSu__5oAl5IWU6" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">natural language commands</span></a>
, making workflows <strong>easier</strong> and <strong>boosting productivity</strong>. Unlike traditional APIs, it is user-friendly for both developers and marketers, providing a more flexible and secure content management experience.</p>
<p>Built on the <a href="https://github.com/modelcontextprotocol" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">open-standard Model Context Protocol (MCP)</span></a>
, <strong>Sitecore Marketer MCP</strong> lets <strong>AI agents</strong> safely work with <strong>Sitecore&rsquo;s marketing tools</strong>. This <strong>integration allows AI</strong> to not only offer <strong>suggestions</strong> but also perform actions like <strong>creating</strong> or <strong>editing content</strong> and optimizing <strong>campaigns</strong>, without needing <strong>manual</strong> UI navigation or <strong>complex API</strong> calls. The protocol includes <strong>safeguards</strong> like scoped <strong>permissions</strong> and <strong>audit trails</strong> to ensure secure and <strong>efficient operations</strong>. By allowing <strong>faster</strong> experimentation with <strong>less risk</strong>, Sitecore Marketer MCP <strong>helps</strong> marketers <strong>innovate</strong> and adapt <strong>quickly</strong>, making it a <strong>key feature</strong> in <strong>Sitecore&rsquo;s</strong> latest updates and discussions.</p>





















  
  
    
    <img
      title="Sitecore Marketer MCP"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/what-is-Sitecore-Marketer-MCP-Sitecore-MVP-Amit-Kumar.png"
      alt="Unlocking the Power of Sitecore Marketer MCP with Visual Studio Code"
      class="img justify-self-center  "
      width=""
      height="" />
  
  







<p class="font-semibold text-xl  text-todo-color dark:text-gray-300">Why these components?:</p>
<ul>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Marketer MCP exposes "tools" that directly map to business‑level actions </span>(e.g., create page, add component, upload asset). Those tools proxy to <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Agent API endpoints</span>, so AI assistants can perform actions from natural‑language prompts - no manual UI or raw API calls.</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Security & governance:</span> operations run under your existing Sitecore roles with auditability and human‑in‑the‑loop approval rules where configured.</li>
<li><span class="dark:text-gray-300 font-semibold gradient-text">Transport & protocol:</span> Requests flow via <span class="dark:text-gray-300 font-semibold gradient-text-aqua">MCP (JSON‑RPC)</span> over <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Streamable HTTP (remote)</span> or <span class="dark:text-gray-300 font-semibold gradient-text-aqua">stdio</span> (local), following the standard MCP architecture.</li>
</ul>
<h3 id="list-of-available-tools-from-sitecore-marketer-mcp">List of available tools from Sitecore Marketer MCP</h3>
<p>By default, all the <a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html#marketer-mcp-tools-reference" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Marketer MCP tools</span></a>
 are enabled. To <strong>fully use</strong> the <strong>Marketer MCP</strong>, it&rsquo;s <strong>recommended</strong> to <strong>enable each tool</strong>. Each tool <strong>matches</strong> an <strong>endpoint</strong> of the <strong>Agent API</strong> used by the <strong>MCP</strong> to perform <strong>actions</strong> in <strong>Sitecore</strong>.</p>





















  
  
    
    <img
      title="Sitecore Marketer MCP tools"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/Marketer-MCP-tools-reference-Sitecore-MVP-Amit-Kumar.png"
      alt="Marketer MCP tools"
      class="img justify-self-center  "
      width=""
      height="" />
  
  





<h4 id="-site-management">🗂️ Site Management</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>list_sites</strong></td><td>Lists all sites available in the tenant.</td></tr><tr><td><strong>get_site_information</strong></td><td>Retrieves detailed information for a specific site.</td></tr><tr><td><strong>get_site_id_from_item</strong></td><td>Retrieves the site ID that is linked to a specific item ID.</td></tr><tr><td><strong>get_all_pages_by_site</strong></td><td>Retrieves a list of pages for a specific site, including the ID and path of each page.</td></tr></tbody>
  
</table>
</div>
<h4 id="-page-management">📄 Page Management</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>create_content_item</strong></td><td>Creates a new content item using the specified template and field values.</td></tr><tr><td><strong>update_content</strong></td><td>Updates an existing content item.</td></tr><tr><td><strong>delete_content</strong></td><td>Deletes a specific content item.</td></tr><tr><td><strong>get_content_item_by_path</strong></td><td>Retrieves a published content item (Experience Edge) by path.</td></tr><tr><td><strong>get_content_item_by_id</strong></td><td>Retrieves a published content item (Experience Edge) by ID.</td></tr><tr><td><strong>list_available_insertoptions</strong></td><td>Retrieves a list of content templates that you can add as child items under a specific parent item.</td></tr></tbody>
  
</table>
</div>
<h4 id="-content-management">📃 Content Management</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>list_sites</strong></td><td>Lists all sites available in the tenant.</td></tr><tr><td><strong>get_site_information</strong></td><td>Retrieves detailed information for a specific site.</td></tr><tr><td><strong>get_site_id_from_item</strong></td><td>Retrieves the site ID that is linked to a specific item ID.</td></tr><tr><td><strong>get_all_pages_by_site</strong></td><td>Retrieves a list of pages for a specific site, including the ID and path of each page.</td></tr></tbody>
  
</table>
</div>
<h4 id="-component-tools">🛠️ Component Tools</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>list_components</strong></td><td>Retrieves a list of components available for a specific site.</td></tr><tr><td><strong>get_component</strong></td><td>Retrieves the details of a specific component, including its ID, name, and datasource.</td></tr><tr><td><strong>create_component_datasource</strong></td><td>Creates a new datasource item for a specific component using the given data field values.</td></tr><tr><td><strong>search_component_datasources</strong></td><td>Searches for available datasources that can be used with a specific component.</td></tr></tbody>
  
</table>
</div>
<h4 id="-asset-management">🖼️ Asset Management</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>search_assets</strong></td><td>Searches for digital assets like videos, images, and documents using query terms, file types, or tags.</td></tr><tr><td><strong>get_asset_information</strong></td><td>Retrieves details of a specific asset.</td></tr><tr><td><strong>update_asset</strong></td><td>Updates metadata for an existing asset.</td></tr><tr><td><strong>upload_asset</strong></td><td>Uploads a new digital asset to the system and saves it with the given metadata.</td></tr></tbody>
  
</table>
</div>
<h4 id="-personalization">👤 Personalization</h4>



<div class="table-wrapper">
<table class="style-table"><thead>
        <tr><th>Tool</th><th>Description</th></tr>
      </thead><tbody><tr><td><strong>get_personalization_versions_by_page</strong></td><td>Gets all the personalization versions set up for a specific page.</td></tr><tr><td><strong>create_personalization_version</strong></td><td>Creates a new version of a page for personalization, allowing you to set targeting rules for different audiences.</td></tr><tr><td><strong>get_personalization_condition_templates</strong></td><td>Retrieves all the condition templates available for personalization.</td></tr><tr><td><strong>get_personalization_condition_template_by_id</strong></td><td>Retrieves a condition template by ID, including its parameters, to create a personalized version of a page.</td></tr></tbody>
  
</table>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-how-to-integrate-sitecore-marketer-mcp-with-visual-studio-code" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧑‍💻 How to Integrate Sitecore Marketer MCP with Visual Studio Code</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>


<p class="font-semibold text-xl  text-primary dark:text-gray-300">Integrating the Marketer MCP server with Visual Studio Code and GitHub Copilot:</p>
<ul>
<li>
<p>Transforms your development environment into a powerful Sitecore content assistant.</p>
</li>
<li>
<p>This integration enhances the developer experience by turning VS Code into a comprehensive content-orchestration hub, allowing seamless interaction with Sitecore&rsquo;s
AI-driven features.</p>
</li>
<li>
<p>With native support for MCP servers through GitHub Copilot and related extensions, users can query Sitecore content, generate code snippets aligned with Sitecore schemas,
and automate marketing tasks using natural language prompts.</p>
<div class="callout info">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75.0 011.063.852l-.708 2.836a.75.75.0 001.063.853l.041-.021M21 12A9 9 0 113 12a9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"></path></svg><p>What is SitecoreAI (FKA XM Cloud)?</p>
    </div>
    <div class="callout-body">
        <p><p>To learn more about SitecoreAI (FKA XM Cloud), watch the video below for detailed information.</p>
<br/>
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/igOJ21AfDtc?autoplay=0&amp;controls=1&amp;end=60&amp;loop=0&amp;mute=0&amp;start=30" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
    </div></p>
    </div>
</div>
</li>
</ul>
<h3 id="step-by-step-vs-code-configuration">Step-by-Step: VS Code Configuration</h3>
<p><strong>1. Prerequisites:</strong></p>
<ul>
<li>
<p>Visual Studio Code with the GitHub Copilot extension enabled.</p>
</li>
<li>
<p>Access to the Sitecore Marketer MCP server (typically provided via a specific URL <a href="https://edge-platform.sitecorecloud.io/mcp/marketer-mcp-prod" target="_blank" rel="noopener">https://edge-platform.sitecorecloud.io/mcp/marketer-mcp-prod</a>
 from your Sitecore setup).</p>
</li>
<li>
<p>Ensure your organization&rsquo;s Copilot administrator has enabled the necessary permissions.</p>
<div class="callout warning">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="22" height="22"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73.0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898.0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"></path></svg><p>Important</p>
    </div>
    <div class="callout-body">
        <p>A common hurdle: If the <strong>START MCP SERVER</strong> option doesn&rsquo;t appear later, your <strong>admin</strong> may need to <strong>re-enable</strong> MCP access in the <strong>Copilot admin UI</strong>, as noted in related VS Code issues <a href="https://github.com/microsoft/vscode/issues/255952" target="_blank" rel="noopener">here</a></p>
    </div>
</div>
</li>
</ul>
<p><strong>2. Configuration in VS Code:</strong></p>
<p>Create or edit a file at <code>.vscode/mcp.json</code> in your <span class="dark:text-gray-300 font-semibold gradient-text-aqua">project root</span> (or workspace) or a <span class="dark:text-gray-300 font-semibold gradient-text">user-level</span> <code>mcp.json</code> (<code>C:\Users\[UserName]\AppData\Roaming\Code\User</code>). Add your <strong>MCP server entry</strong>. Example for a <strong>hosted/remote server</strong> (adapt URL to your Sitecore Marketer MCP endpoint):</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#6272a4">// Sitecore Marketer MCP Server configuration for AI-driven content management in Visual Studio Code.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Enables integration with SitecoreAI, and Copilot for advanced marketing automation, 
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// content orchestration, and secure API access.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// For more details, visit: https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  {
</span></span><span style="display:flex;"><span>    <span style="color:#ff79c6">&#34;servers&#34;</span>: {
</span></span><span style="display:flex;"><span>          <span style="color:#ff79c6">&#34;sitecore-marketer-mcp&#34;</span>: {
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;url&#34;</span>: <span style="color:#f1fa8c">&#34;https://edge-platform.sitecorecloud.io/mcp/marketer-mcp-prod&#34;</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;auth&#34;</span>: {
</span></span><span style="display:flex;"><span>          <span style="color:#ff79c6">&#34;type&#34;</span>: <span style="color:#f1fa8c">&#34;external&#34;</span>
</span></span><span style="display:flex;"><span>        },
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;type&#34;</span>: <span style="color:#f1fa8c">&#34;http&#34;</span>
</span></span><span style="display:flex;"><span>      }
</span></span><span style="display:flex;"><span>      }
</span></span><span style="display:flex;"><span>  }</span></span></code></pre></div>
<p><strong>3. Restart and Use:</strong></p>
<p><span class="dark:text-gray-300 font-semibold gradient-text">i)</span> Save the <code>mcp.json</code> file.</p>
<p><span class="dark:text-gray-300 font-semibold gradient-text">ii)</span> Fully restart VS Code and ensure you are signed into Copilot.</p>
<p><span class="dark:text-gray-300 font-semibold gradient-text">iii)</span> Once configured correctly, VS Code should detect it. Look for options like <strong>START MCP server</strong> or <strong>MCP-related commands</strong> in the <strong>Command Palette (Ctrl+Shift+P)</strong> or Copilot Chat.</p>
<p><span class="dark:text-gray-300 font-semibold gradient-text">iv)</span> Visual Studio Code will expose the <strong>START MCP server</strong> option, allowing Copilot and other AI extensions to interact with the MCP server.</p>
<p>

<p class="font-semibold text-xl  text-primary dark:text-gray-300">Getting Started with the Sitecore Marketer MCP Demo:</p>





















  
  
    
    <img
      title="Marketer MCP and Agent API overview"
      loading="lazy"
      decoding="async"
      src="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/ai-capabilities-in-SitecoreAI.gif"
      alt="Marketer MCP and Agent API overview"
      class="img justify-self-center  "
      width=""
      height="" />
  
  




</p>
<p><span class="dark:text-gray-300 font-semibold gradient-text">v)</span> The AI in your editor (e.g., Copilot Chat) will now have access to the tools provided by the Sitecore Marketer MCP server.</p>
<p><strong>4. Troubleshooting:</strong></p>
<p>If the <strong>START MCP server</strong> option does not appear:</p>
<ul>
<li>
<p>Verify that <strong>GitHub Copilot</strong> is enabled for your account</p>
</li>
<li>
<p>Ensure your organization has not disabled MCP access</p>
</li>
</ul>

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   
   
     
     <img
       title="GitHub Copilot Access"
       loading="lazy"
       decoding="async"
       src="https://www.amitk.net/images/sitecore-marketer-mcp-vscode-integration/GitHubCopilot-MCP-tools-Sitecore-MVP-Amit-Kumar.png"
       alt="GitHub Copilot Access"
       class="img justify-self-center  "
       width=""
       height="" />
   
   
 
 
 
 

<ul>
<li>
<p>Contact your <strong>organization admin</strong> to re-enable MCP in the Copilot Admin UI</p>
</li>
<li>
<p>For official Marketer MCP, confirm your Sitecore account has required permissions and the endpoint is correctly provisioned.</p>
</li>
</ul>
<p><strong>5. Utilization: Once connected:</strong></p>
<ul>
<li>
<p>In GitHub Copilot Chat , use natural language prompts tied to Sitecore, e.g., <span class="dark:text-gray-300 font-semibold gradient-text">Create a Sitecore content item for a new blog post</span> or <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Generate JSS component code for a personalized banner from Sitecore data</span>.</p>
</li>
<li>
<p>Combine with VS Code&rsquo;s AI features for code generation.</p>
</li>
<li>
<p>Safely experiment with AI-driven Sitecore content changes and marketing tasks</p>
</li>
<li>
<p>Extend to web chatbots or other tools by referencing the same MCP server.</p>
</li>
<li>
<p>When you use a prompt like <span class="dark:text-gray-300 font-semibold gradient-text">Create item with name [Item Name] based on template [template name]</span>, followed by <span class="dark:text-gray-300 font-semibold gradient-text-aqua">Update field on Content Item</span>, the <code>update_fields_on_content_item</code> tool is triggered. It will <strong>automatically</strong> use the <strong>newly created Item ID</strong> to update the content item with your specified values. The required <strong>JSON payload</strong> will look like this:</p>
</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#6272a4">// Example: Update Sitecore content item fields using Marketer MCP tool in VS Code.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Automate headless CMS workflows, AI-powered content updates, and marketing operations with SitecoreAI, 
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Copilot, and Experience Edge.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Ideal for scalable, secure, and efficient Sitecore content management.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// More info: https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;fields&#34;</span>: {
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;image&#34;</span>: <span style="color:#f1fa8c">&#34;&lt;image mediaid=\&#34;\&#34; alt=\&#34;Contoso Logo\&#34; width=\&#34;904\&#34; height=\&#34;460\&#34; /&gt;&#34;</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;paragraph1&#34;</span>: <span style="color:#f1fa8c">&#34;Lorem ipsum dolor sit amet, consectetur adipiscing elit&#34;</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#ff79c6">&#34;title&#34;</span>: <span style="color:#f1fa8c">&#34;Lorem ipsum dolor&#34;</span>
</span></span><span style="display:flex;"><span>      },
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;itemId&#34;</span>: <span style="color:#f1fa8c">&#34;dd8c3d91-b57b-4f0b-a574-e4c02b683b48&#34;</span>
</span></span><span style="display:flex;"><span>    }</span></span></code></pre></div>
<ul>
<li>When you use a prompt such as <span class="dark:text-gray-300 font-semibold gradient-text">Add Component [Component Name] inside placeholder [Placeholder Name] on Page [Page Name]</span>, the <code>add_component_on_page</code> tool is triggered. It will generate a <strong>JSON payload</strong> similar to the following:</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#6272a4">// Example: Add a component to a Sitecore page using the add_component_on_page tool.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Streamline headless CMS personalization, automate component placement, and enhance marketing workflows with 
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// SitecoreAI and Copilot.
</span></span></span><span style="display:flex;"><span><span style="color:#6272a4">// Supports scalable, AI-driven content management in Experience Edge and JSS environments.
</span></span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>   {
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;componentItemName&#34;</span>: <span style="color:#f1fa8c">&#34;Hero Banner&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;componentRenderingId&#34;</span>: <span style="color:#f1fa8c">&#34;ccd1c539-a271-4fc0-ae04-0e78fa722b9b&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;fields&#34;</span>: {},
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;language&#34;</span>: <span style="color:#f1fa8c">&#34;en&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;pageId&#34;</span>: <span style="color:#f1fa8c">&#34;82932c57-15b6-4720-9603-a2c1a397ba5b&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#ff79c6">&#34;placeholderPath&#34;</span>: <span style="color:#f1fa8c">&#34;headless-main&#34;</span>
</span></span><span style="display:flex;"><span>    }</span></span></code></pre></div>
<p><strong>Enjoyed this guide? Give it a ⭐ and show your support!</strong></p>
<div class="callout tip">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"/></svg><p>Support</p>
    </div>
    <div class="callout-body">
        <p><strong>If you enjoy this content, consider <a href="https://www.youtube.com/@AmitKumar-Info?sub_confirmation=1" target="_blank" rel="noopener">subscribing</a>
 📰 for more updates and insights. Your engagement is very important to me and helps me keep providing valuable resources! 🌟</strong></p>
    </div>
</div>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="-conclusion-the-future-is-integrated" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧭 Conclusion: The Future is Integrated</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>
<p>The <strong><em>Sitecore Marketer MCP revolutionizes content management</em></strong> by <strong>integrating AI capabilities</strong> through the <strong>open Model Context Protocol (MCP)</strong> and the <strong>safety-focused Agent API</strong>. This <strong>integration</strong> with <strong>Visual Studio Code</strong> enhances flexibility, safety, and scalability, empowering organizations to <strong>innovate</strong> rapidly while maintaining <strong>control</strong> over their Sitecore ecosystem. By <strong>adopting</strong> Sitecore Marketer MCP early, businesses <strong>position</strong> themselves at the <strong>forefront</strong> of <strong>AI-driven digital experiences</strong>, streamlining <strong>content management</strong> and <strong>bridging</strong> code with <strong>marketing tasks</strong>. For the latest setup, refer to Sitecore&rsquo;s documentation on <a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html#marketer-mcp-tools-reference" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">Marketer MCP</span></a>
.</p>
<div class="callout success">
    <div class="callout-head"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"/></svg><p>Explore More & Share Your Feedback</p>
    </div>
    <div class="callout-body">
        <p>Find <strong>setup guides</strong> and <strong>ready-to-use</strong> <span class="dark:text-gray-300 font-semibold gradient-text">Sitecore Marketer MCP prompts</span> in the <a href="https://github.com/AmitKumar-AK/sitecore-marketer-mcp-prompts" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text-aqua">Sitecore Marketer MCP Prompts &amp; VS Code Integration</span></a>
 GitHub repo. <strong>Prompts</strong> for SitecoreAI sites, pages, and components are organized in <a href="https://github.com/AmitKumar-AK/sitecore-marketer-mcp-prompts/blob/main/docs/prompts/README.md" target="_blank" rel="noopener"><span class="dark:text-gray-300 font-semibold gradient-text">docs/prompts</span></a>
.
<br/><br/>
<strong><em>Share your feedback or contribute to support the Sitecore developer community!</em></strong></p>
    </div>
</div>
<div class="github-card-wrapper">
    <a id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f" target="_blank" href="https://github.com/AmitKumar-AK/sitecore-marketer-mcp-prompts" class="cursor-pointer">
      <div
        class="w-full md:w-auto p-0 m-0 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl"><div class="w-full nozoom">
            <img
              src="https://opengraph.githubassets.com/0/AmitKumar-AK/sitecore-marketer-mcp-prompts"
              alt="GitHub Repository Thumbnail"
              class="nozoom mt-0 mb-0 w-full h-full object-cover">
          </div><div class="w-full md:w-auto pt-3 p-5">
          <div class="flex items-center">
            <span class="text-2xl text-neutral-800 dark:text-gray-300 me-2"><svg height=1.2em class="hx:inline-block hx:align-middle" fill="currentColor" viewBox="3 3 18 18">
  <path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
</svg>
</span>
            <div
              id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f-full_name"
              class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-gray-300">
              AmitKumar-AK/sitecore-marketer-mcp-prompts
            </div>
          </div>

          <p id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-gray-300">
            This repository provides ready-to-use <code>mcp.json</code> configuration and a collection of practical prompts for integrating Sitecore Marketer MCP with Visual Studio Code and GitHub Copilot. Use these resources to automate content management, marketing workflows, and personalization in Sitecore Headless, SitecoreAI and Experience Edge environments.
          </p>

          <div class="m-0 mt-2 flex items-center">
            <span class="mr-1 inline-block h-3 w-3 rounded-full language-dot" data-language="default"></span>
            <div class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              null
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"/></svg></span>
            <div id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>

            <span class="text-md mr-1 text-neutral-800 dark:text-gray-300"><svg height=1.2em class="hx:inline-block hx:align-middle" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M7 5C7 3.89543 7.89543 3 9 3C10.1046 3 11 3.89543 11 5C11 5.74028 10.5978 6.38663 10 6.73244V14.0396H11.7915C12.8961 14.0396 13.7915 13.1441 13.7915 12.0396V10.7838C13.1823 10.4411 12.7708 9.78837 12.7708 9.03955C12.7708 7.93498 13.6662 7.03955 14.7708 7.03955C15.8753 7.03955 16.7708 7.93498 16.7708 9.03955C16.7708 9.77123 16.3778 10.4111 15.7915 10.7598V12.0396C15.7915 14.2487 14.0006 16.0396 11.7915 16.0396H10V17.2676C10.5978 17.6134 11 18.2597 11 19C11 20.1046 10.1046 21 9 21C7.89543 21 7 20.1046 7 19C7 18.2597 7.4022 17.6134 8 17.2676V6.73244C7.4022 6.38663 7 5.74028 7 5Z" fill="#000000"></path> </g></svg></span>
            <div id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-gray-300">
              0
            </div>
          </div>
        </div>
      </div>
      
      
      <script
        async
        type="text/javascript"
        src="/js/fetch-repo.min.dc5533c50cefd50405344b235937142271f26229fe39cbee27fd4960e8bb897a0beebfad77a1091ca91cd0d1fb14e70fc37cc114dd9674fb2c32e0ab512ec8a4.js"
        integrity="sha512-3FUzxQzv1QQFNEsjWTcUInHyYin&#43;OcvuJ/1JYOi7iXoL7r&#43;td6EJHKkc0NH7FOcPw3zBFN2WdPssMuCrUS7IpA=="
        data-repo-url="https://api.github.com/repos/AmitKumar-AK/sitecore-marketer-mcp-prompts"
        data-repo-id="github-0b8cd2bfc8fbcb75a2913df72fab2c1f"></script>
    </a>
  </div>
<br/>








<div class="flex items-center gap-2 flex-wrap mt-0 !mt-0 p-0" style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">
  
    <h2 id="creditreferences" class="mt-0 !mt-0 pt-0 pb-0 " style="margin-top:0.5em!important;margin-bottom:-0.3em!important;padding-top:0!important;">🧾Credit/References</h2>
  
  
    <span class="go-to-top">
      <a class="go-to-top-a " href="#TableOfContents" title="Go to Top"><svg height=1.2em class="hx:inline-block hx:align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7 11l5-5m0 0l5 5m-5-5v12"/></svg></a>      
    </span>
  
</div>



<div class="table-wrapper">
<table class="style-table"><tbody><tr><td><a href="https://code.visualstudio.com/docs/copilot/customization/mcp-servers" target="_blank" rel="noopener">Use MCP servers in VS Code</a></td><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp-and-agent-api-overview.html" target="_blank" rel="noopener">Marketer MCP and Agent API overview</a></td><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp.html" target="_blank" rel="noopener">Marketer MCP</a></td></tr><tr><td><a href="https://modelcontextprotocol.io/docs/getting-started/intro" target="_blank" rel="noopener">What is the Model Context Protocol (MCP)?</a></td><td><a href="https://www.youtube.com/watch?v=VfZlglOWWZw" target="_blank" rel="noopener">Full Course (Lessons 1-11) MCP for Beginners</a></td><td><a href="https://github.com/punkpeye/awesome-mcp-servers" target="_blank" rel="noopener">Awesome MCP Servers</a></td></tr><tr><td><a href="https://www.amitk.net/blog/sitecore-headless-services-get-system-fields/" target="_blank" rel="noopener">Access Sitecore System Fields in GraphQL for Sitecore XP/XM 10.4 Headless SXA</a></td><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/marketer-mcp-and-agent-api-overview.html" target="_blank" rel="noopener">Marketer MCP and Agent API overview</a></td><td><a href="https://doc.sitecore.com/sai/en/users/sitecoreai/integrating-sitecore-with-agentic-platforms.html" target="_blank" rel="noopener">Integrating Sitecore with agentic platforms</a></td></tr></tbody>
  
</table>
</div>
]]></content:encoded></item></channel></rss>