SuperAPI AI Directory

dotnet-template-mcp

#️⃣ 🏠 🍎 🪟 🐧 - Search, inspect, preview and create dotnet new projects via the .NET Template Engine, with parameter validation, defaults and NuGet resolution.

Open website

About this tool

Purpose

dotnet-template-mcp is an MCP (Model Context Protocol) server that wraps the .NET Template Engine, enabling AI agents to search, inspect, preview, and create dotnet new project templates through natural language conversation, without needing to memorize complex CLI flags. For example, an AI agent only needs to say "I need a Web API with authentication and controllers," and the MCP server will automatically handle the rest.

Main Capabilities

  • Template Discovery and Inspection: Search and view template details.
  • Template Instantiation: Create projects through conversation.
  • Template Author Validation:template_validate The tool can catch errors in template.json before publishing, including missing required fields, invalid identity formats, short name conflicts with CLI commands, parameter issues (missing default values, empty options, prefix conflicts, type mismatches), broken computed symbols, misconfigured constraints, and missing tags. The tool returns a single structured JSON payload, divided into errors / warnings / suggestions, with fix-oriented messages, returned directly to the agent editing the template. The official tool is the reference implementation; if templates are authored manually in CI, it is recommended to prefer the official tool.
  • Smart Defaults: For example, AOT uses the latest framework, auth keeps HTTPS enabled.
  • Parameter Validation: Validate before writing files.
  • Constraint Checking: Check operating system, SDK, workloads.
  • Interactive Parameter Completion: When a template has required parameters that are not provided, interactively ask the user via MCP elicitation instead of failing directly. Template parameter types are mapped to form fields. Can be disabled via MCP_TEMPLATE_ELICITATION=false .
  • NuGet Auto-Resolution: If the template is not installed, automatically resolve it from NuGet.
  • CPM and Latest Package Versions: When creating a project in a solution that uses Central Package Management, the server automatically detects Directory.Packages.props, removes the Version attribute from the generated .csproj PackageReferences, adds missing <PackageVersion> entries to Directory.Packages.props, and resolves the latest stable NuGet versions. This also applies to standalone projects, where versions are updated directly in the .csproj.
  • Multi-Template Composition: Chain and compose multiple templates in a single call via template_compose .
  • Tool Profiles (Lite vs Full): All 15 tools are provided by default. Can be set via the MCP_TEMPLATE_TOOL_PROFILE environment variable. Lite profile tools include: template_from_intent, template_instantiate, template_inspect, template_search, template_dry_run. Non-Lite tools return a message explaining that they are disabled and how to enable them.

Usage

Installation and Deployment

  • Hosted Deployment: Hosted deployment is available on Fronteir AI.
  • Global Tool: Requires .NET 8+.
  • Zero Installation: Use dnx, requires .NET 10+.
  • VS Code / GitHub Copilot: Add to mcp.json.
  • Also supports clients such as Claude Desktop and Cursor.

Transport Modes

  • Stdio (Default): Standard input/output transport, for local CLI and tool usage.
  • HTTP (Remote / Team Sharing): Streamable HTTP transport, for remote or CI/CD deployments. Authentication is mandatory. Every tool in the server writes files and installs NuGet packages, so an open endpoint becomes a remote code execution surface. Unless a token is set or anonymous access is explicitly chosen, the server refuses to start the HTTP transport. Clients authenticate using Authorization: Bearer <shared-secret> . Requests to /mcp are rate-limited per client (default 120/minute,MCP_TEMPLATE_HTTP_RATE_LIMIT=0 can be disabled). /health remains anonymous for probes.

The HTTP server exposes:

  • /mcp — MCP streamable HTTP endpoint (requires bearer token)
  • /health — health check endpoint (anonymous)

You can configure the listening URL and connect MCP clients.

Non-multi-tenant note

TemplateEngineService is a process-level singleton,virtualizeSettings: false, so the installed template set is shared by all callers, and the workspace root directory is also process-level. Each trusted team or tenant should run one instance; do not expose a single instance to mutually untrusted users.

Applicable scenarios

  • AI agent-driven .NET project scaffolding creation.
  • Template authors verify the correctness of template.json before publishing.
  • Team-shared remote MCP deployment for project generation in CI/CD.
  • Integration with MCP clients such as VS Code, GitHub Copilot, Claude Desktop, and Cursor.

Limitations

  • HTTP mode is not multi-tenant; instances must be isolated per team or tenant.
  • HTTP mode must be configured with authentication, otherwise startup is refused.
  • Global tools require .NET 8+, and dnx zero-install requires .NET 10+.
  • The template author verification tool does not replace the official tool; the official tool is the reference implementation and covers more cases.
  • Build and test: CI runs on push/PR via GitHub Actions (Ubuntu + Windows). Contributions are welcome; please open an issue to discuss before submitting a PR. See CHANGELOG.md for the release history.