Dotnet Template MCP logo

Dotnet Template MCP

by YuliiaKovalova

MCP server enabling AI agents to search, inspect, preview, and create .NET projects via natural language with parameter validation and auto-resolve.

Install Dotnet Template MCP

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself β€” its README, its docs, or a verified owner. We haven’t found those for YuliiaKovalova/dotnet-template-mcp, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

This MCP server allows AI agents to interact with .NET project templates using natural language commands instead of CLI flags. It supports searching templates locally and on NuGet.org, inspecting parameters, previewing generated files, and creating projects with interactive parameter elicitation and smart defaults. Template authors can validate templates before publishing to catch errors and improve quality. The server supports both local stdio and remote HTTP transports for flexible deployment.

Use cases

  • Search for .NET project templates by natural language intent
  • Inspect template parameters, constraints, and post-actions
  • Preview generated project files without disk writes
  • Create new projects with automatic NuGet package resolution
  • Validate custom templates before publishing

Key features

  • Natural language template search and intent parsing
  • Interactive elicitation of missing template parameters
  • Template validation catching errors, warnings, and suggestions
  • Support for template installation, uninstallation, and comparison
  • Project and solution analysis with NuGet package upgrade reporting
  • Multiple transport modes: stdio and streamable HTTP

Tools16

What Dotnet Template MCP lets your agent do. Expand a tool for its parameters.

Self-reported~327 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

14/15 checks healthy over the last 112d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars8Stargazers on the source repository.
Last commit17d agoMost recent push to the default branch.
Tools exposed16Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

DotnetTemplateMCP

An MCP server that lets AI agents work with dotnet new templates β€” search, inspect, preview, and create projects through natural conversation instead of memorizing CLI flags.

DotnetTemplateMCP MCP server

Instead of this:

bash
dotnet new list --language C#
dotnet new webapi --help
dotnet new webapi --auth Individual --use-controllers --name MyApi --output ./MyApi

Your AI agent just says: "I need a web API with authentication and controllers" β€” and the MCP server figures out the rest.

Template Validation for Authors

Building a custom dotnet new template? template_validate catches mistakes before you publish β€” no more guessing if your template.json is correct:

Code
Agent calls: template_validate("./my-template")

← Returns:
{
  "valid": false,
  "summary": "2 error(s), 1 warning(s), 3 suggestion(s)",
  "errors": [
    "Missing required field 'shortName'.",
    "Parameter 'Framework': default value 'net7.0' is not in the choices list."
  ],
  "warnings": [
    "Missing 'sourceName'. Without it, the generated project name won't be customizable via --name."
  ],
  "suggestions": [
    "Consider adding a 'description' field to help users understand what this template creates.",
    "Consider adding 'language' tag (e.g., 'C#') for better discoverability.",
    "Consider adding 'type' tag (e.g., 'project', 'item') for filtering."
  ]
}

What it catches: missing required fields, invalid identity format, short name conflicts with CLI commands, parameter issues (missing defaults, empty choices, prefix collisions, type mismatches), broken computed symbols, constraint misconfiguration, and missing tags.

How this relates to the official tooling. Microsoft ships template authoring validation already, and you should know about it:

Official toolWhat it gives you
Microsoft.TemplateEngine.Authoring.CLIdotnet template-authoring validate β€” the reference validator
Microsoft.TemplateEngine.Authoring.TasksValidation at build time, as an MSBuild task
Microsoft.TemplateEngine.Authoring.TemplateVerifierSnapshot testing of template output

What template_validate adds is not the validation itself β€” it is the delivery: a single structured JSON payload, split into errors/warnings/suggestions with fix-oriented messages, returned in-band to an agent that is already editing the template. No install step, no output parsing, no second tool in the loop. If you are a human authoring templates in CI, prefer the official tools above; they are the reference implementation and cover cases this does not.

Tools

ToolWhat it does
template_searchSearch locally and on NuGet.org β€” one call, ranked results
template_listList what's installed, filter by language/type/classification
template_inspectParameters, constraints, post-actions β€” all in one shot
template_instantiateCreate a project. Not installed? Auto-resolves from NuGet. Elicits missing params interactively
template_dry_runPreview files without touching disk
template_installInstall a package (idempotent β€” skips if already there)
template_uninstallRemove a template package
templates_installedInventory of everything installed
template_from_intent"web API with auth" β†’ webapi + auth=Individual β€” no LLM needed
template_create_from_existingAnalyze a .csproj β†’ generate a reusable template matching repo conventions
template_composeExecute a sequence of templates (project + items) in one workflow
template_suggest_parametersSuggest parameter values with rationale based on cross-parameter relationships
template_validateValidate a local template directory for authoring issues before publishing
template_compareCompare 2+ templates side by side β€” parameters, features, frameworks
solution_analyzeAnalyze a solution/workspace β€” project structure, frameworks, CPM status
packages_upgradeScan a project/solution/folder for outdated NuGet versions and report or apply upgrades (CPM-aware)

πŸ“– Full tool reference β†’

Hosted deployment

A hosted deployment is available on Fronteir AI.

Quick Start

Global tool (.NET 8+)

bash
dotnet tool install --global DotnetTemplateMCP --version 2.0.0

Zero-install with dnx (.NET 10+)

bash
dnx -y DotnetTemplateMCP --version 2.0.0

VS Code / GitHub Copilot

Add to mcp.json:

