
Dotnet Template Mcp
io.github.YuliiaKovalovaPublished by GitHub account YuliiaKovalovav2.0.0Updated Oct 24, 2026
MCP server for dotnet new: discover, inspect, preview and create .NET projects from templates.
Overview
An MCP server for dotnet new that lets an assistant search, inspect, preview and scaffold .NET projects and templates from natural language.
- What you can do
- Search and list templates locally and on NuGet.org, and inspect their parameters and constraints
- Create projects from a described intent, preview generated files without writing, and compose several templates in one workflow
- Install, uninstall and inventory template packages, resolving missing ones from NuGet
- Validate and compare templates, and generate a reusable template from an existing project
- Analyze solutions and scan for outdated NuGet versions, reporting or applying upgrades
- When to use it
- Useful when you want an assistant to scaffold .NET projects, pick the right template and parameters, or check a custom template before publishing, without memorizing dotnet new flags. Also handy for auditing solution structure and package versions.
- Requirements
- Runs locally over stdio as a .NET tool (global install, .NET 8+) or zero-install via dnx (.NET 10+); the .NET SDK and network access to NuGet are needed. An optional HTTP mode requires a shared token in MCP_TEMPLATE_HTTP_TOKEN or explicit anonymous opt-in.
Installation
In SourceWeft
- Open Dotnet Template Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Instead of this:
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:
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:
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
Hosted deployment
A hosted deployment is available on Fronteir AI.
Quick Start
Global tool (.NET 8+)
Zero-install with dnx (.NET 10+)
VS Code / GitHub Copilot
Add to mcp.json:
📖 Claude Desktop, Cursor, and more →
Transport Modes
Stdio (default)
Standard I/O transport for local CLI and tool usage:
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:
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.
TemplateEngineServiceis a process-wide singleton withvirtualizeSettings: 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.
The HTTP server exposes:
/mcp— MCP streamable HTTP endpoint (bearer token required)/health— Health check endpoint (anonymous)
Configure the listen URL:
Connect your MCP client:
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:
Disable with MCP_TEMPLATE_ELICITATION=false.
How it works
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:
- Detects
Directory.Packages.propsby walking up the directory tree - Strips
Versionattributes from generated.csprojPackageReferences - Adds missing
<PackageVersion>entries toDirectory.Packages.props - Resolves latest stable NuGet versions — no more stale hardcoded versions from templates
Works for standalone projects too — versions are updated directly in the .csproj.
Multi-Template Composition
Chain multiple templates in one call with template_compose:
📖 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:
Lite profile tools: template_from_intent, template_instantiate, template_inspect, template_search, template_dry_run
Non-lite tools will return a helpful message explaining they're disabled and how to enable them.
Documentation
Building & Testing
CI runs on push/PR via GitHub Actions (Ubuntu + Windows).
Contributing
Contributions are welcome! Please open an issue to discuss proposed changes before submitting a PR.
Changelog
See CHANGELOG.md for release history.
License
Source: README.md at commit a8a4980
Tools
0Version history
1- v2.0.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts