This article presents a hands-on showcase of the Model Context Protocol (MCP) implemented with .NET and C#. See how MCP can be used to expose, discover, and orchestrate server-side tools in a standardized way—making integration smarter, more flexible, and ready for modern automation scenarios.
Introduction
Ever wondered how to make your tools and services more discoverable, interoperable, and easy to automate? MCP (Model Context Protocol) is designed for exactly that. In this showcase project, we use .NET and C# to demonstrate how MCP can turn ordinary APIs into intelligent, composable tools—ready for integration with clients, AI assistants, and automation platforms.
What is MCP?
MCP (Model Context Protocol) is an open protocol for exposing server-side operations as standardized, discoverable tools. According to the official MCP specification, MCP enables clients—such as developer tools, automation platforms, or AI assistants—to dynamically discover available operations, understand their input/output schemas, and invoke them in a consistent way.
The diagrams below illustrate the difference between integrating APIs with and without MCP. This illustration alone demonstrates the advantages of using MCP.
Integration of existing APIs without MCP
Integration of existing APIs with MCP
Benefits of Using MCP
- Discoverability: Clients can query the server to list all available tools and their capabilities, reducing the need for hardcoded API knowledge.
- Interoperability: MCP provides a common language for tools and clients, making integration across platforms and technologies straightforward.
- Extensibility: New tools and operations can be added to the server without breaking existing clients.
- Schema Transparency: Each tool exposes its input and output schema, enabling robust validation and easier client development.
- Security: MCP supports modern authentication and authorization mechanisms, such as OAuth 2.0 and Microsoft Entra ID.
- Automation & AI Readiness: MCP is designed for orchestration by automation scripts and AI agents, supporting conversational and intelligent workflows.
Elicitation with MCP: Interactive User Workflows
A unique feature of MCP is its support for elicitation—interactive user input collection. In this project, elicitation is used to prompt users for required information (e.g., selecting a parent branch when creating a new branch). The MCP server sends a schema describing the expected input, and the client (or LLM) collects the user’s response, ensuring a guided and error-resistant workflow.
Example json request/response with using an enum schema:
{
"type": "object",
"properties": {
"ParentBranch": {
"type": "string",
"enum": [
"main"
]
}
},
"required": [
"ParentBranch"
]
}
Request schema
{
"action": "accept",
"content": {
"ParentBranch": "main"
},
"_meta": null
}
Response schema
This approach makes user interaction smarter and more flexible, allowing for dynamic, context-aware prompts and responses.
Architecture Overview
This showcase project on GitHub is built with .NET 9 and C#, using MCP to abstract a set of Azure DevOps operations as MCP tools. The diagram below illustrates the key components and their interactions:
- MCP Server: Hosts the MCP tools and exposes a standardized discovery endpoint. Implements authentication via Microsoft Entra ID.
- MCP Tools: Each tool represents a server-side operation (e.g., create branch, list repositories). Tools expose input/output schemas for validation and interoperability. Requests operations to Azure DevOps REST API.
- Client/LLM: Discovers available tools dynamically and invokes them using the MCP protocol. Supports elicitation for interactive workflows.
- Authentication Layer: Uses OAuth 2.0 and Entra ID for secure access control. Uses on-behalf-flow for accessing Azure DevOps REST API.
Components of current architecture
Technical Implementation
This project is a practical demonstration of MCP’s power when combined with .NET and C#:
- Modern .NET: Built with .NET 9 for reliability and performance.
- C# Best Practices: Clean, maintainable code that’s easy to extend.
- MCP Tooling: Azure DevOps operations are exposed as MCP tools, with clear schemas and discoverable endpoints.
- Secure by Design: Authentication via Entra ID and secure configuration management. Using on-behalf authentication flow for accessing Azure DevOps REST API in a secure way.
More technical details, instructions and examples can be found in readme file of GitHub project
Why Try MCP with .NET and C#?
If you’re a developer, architect, or automation enthusiast, this showcase is for you. MCP makes it easy to build smarter, more flexible integrations—whether you’re connecting tools, enabling AI, or future-proofing your APIs. With .NET and C#, you get a robust, enterprise-ready foundation for your MCP server.
References
Project GitHub Repository
MCP C# SDK
MCP GitHub (Official)
MCP Specification