DotnetTemplateMCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/YuliiaKovalova/dotnet-template-mcp
cd dotnet-template-mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add dotnet-template-mcp -- node "<FULL_PATH_TO_DOTNET_TEMPLATE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_DOTNET_TEMPLATE_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

AI-driven template discovery, inspection, and instantiation for .NET

Microsoft.TemplateEngine.MCP

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.

Instead of this:

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:

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.

No existing tooling does this — most template authors discover issues only after dotnet new install fails or produces wrong output.

Tools

Tool What it does
template_search Search locally and on NuGet.org — one call, ranked results
template_list List what's installed, filter by language/type/classification
template_inspect Parameters, constraints, post-actions — all in one shot
template_instantiate Create a project. Not installed? Auto-resolves from NuGet. Elicits missing params interactively
template_dry_run Preview files without touching disk
template_install Install a package (idempotent — skips if already there)
template_uninstall Remove a template package
templates_installed Inventory of everything installed
template_from_intent "web API with auth" → webapi + auth=Individual — no LLM needed
template_create_from_existing Analyze a .csproj → generate a reusable template matching repo conventions
template_compose Execute a sequence of templates (project + items) in one workflow
template_suggest_parameters Suggest parameter values with rationale based on cross-parameter relationships
template_validate Validate a local template directory for authoring issues before publishing
solution_analyze Analyze a solution/workspace — project structure, frameworks, CPM status

📖 Full tool reference →

Quick Start

Global tool (.NET 8+)

dotnet tool install --global DotnetTemplateMCP --version 1.2.0

Zero-install with `dnx` (.NET 10+)

dnx -y DotnetTemplateMCP --version 1.2.0

VS Code / GitHub Copilot

Add to mcp.json:

{
  "servers": {
    "dotnet-templates": {
      "type": "stdio",
      "command": "dnx",
      "args": ["-y", "DotnetTemplateMCP", "--version", "1.2.0"]
    }
  }
}

📖 Claude Desktop, Cursor, and more →

Transport Modes

Stdio (default)

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

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

HTTP (remote / cloud / team-shared)

Streamable HTTP transport for remote, multi-tenant, or CI/CD deployment:

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
  • /health — Health check endpoint

Configure the listen URL:

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

Connect your MCP client:

{
  "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 type

Tools (6)

template_searchSearch locally and on NuGet.org for templates.
template_listList installed templates with filtering options.
template_inspectInspect template parameters, constraints, and post-actions.
template_instantiateCreate a project from a template, auto-resolving from NuGet if needed.
template_validateValidate a local template directory for authoring issues.
solution_analyzeAnalyze a solution or workspace structure and frameworks.

Environment Variables

MCP_TEMPLATE_TRANSPORTSets the transport mode (e.g., http).
MCP_TEMPLATE_HTTP_URLConfigures the listen URL for HTTP transport.

Configuration

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

Try it

Search for a web API template that supports authentication.
Validate my local template directory at ./my-template for any configuration errors.
Create a new project using the webapi template with Individual authentication and controllers.
Analyze my current solution to check project structure and framework versions.

Frequently Asked Questions

What are the key features of DotnetTemplateMCP?

Search and install templates from local storage and NuGet.org. Interactive parameter elicitation for template instantiation. Template validation for authors to catch errors before publishing. Preview template generation via dry-run functionality. Analyze existing .csproj files to generate reusable templates.

What can I use DotnetTemplateMCP for?

Rapidly scaffolding new .NET projects using natural language. Validating custom template.json files during the development of new templates. Discovering and installing community-maintained templates from NuGet. Analyzing existing solution architectures and project dependencies.

How do I install DotnetTemplateMCP?

Install DotnetTemplateMCP by running: dotnet tool install --global DotnetTemplateMCP --version 1.2.0

What MCP clients work with DotnetTemplateMCP?

DotnetTemplateMCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep DotnetTemplateMCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare