dotnet-template-mcp — Claude Code MCP server: what it does
MCP server for dotnet new that searches, previews and creates .NET projects from templates. Handy when you don't want to remember every CLI flag.
Open on GitHubWhat dotnet-template-mcp does
The server wraps dotnet new in a set of tools an agent can call. It searches installed templates and NuGet.org, reads parameters and constraints, runs a dry run that writes nothing to disk, and creates the project. When a template isn't installed, template_instantiate pulls the package from NuGet and asks for any parameters you skipped. template_from_intent maps a plain request, say a web API with auth, to webapi plus auth=Individual, with no LLM involved.
Template authors get template_validate. It checks a local template directory and returns structured JSON with errors and hints on how to fix them. For CI, the official dotnet template-authoring validate stays the reference; this one exists so an agent editing the template gets the answer in the same conversation. solution_analyze and packages_upgrade cover existing solutions, including CPM-aware NuGet upgrades.
Stdio is the default transport, started with template-engine-mcp. The global tool needs .NET 8+, and dnx needs .NET 10+. The HTTP transport refuses to start without a token, because every tool writes files and installs packages. It is also single-tenant, so run one instance per trusted team.
What it helps with
- find a web API template on NuGet.org from the chat
- preview the files a template would create before anything hits disk
- check
template.jsonfor mistakes before publishing - turn an existing
.csprojinto a reusable template - spot outdated NuGet versions across a solution
Example prompts for the agent
- Search for a web API template with authentication and run
template_dry_runbefore creating anything - Validate the template in
./my-templatewithtemplate_validate - Generate a reusable template from my existing
.csprojusingtemplate_create_from_existing
How to install dotnet-template-mcp
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about dotnet-template-mcp
How do I install dotnet-template-mcp in Claude Code?
Install it as a global tool on .NET 8+: dotnet tool install --global DotnetTemplateMCP --version 2.0.0. Then register it in your client's MCP config; it runs over stdio as template-engine-mcp.
What does dotnet-template-mcp do?
It gives an agent access to dotnet new: template search locally and on NuGet.org, dry runs, project creation, solution analysis and validation of author templates.
How is template_validate different from the official validator?
The official dotnet template-authoring validate is the reference, so use it in CI. template_validate returns one JSON payload with errors, warnings and suggestions straight into the agent's conversation, with no install step or output parsing.