Get the FREE Ultimate OpenClaw Setup Guide →

dotnet

MCP server from timheuer/dotnet-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio timheuer-dotnet-mcp-server dotnet run

How to use

This MCP server template provides a ready-to-run .NET-based MCP server built with the Microsoft MCP Server C# package. It supports both a StdIO transport for local desktop AI tooling and an HTTP transport (when enabled) for web-based integrations. The included sample tools demonstrate common MCP capabilities such as text manipulation (Echo, ReverseEcho), math operations, date/time utilities, configurable random number generation, and secure file operations, along with advanced examples that showcase dependency injection and asynchronous patterns. You can interact with the server’s tools through the MCP protocol endpoints or through the generated prompts designed for AI-assisted workflows. If you enable HTTP transport, the server will listen on the default ports (e.g., 5000/5001) and expose the same tool capabilities over REST.

To get started, run the server with the StdIO template or enable HTTP transport to accept HTTP-based requests. Use the included sample tools to verify behavior, then customize or add new tools and prompts to match your use case (e.g., content summarization, code analysis, or concept explanations) within your .NET project.

How to install

Prerequisites:

  • .NET SDK (recommended latest LTS) installed on your machine
  • Basic familiarity with the dotnet CLI

Step 1: Install the MCP server template

dotnet new install Microsoft.McpServer.Csharp

Step 2: Create a new MCP server project from the template

dotnet new mcpserver -n MyMcpServer
cd MyMcpServer

Step 3: Build and run the server (StdIO transport by default)

dotnet build

dotnet run

Step 4: (Optional) Enable HTTP transport if you need REST access

dotnet run --EnableHttpTransport true

Step 5: Access tools and prompts

  • Use the console/terminal to interact via StdIO or send HTTP requests if HTTP transport is enabled.
  • Extend the project by adding or modifying tools, prompts, and dependencies as needed.

Additional notes

Notes and tips:

  • The template includes StdIO and optional HTTP transport. If you enable HTTP transport, ensure the ports (default 5000/5001) are open in your environment.
  • Tools included cover common MCP scenarios: Echo/ReverseEcho, Math Operations, DateTime, Random Number, File Operations, and Advanced Examples demonstrating DI and async operations.
  • For file operations, be mindful of security restrictions and configure allowed paths to prevent unauthorized access.
  • If you customize prompts, consider creating AI-friendly prompts for summarization, code analysis, and concept explanations to improve responses.
  • Keep the .NET SDK updated to benefit from the latest MCP enhancements and bug fixes.

Related MCP Servers

Sponsor this space

Reach thousands of developers