CleanModelContextProtocol.Template 2026.11.1.125

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

Clean Model Context Protocol

A dotnet new template for a Model Context Protocol server built with a streamlined version of Clean Architecture and the MCP C# SDK.

It's one of five Lean Mean Clean Apps templates, for Minimal APIs, Model Context Protocol, GraphQL, Web API controllers and AWS Lambda, that share the same Application and Infrastructure layers, tests and CI pipeline. Full docs live at leanmeancleanapps.github.io/mcp.

Requirements

Install

dotnet new install CleanModelContextProtocol.Template

Create a solution

dotnet new cleanmodelcontextprotocol --name {YOUR_SOLUTION_NAMESPACE} --authorName "{YOUR_NAME}"
Option Description
--name The name of the solution, also used as the root namespace.
--authorName The name of the author of the solution.
--authority The OAuth authorization server that issues access tokens. Leave it empty to run the MCP endpoint without authentication.
--audience The audience access tokens must be issued for, usually the server's own URL.

With an authority set, /mcp needs a bearer token, and the server publishes protected resource metadata so MCP clients can find the authorization server and sign in.

Run it

From the new solution's folder, start the app and a Seq container for logs.

docker compose up -d

Then open the MCP Inspector at http://localhost:6274. It's already pointed at the MCP endpoint (http://localhost:8080/mcp), so connect and open Tools to browse and run them. Seq shows the logs at http://localhost:5341.

Or run it without Docker.

dotnet run --project ./src/Presentation

Run the tests with dotnet test. Every way to run the solution is in docs/RUN.md inside it.

What's inside

  • Presentation: An MCP server over Streamable HTTP at /mcp with tools, resources, prompts and completions
  • Application: commands and queries through Mediator, validation with FluentValidation and mapping with Mapperly
  • Infrastructure: Entity Framework Core on SQLite with migrations and optional sample data
  • Tests: xUnit, Shouldly and NSubstitute, each test on its own in-memory database
  • A Dockerfile that runs as a non-root user, a docker-compose.yml, and a GitHub Actions pipeline with tests, a coverage gate, a container scan and CodeQL

Updates

A new version is released on the 1st of each month with every change merged since the previous release, as long as something has changed. No change, no new version number. We're not here to pad the download stats. To update an installed template:

dotnet new update

What changed in each version is in the release notes. To remove the template, run dotnet new uninstall CleanModelContextProtocol.Template.

More help

Support

If this template saves you time, please consider sponsoring the work on GitHub. It keeps all five templates current, and the coffee flowing.

  • net10.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
2026.11.1.125 102 11/1/2026
2026.10.29.98 93 10/29/2026
2026.10.29.95 89 10/29/2026
2026.10.28.88 94 10/28/2026
2026.10.28.86 85 10/28/2026
2026.10.28.83 84 10/28/2026
2026.10.28.80 84 10/28/2026
2026.10.28.78 84 10/28/2026
2026.10.28.73 84 10/28/2026
2026.10.28.71 89 10/28/2026
2026.10.28.68 84 10/28/2026
2026.10.28.62 82 10/28/2026
2026.10.28.44 95 10/28/2026
2026.10.28.41 95 10/28/2026
2026.10.27.39 98 10/27/2026
2026.10.27.37 91 10/27/2026
2026.10.27.35 88 10/27/2026
2026.10.27.33 91 10/27/2026
2026.10.27.25 91 10/27/2026
2026.10.27.24 89 10/27/2026
Loading failed