Migrating a .NET AI agent from function tools to MCP client integration, showing the architectural shift from duplicated HTTP tool classes to a single MCP Server.

From Function Tools to MCP: Migrating an AI Agent to the Model Context Protocol

When I first built an AI Agent for my personal health platform Biotrackr, I used the Microsoft Agent Framework’s function tool pattern with 12 tools decorated with [Description] attributes, registered via AIFunctionFactory.Create(). This wasn’t ideal as I already had an MCP Server exposing the same 12 tools to VS Code and other MCP clients. The natural approach would have been to make the Chat API another MCP client. But there was a blocker. The Anthropic provider in Microsoft Agent Framework (Microsoft.Agents.AI.Anthropic) didn’t support Local MCP Tools. If I wanted to use Claude as the LLM backend (which I did), function tools were the only option. So I duplicated all 12 tool implementations in the Chat API, complete with their own models, validation logic, and API call code. ...

March 22, 2026 · 16 min · Will Velida
Building Remote MCP Servers with .NET and Azure Container Apps

Building Remote MCP Servers with .NET and Azure Container Apps

A couple of months ago, I wrote a blog post on how you can create Model Context Protocol (MCP) servers using C#. Using a basic API, I was able to create a MCP server that allowed me to call Australian Football League (AFL) data and supply that as context to LLMs so I can ask it question about AFL results, teams, stats etc. using that API. That blog post talked about how we can use MCP servers that run locally on our machines using stdio transport. In this article, I’ll talk about how we can use Server-Sent Events (SSE) transport to build remote MCP servers that we can host on Azure Container Apps. ...

June 20, 2025 · 10 min · Will Velida
Building a Sports-Themed MCP Server Using .NET

Building a Sports-Themed MCP Server Using .NET

I’ve lived in Melbourne for almost two years now, and throughout that time I’ve been trying to get my head around Australian rules, or AFL. I live pretty close to where Carlton Football Club train, so I’ve decided to support them (or as the Australians say “Go for them” 🤷). The more I learn about the game, the more I’m realizing that I may have set myself up for a lifetime of pain and dissappointment, but being an Arsenal fan since I was 6, I’m more than prepared for it 😂 ...

April 16, 2025 · 10 min · Will Velida