Building your own MCP server
Microsoft Developer shows how to build a Model Context Protocol (MCP) server from scratch using the MCP C# SDK, then connect it to an AI agent in Microsoft Foundry by defining tools, prompts, and resources that bridge real systems with LLMs.
Overview
The video introduces the Model Context Protocol (MCP) as a standard way to connect LLMs to external systems, and walks through implementing an MCP server in C# using the MCP C# SDK. It also covers how to define and expose MCP capabilities (tools, prompts, and resources) and then leverage them from an AI agent in Microsoft Foundry.
Key links
- Dunder Mifflin MCP Server (sample): https://github.com/StuartvdLee/dunder-mifflin
What the session covers
Building an MCP server with C#
- Creating an MCP server from scratch using the MCP C# SDK
- Structuring the server so it can expose capabilities to an LLM/agent
Defining MCP capabilities
- Tools: operations the agent can call to perform actions against real systems
- Prompts: reusable prompt templates or prompt assets exposed via MCP
- Resources: data/assets the agent can retrieve via MCP
Using the MCP server from an agent in Microsoft Foundry
- Connecting the MCP server to an AI agent
- Leveraging the exposed tools/prompts/resources from within the agent workflow