MCP .NET Samples
A comprehensive set of samples of creating and using MCP servers and clients with .NET
What is MCP .NET Samples?
MCP .NET Samples is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to comprehensive set of samples of creating and using mcp servers and clients with .net
A comprehensive set of samples of creating and using MCP servers and clients with .NET
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A comprehensive set of samples of creating and using MCP ser
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-dotnet-samplesConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP .NET Samples
MCP .NET Samples is a Microsoft-maintained repository of reference implementations showing how to build and consume MCP servers and clients using the .NET ecosystem. It includes four working samples — Awesome Copilot (fetches GitHub Copilot customization files), Markdown to HTML converter, Outlook Email sender, and To-do List manager — each demonstrating a different pattern for exposing capabilities via the Model Context Protocol. .NET developers use these samples as starting points for building their own MCP servers with C# and the official Microsoft.Extensions.AI and ModelContextProtocol NuGet packages.
Prerequisites
- .NET 9.0 SDK or later installed
- Docker (required for the Markdown to HTML, Outlook Email, and To-do List containerized samples)
- VS Code, VS Code Insiders, or Visual Studio 2022 with the appropriate MCP or AI extensions
- GitHub account for the Awesome Copilot sample (accesses GitHub Copilot customization data)
- Microsoft 365 / Outlook account for the Outlook Email sample
Clone the repository
Clone the Microsoft MCP .NET Samples repository to get all four sample projects.
git clone https://github.com/microsoft/mcp-dotnet-samples.git
cd mcp-dotnet-samplesExplore the sample projects
Each sample is in its own directory. Browse the available samples: AwesomeCopilot, MarkdownToHtml, OutlookEmail, and TodoList. Each directory contains its own README with specific setup instructions.
ls -la
# AwesomeCopilot/ - Fetches GitHub Copilot customization files
# MarkdownToHtml/ - Converts markdown to HTML
# OutlookEmail/ - Sends email via Outlook
# TodoList/ - CRUD to-do list managementInstall .NET dependencies and build a sample
Navigate to a sample directory and restore NuGet packages, then build. The samples use the ModelContextProtocol NuGet package.
cd AwesomeCopilot
dotnet restore
dotnet buildRun a sample server
Start one of the sample MCP servers. The server will listen for MCP client connections via stdio or HTTP as configured in the sample.
dotnet run --project AwesomeCopilot/AwesomeCopilot.csprojConnect your MCP client to the sample server
Add the built sample to your MCP client configuration. For stdio-based samples, point the command at the dotnet run invocation or the compiled binary.
{
"mcpServers": {
"dotnet-todo": {
"command": "dotnet",
"args": ["run", "--project", "/path/to/mcp-dotnet-samples/TodoList/TodoList.csproj"]
}
}
}Use Docker for the containerized samples
Several samples offer Docker-based installation for easier deployment without requiring the .NET SDK on the client machine. Pull and run the Docker image as specified in each sample's README.
# Example for a Docker-based sample
docker pull mcr.microsoft.com/mcp-dotnet-samples/todolist:latest
docker run -i mcr.microsoft.com/mcp-dotnet-samples/todolist:latestMCP .NET Samples Examples
Client configuration (TodoList sample via dotnet run)
MCP client config to run the TodoList sample server using the .NET CLI. Adjust the project path to match your local clone location.
{
"mcpServers": {
"mcp-dotnet-todolist": {
"command": "dotnet",
"args": [
"run",
"--project",
"/Users/you/mcp-dotnet-samples/TodoList/TodoList.csproj"
]
}
}
}Prompts to try
Example prompts for each of the four sample MCP servers once connected to your AI client.
- "Add 'Buy groceries' to my to-do list"
- "Show me all my pending to-do items"
- "Convert this markdown text to HTML: # Hello World"
- "Send an email to [email protected] with subject 'Meeting Notes' and the following body..."
- "Fetch the GitHub Copilot instructions file for the microsoft/vscode repository"Troubleshooting MCP .NET Samples
dotnet run fails with 'SDK not found' or build errors
Ensure you have .NET 9.0 SDK installed. Run dotnet --version to check. Download from https://dotnet.microsoft.com/download. The samples target .NET 9 and will not build with older SDKs.
Docker-based samples fail to connect or respond
Ensure Docker Desktop is running before launching the container. For stdio mode, the -i flag must be included in docker run to keep stdin open for MCP communication. Check that the Docker image tag matches the sample version in the repository.
Outlook Email sample fails to send with authentication errors
The Outlook Email sample requires Microsoft 365 credentials and an app registration with Mail.Send permissions in Azure Active Directory. Follow the sample-specific setup in OutlookEmail/README.md to configure OAuth credentials before running.
Frequently Asked Questions about MCP .NET Samples
What is MCP .NET Samples?
MCP .NET Samples is a Model Context Protocol (MCP) server that comprehensive set of samples of creating and using mcp servers and clients with .net It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP .NET Samples?
Follow the installation instructions on the MCP .NET Samples GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP .NET Samples?
MCP .NET Samples works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP .NET Samples free to use?
Yes, MCP .NET Samples is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP .NET Samples Alternatives — Similar Developer Tools Servers
Looking for alternatives to MCP .NET Samples? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP .NET Samples in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP .NET Samples?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.