config.json
{
  "servers": {
    "dotnet-templates": {
      "type": "stdio",
      "command": "dnx",
      "args": ["-y", "DotnetTemplateMCP", "--version", "2.0.0"]
    }
  }
}

πŸ“– Claude Desktop, Cursor, and more β†’

Transport Modes

Stdio (default)

Standard I/O transport for local CLI and tool usage:

bash
template-engine-mcp                     # stdio is the default
template-engine-mcp --transport stdio   # explicit

HTTP (remote / team-shared)

Streamable HTTP transport for remote or CI/CD deployment.

Authentication is mandatory. Every tool in this server writes files and installs NuGet packages, so an open endpoint is a remote code execution surface. The server refuses to start the HTTP transport unless you either set a token or explicitly opt in to anonymous access:

bash
# Recommended
MCP_TEMPLATE_HTTP_TOKEN=<shared-secret> template-engine-mcp --transport http

# Only for a trusted, isolated network
MCP_TEMPLATE_HTTP_ALLOW_ANONYMOUS=true template-engine-mcp --transport http

Clients authenticate with Authorization: Bearer <shared-secret>. Requests to /mcp are rate limited per client (default 120/minute, MCP_TEMPLATE_HTTP_RATE_LIMIT=0 disables). /health stays anonymous for probes.

Not multi-tenant. TemplateEngineService is a process-wide singleton with virtualizeSettings: false, so the installed-template set is shared by every caller, and the workspace root is process-wide. Run one instance per trusted team or per tenant β€” do not expose a single instance to mutually untrusting users.

bash
template-engine-mcp --transport http
# or via environment variable:
MCP_TEMPLATE_TRANSPORT=http template-engine-mcp

The HTTP server exposes:

  • /mcp β€” MCP streamable HTTP endpoint (bearer token required)
  • /health β€” Health check endpoint (anonymous)

Configure the listen URL:

bash
MCP_TEMPLATE_HTTP_URL=http://0.0.0.0:8080 template-engine-mcp --transport http

Connect your MCP client:

config.json
{
  "servers": {
    "dotnet-templates": {
      "type": "http",
      "url": "http://localhost:5005/mcp"
    }
  }
}

Interactive Elicitation

When a template has required parameters that weren't provided, the server asks the user interactively via MCP elicitation β€” instead of failing. Template parameter types are mapped to form fields:

Template ParameterElicitation Field
stringText input
bool / booleanCheckbox
int / numberNumber input
Choice parameterSingle-select dropdown

Disable with MCP_TEMPLATE_ELICITATION=false.

How it works

Code
You: "I need a web API with authentication, controllers, and Docker support"

β†’ template_from_intent extracts keywords: web api, authentication, controllers, docker
β†’ Matches: webapi (confidence: 0.85)
β†’ Resolves: auth=Individual, UseControllers=true, EnableDocker=true
β†’ template_instantiate creates the project

The server also does smart defaults (AOT β†’ latest framework, auth β†’ HTTPS stays on), parameter validation before writing files, constraint checking (OS, SDK, workload), interactive elicitation of missing required parameters, and auto-resolves templates from NuGet if they're not installed.

CPM & Latest Package Versions

When creating a project inside a solution that uses Central Package Management, the server automatically:

  1. Detects Directory.Packages.props by walking up the directory tree
  2. Strips Version attributes from generated .csproj PackageReferences
  3. Adds missing <PackageVersion> entries to Directory.Packages.props
  4. Resolves latest stable NuGet versions β€” no more stale hardcoded versions from templates
Code
Before (what dotnet new generates):
  <PackageReference Include="Serilog" Version="3.1.0" />    ← stale, breaks CPM

After (what template_instantiate produces):
  .csproj:                    <PackageReference Include="Serilog" />
  Directory.Packages.props:   <PackageVersion Include="Serilog" Version="4.2.0" />

Works for standalone projects too β€” versions are updated directly in the .csproj.

Multi-Template Composition

Chain multiple templates in one call with template_compose:

config.json
[
  {"templateName": "webapi", "name": "MyApi", "parametersJson": "{\"auth\": \"Individual\"}"},
  {"templateName": "gitignore", "target": "."}
]

πŸ“– Architecture & smart behaviors β†’

Tool Profiles (Lite vs Full)

By default, all 15 tools are available. If your agent works better with fewer tools, set the MCP_TEMPLATE_TOOL_PROFILE environment variable:

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about Dotnet Template MCP

It interactively elicits missing required parameters from the user via MCP elicitation forms mapped to parameter types.

Yes, the server provides a template_validate tool that detects missing fields, invalid formats, and other authoring issues.

Yes, it supports an HTTP transport mode exposing /mcp and /health endpoints for remote or multi-tenant use.

Install as a global .NET tool via 'dotnet tool install --global DotnetTemplateMCP' or run zero-install with 'dnx -y DotnetTemplateMCP'.

Yes, if a requested template is not installed locally, it auto-resolves and installs it from NuGet.org.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDotnet Template MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/yuliiakovalova-dotnet-template-mcp?style=directory)](https://allmcps.com/mcp/yuliiakovalova-dotnet-template-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/yuliiakovalova-dotnet-template-mcp"><img src="https://allmcps.com/api/badge/yuliiakovalova-dotnet-template-mcp?style=directory" alt="Dotnet Template MCP on AllMCPs" /></a>