Learn it. Build it. Ship it for others.
.NET MCP server and client sample repo
This repository collects working examples of Model Context Protocol in .NET. The samples show how to build MCP servers and clients, and how to package them for use in editors like VS Code and Visual Studio.
Builders who want to learn MCP by reading and running .NET sample projects.
You can copy real MCP patterns into your own agent or tool setup instead of starting from scratch.
What it does
MCP server samples
Shows servers for markdown to HTML, Outlook email, to-do list actions, and Copilot customization retrieval.
Client and server examples
Includes samples for both creating MCP servers and using them from clients.
Azure-ready sample setup
Each sample includes Azure deployment files such as `azure.yaml` and `infra` folders where applicable.
Shared sample code
Common code is kept in `shared/McpSamples.Shared` for reuse across projects.
Editor install examples
The README includes install links for VS Code, VS Code Insiders, and Visual Studio for the packaged server samples.
README
Model Context Protocol .NET Samples
π Introduction
Welcome to the Model Context Protocol (MCP) .NET Samples repository! This collection of samples demonstrates how to leverage the Model Context Protocol in .NET applications.
MCP is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP like a USB-C port for AI applications - it provides a standardized way to connect AI models to different data sources and tools.
With MCP, you can:
- Utilize pre-built integrations that your LLM can directly plug into
- Flexibly switch between LLM providers and vendors
- Follow best practices for securing your data within your infrastructure
- Build agents and complex workflows on top of LLMs
This repository contains .NET samples ranging from building your own MCP implementation to integrating with Azure services.
π Sample Projects
| Sample Name | Install | Description |
|---|---|---|
| Awesome Copilot | MCP server that retrieves GitHub Copilot customization files from awesome-copilot. | |
| Markdown to HTML | MCP server that converts markdown text to HTML. | |
| Outlook Email | MCP server that sends emails through Outlook. | |
| To-do List | MCP server that manages to-do list items. |
π οΈ Getting Started
Details on how to set up and run the samples will be provided in each sample's directory.
π Learning Resources
πΆββοΈ Next Steps
- Learn more about GenAI with .NET with a free course!
- Join the Azure AI Community Discord to keep the conversation going
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
Files in the repo
- .devcontainer
- .github
- .vscode
- awesome-copilot
- markdown-to-html
- outlook-email
- shared
- todo-list
- .editorconfig
- .gitattributes
- .gitignore
- AGENTS.md
- CODE_OF_CONDUCT.md
- Directory.Build.props
- Dockerfile.awesome-copilot
- Dockerfile.awesome-copilot-azure
- Dockerfile.markdown-to-html
- Dockerfile.markdown-to-html-azure
- Dockerfile.outlook-email
- Dockerfile.outlook-email-azure
- Dockerfile.todo-list
- Dockerfile.todo-list-azure
- global.json
- LICENSE
- README.md
- SECURITY.md
- SUPPORT.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tutorials & guides
Bash is all you need - A nano claude codeβlike γagent harnessγ, built from 0 to 1
A visual, example-driven guide to Claude Code β from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Specification and documentation for Agent Skills

π» vibe coding 101ο½The first course for AI-native product builders.

End-to-end, code-first tutorials for building production-grade GenAI agents. From prototype to enterprise deployment.