I Built My First AI Chat App with RAG and MCP Server — Here’s What I Learned

TLDR: The new .NET AI app template provides a good boilerplate for creating RAG-based AI applications. Integrating an MCP Server using the .NET MCP SDK is also straightforward.

Background: Over the years, a lot of internal documentation has accumulated across the multiple systems we develop and support. Combined with ongoing changes, this creates a significant cognitive load. Every day, we handle a high volume of questions both from the engineers and the business. This led me to create an AI-powered product to increase efficiency.

Code: The source code (it’s a tiny project) can be found together with setup instructions on https://github.com/peppial/ExcitelAIChat

Getting started with the AI app template is simple. It is well-documented and comes integrated with three vector stores: SQLite, Azure AI Search, and Qdrant. I chose Azure AI Search, as I had prior experience with it and was targeting Azure deployment.

The RAG implementation in the template is based on PDF documents. Since our documentation is in Word format, I added support for Word document processing DocumentFormat.OpenXml library.

Once that was done, I deployed the app to an Azure App Service (Linux), and the RAG-based document search worked well. Then my colleagues suggested adding a Jira MCP Server, as Jira is a valuable source of product information. Moreover, Jira search is terrible (sorry, Atlassian!). However, their MCP Server, as it turns out, works surprisingly well.

The official .NET MCP SDK is easy to integrate (though still in preview, so subject to change). I added an MCP client to connect with the Jira MCP Server (mcp-atlassian). The most challenging part came during deployment – I needed two containers to share a common network host. I spent more time than expected trying to achieve it with the newly added sidecar container for App Service. It didn’t work out, although the containers were working quite well (locally and by themselves in the cloud).

Eventually, I switched to Azure Container Apps using two containers – one for the .NET application and one for the mcp-atlassian server.

And voilà — it’s built, deployed, and fully functional.

Recap of Features:

  • .NET 9 with Microsoft.Extensions.AI for the backend and Blazor Server Interactive for UI
  • Azure OpenAI Service using GPT-4o-mini for language processing (in the template you can choose also Ollama or OpenAI outside of Azure)
  • Custom documents (PDFs and Word) are automatically processed and indexed on startup. No complex setup required.
  • Search results include links (citations) to the source documents
  • Azure AI Search/Vector database for AI enhanced document retrieval
  • Jira MCP Server for a search in the connected Jira/Confluence data
  • JavaScript modules to convert markdown to html (based on the template)