MCP .NET Samples

v1.0.2026052201Developer Toolsstable

A comprehensive set of samples of creating and using MCP servers and clients with .NET

dotnetmcpmcp-clientmcp-server
Share:
185
Stars
0
Downloads
0
Weekly
0/5

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

Learn MCP server and client development using .NET frameworks.
Reference comprehensive examples for .NET MCP implementations.
microsoft

Maintainer

LicenseMIT
Languagec#
Versionv1.0.2026052201
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-dotnet-samples

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-samples
2

Explore 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 management
3

Install .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 build
4

Run 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.csproj
5

Connect 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"]
    }
  }
}
6

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:latest

MCP .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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-dotnet-samples": { "command": "npx", "args": ["-y", "mcp-dotnet-samples"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides