mcp-dotnet-samples
A comprehensive set of samples of creating and using MCP servers and clients with .NET
claude mcp add --transport stdio microsoft-mcp-dotnet-samples docker run -i --rm ghcr.io/microsoft/mcp-dotnet-samples/todo-list:latest
How to use
This MCP server collection provides .NET based samples that demonstrate how to integrate context and tools with large language models using the Model Context Protocol (MCP). Each sample runs as a Docker container image that exposes an MCP interface. For example, the markdown-to-html sample converts incoming markdown text into HTML, the outlook-email sample can send emails through Outlook, the todo-list sample manages task items, and the awesome-copilot sample retrieves GitHub Copilot customization data. To use them, start the corresponding Docker container for the sample you’re interested in. The containers are designed to accept MCP context from an LLM and return structured results or actions to the LLM. Connect your MCP-enabled agent or orchestrator to the container’s MCP endpoints and feed it prompts that describe the task you want the agent to accomplish. Each sample demonstrates a concrete capability you can leverage in larger workflows, such as content transformation, email delivery, task management, or data retrieval from a data source.
How to install
Prerequisites:
- Docker installed on your machine (Docker Desktop or equivalent)
- Internet access to pull images from GitHub Container Registry
Step-by-step:
- Verify Docker is running: docker version
- Pull and run a sample container (example uses markdown-to-html): docker run -it --rm ghcr.io/microsoft/mcp-dotnet-samples/markdown-to-html:latest
- Repeat for additional samples you want to run: docker run -it --rm ghcr.io/microsoft/mcp-dotnet-samples/outlook-email:latest docker run -it --rm ghcr.io/microsoft/mcp-dotnet-samples/todo-list:latest docker run -it --rm ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:latest
- When you’re done, stop the containers (they stop automatically with --rm) and remove any local images if desired using docker rmi <image>
Note: Some environments may require additional configuration to expose endpoints or provide credentials (for example, Outlook integration). Refer to the sample READMEs inside each directory for any sample-specific configuration options.
Additional notes
Tips and notes:
- Each sample image is named ghcr.io/microsoft/mcp-dotnet-samples/<sample>:latest. Use the exact image name when pulling/running.
- If your environment requires network access through a proxy, ensure Docker is configured accordingly.
- Some samples may require environment variables or mounted volumes for credentials or data sources. Check the sample’s documentation for required env vars (e.g., SMTP/Outlook credentials for email sample).
- The MCP protocol relies on a defined request/response format. When integrating with an LLM, send prompts that describe the action you want (e.g., convert markdown to HTML, send email with subject/body, manage to-do items).
- If you need to run multiple samples concurrently, run each container with distinct network settings or use a docker-compose setup to manage them together.
Related MCP Servers
MCPSharp
MCPSharp is a .NET library that helps you build Model Context Protocol (MCP) servers and clients - the standardized API protocol used by AI assistants and models.
mobile-dev
This is a MCP designed to manage and interact with mobile devices and simulators.
How-To-Create
This guide will help you set up a basic MCP (Model Context Protocol) server in .NET, configure it in VS Code, and interact with it using Copilot Chat.
RimSearcher
A Model Context Protocol (MCP) server for fast searching and retrieval of RimWorld source code.
unity -template
Simple template project for controlling Unity via MCP
McpServerAspNetCore
Minimal implementation of an MCP sample server featuring API Key authentication, CORS support, and example server-side tools for weather and time retrieval.