Murmur8.McpServer.Template 1.0.0

dotnet new install Murmur8.McpServer.Template@1.0.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

MCP C# Server Template

A dotnet template for creating Model Context Protocol (MCP) servers in C# using clean architecture principles.

Installation

Install the template from NuGet:

dotnet new install Murmur8.McpServer.Template

Usage

Create a new MCP server project:

dotnet new http-mcp-csharp-server -n MyMcpServer
cd MyMcpServer
dotnet build
dotnet run --project MyMcpServer.MCP

Template Parameters

  • ProjectName - Name of your MCP server project (default: "MyMcpServer")
  • Author - Author name for the project
  • Description - Project description

Example with parameters:

dotnet new http-mcp-csharp-server -n AwesomeMcp --Author "Your Name" --Description "My awesome MCP server"

What's Included

This template provides:

  • Clean Architecture Structure: Organized into Domain, Application, Infrastructure, and Tools layers
  • MCP Server Setup: Pre-configured Program.cs with MCP server initialization
  • Example Tool: Echo tool demonstrating how to create MCP tools
  • Test Project: Basic test structure with example tests
  • Common Utilities: Helper classes like Lazier for lazy dependency injection
  • Configuration: JSON serialization options and appsettings structure

Project Structure

YourProject.MCP/
├── Domain/           # Domain entities and enums
├── Application/      # Business logic and services
├── Infrastructure/   # External integrations and data access
├── Tools/            # MCP tools implementation
└── Common/           # Shared utilities

YourProject.MCP.Tests/
├── Tools/            # Tool tests
└── Application/      # Service tests

Extending the Template

Adding New Tools

  1. Create a new class in the Tools folder
  2. Implement your tool methods
  3. Register tools in Program.cs

Adding New Services

  1. Define interface in Application/Interfaces
  2. Implement service in Application/Services
  3. Register in DI container

Adding External APIs

  1. Define client interface in Infrastructure/Interfaces
  2. Implement client in Infrastructure/Services
  3. Configure HTTP clients in Program.cs

Requirements

  • .NET 9.0 or later
  • C# 13 or later

Contributing

Issues and pull requests welcome! See TODO.md for planned features.

License

MIT License - see LICENSE for details

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 570 10/8/2025