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.
Below pictures show difference between integrating existing APIs without or with MCP. Alone this illustration shows the advantages of using 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.
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. Each tool is:
- Discoverable: Clients can query the server to see available tools and their schemas.
- Composable: Tools can be orchestrated by clients, automation scripts, or AI agents.
- Secure: Authentication is handled via Microsoft Entra ID (Azure AD), ensuring only authorized access.
Key Functionality
- Tool Discovery: Clients can list all available tools and see what each one does.
- Schema Transparency: Each tool exposes its input and output schema, making integration straightforward.
- Operation Invocation: Tools can be invoked directly, with results returned in a standardized format.
- Extensibility: New tools can be added easily, demonstrating how MCP supports evolving requirements.
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.
More technical 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