{
  "markdown": "# DotnetTemplateMCP\n\n<!-- mcp-name: io.github.YuliiaKovalova/dotnet-template-mcp -->\n\nAn 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.\n\n<a href=\"https://glama.ai/mcp/servers/@YuliiaKovalova/dotnet-template-mcp\">\n  <img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@YuliiaKovalova/dotnet-template-mcp/badge\" alt=\"DotnetTemplateMCP MCP server\" />\n</a>\n\nInstead of this:\n```bash\ndotnet new list --language C#\ndotnet new webapi --help\ndotnet new webapi --auth Individual --use-controllers --name MyApi --output ./MyApi\n```\n\nYour AI agent just says: *\"I need a web API with authentication and controllers\"* — and the MCP server figures out the rest.\n\n## Template Validation for Authors\n\nBuilding a custom `dotnet new` template? `template_validate` catches mistakes **before** you publish — no more guessing if your `template.json` is correct:\n\n```\nAgent calls: template_validate(\"./my-template\")\n\n← Returns:\n{\n  \"valid\": false,\n  \"summary\": \"2 error(s), 1 warning(s), 3 suggestion(s)\",\n  \"errors\": [\n    \"Missing required field 'shortName'.\",\n    \"Parameter 'Framework': default value 'net7.0' is not in the choices list.\"\n  ],\n  \"warnings\": [\n    \"Missing 'sourceName'. Without it, the generated project name won't be customizable via --name.\"\n  ],\n  \"suggestions\": [\n    \"Consider adding a 'description' field to help users understand what this template creates.\",\n    \"Consider adding 'language' tag (e.g., 'C#') for better discoverability.\",\n    \"Consider adding 'type' tag (e.g., 'project', 'item') for filtering.\"\n  ]\n}\n```\n\n**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.\n\n**How this relates to the official tooling.** Microsoft ships template authoring validation already, and you should know about it:\n\n| Official tool | What it gives you |\n|---|---|\n| [`Microsoft.TemplateEngine.Authoring.CLI`](https://www.nuget.org/packages/Microsoft.TemplateEngine.Authoring.CLI) | `dotnet template-authoring validate` — the reference validator |\n| [`Microsoft.TemplateEngine.Authoring.Tasks`](https://www.nuget.org/packages/Microsoft.TemplateEngine.Authoring.Tasks) | Validation at build time, as an MSBuild task |\n| [`Microsoft.TemplateEngine.Authoring.TemplateVerifier`](https://www.nuget.org/packages/Microsoft.TemplateEngine.Authoring.TemplateVerifier) | Snapshot testing of template output |\n\nWhat `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.\n\n## Tools\n\n| Tool | What it does |\n|------|-------------|\n| `template_search` | Search locally **and** on NuGet.org — one call, ranked results |\n| `template_list` | List what's installed, filter by language/type/classification |\n| `template_inspect` | Parameters, constraints, post-actions — all in one shot |\n| `template_instantiate` | Create a project. Not installed? Auto-resolves from NuGet. Elicits missing params interactively |\n| `template_dry_run` | Preview files without touching disk |\n| `template_install` | Install a package (idempotent — skips if already there) |\n| `template_uninstall` | Remove a template package |\n| `templates_installed` | Inventory of everything installed |\n| `template_from_intent` | *\"web API with auth\"* → webapi + `auth=Individual` — no LLM needed |\n| `template_create_from_existing` | Analyze a .csproj → generate a reusable template matching repo conventions |\n| `template_compose` | Execute a sequence of templates (project + items) in one workflow |\n| `template_suggest_parameters` | Suggest parameter values with rationale based on cross-parameter relationships |\n| `template_validate` | Validate a local template directory for authoring issues before publishing |\n| `template_compare` | Compare 2+ templates side by side — parameters, features, frameworks |\n| `solution_analyze` | Analyze a solution/workspace — project structure, frameworks, CPM status |\n| `packages_upgrade` | Scan a project/solution/folder for outdated NuGet versions and report or apply upgrades (CPM-aware) |\n\n📖 [Full tool reference →](docs/tool-reference.md)\n\n## Hosted deployment\n\nA hosted deployment is available on [Fronteir AI](https://fronteir.ai/mcp/yuliiakovalova-dotnet-template-mcp).\n\n## Quick Start\n\n### Global tool (.NET 8+)\n\n```bash\ndotnet tool install --global DotnetTemplateMCP --version 2.0.0\n```\n\n### Zero-install with `dnx` (.NET 10+)\n\n```bash\ndnx -y DotnetTemplateMCP --version 2.0.0\n```\n\n### VS Code / GitHub Copilot\n\nAdd to `mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"dotnet-templates\": {\n      \"type\": \"stdio\",\n      \"command\": \"dnx\",\n      \"args\": [\"-y\", \"DotnetTemplateMCP\", \"--version\", \"2.0.0\"]\n    }\n  }\n}\n```\n\n📖 [Claude Desktop, Cursor, and more →](docs/configuration.md)\n\n## Transport Modes\n\n### Stdio (default)\n\nStandard I/O transport for local CLI and tool usage:\n\n```bash\ntemplate-engine-mcp                     # stdio is the default\ntemplate-engine-mcp --transport stdio   # explicit\n```\n\n### HTTP (remote / team-shared)\n\nStreamable HTTP transport for remote or CI/CD deployment.\n\n**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:\n\n```bash\n# Recommended\nMCP_TEMPLATE_HTTP_TOKEN=<shared-secret> template-engine-mcp --transport http\n\n# Only for a trusted, isolated network\nMCP_TEMPLATE_HTTP_ALLOW_ANONYMOUS=true template-engine-mcp --transport http\n```\n\nClients 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.\n\n> **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.\n\n```bash\ntemplate-engine-mcp --transport http\n# or via environment variable:\nMCP_TEMPLATE_TRANSPORT=http template-engine-mcp\n```\n\nThe HTTP server exposes:\n- **`/mcp`** — MCP streamable HTTP endpoint (bearer token required)\n- **`/health`** — Health check endpoint (anonymous)\n\nConfigure the listen URL:\n```bash\nMCP_TEMPLATE_HTTP_URL=http://0.0.0.0:8080 template-engine-mcp --transport http\n```\n\nConnect your MCP client:\n```json\n{\n  \"servers\": {\n    \"dotnet-templates\": {\n      \"type\": \"http\",\n      \"url\": \"http://localhost:5005/mcp\"\n    }\n  }\n}\n```\n\n### Interactive Elicitation\n\nWhen 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:\n\n| Template Parameter | Elicitation Field |\n|---|---|\n| `string` | Text input |\n| `bool` / `boolean` | Checkbox |\n| `int` / `number` | Number input |\n| Choice parameter | Single-select dropdown |\n\nDisable with `MCP_TEMPLATE_ELICITATION=false`.\n\n## How it works\n\n```\nYou: \"I need a web API with authentication, controllers, and Docker support\"\n\n→ template_from_intent extracts keywords: web api, authentication, controllers, docker\n→ Matches: webapi (confidence: 0.85)\n→ Resolves: auth=Individual, UseControllers=true, EnableDocker=true\n→ template_instantiate creates the project\n```\n\nThe 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.\n\n### CPM & Latest Package Versions\n\nWhen creating a project inside a solution that uses [Central Package Management](https://learn.microsoft.com/nuget/consume-packages/central-package-management), the server automatically:\n\n1. **Detects** `Directory.Packages.props` by walking up the directory tree\n2. **Strips** `Version` attributes from generated `.csproj` PackageReferences\n3. **Adds** missing `<PackageVersion>` entries to `Directory.Packages.props`\n4. **Resolves** latest stable NuGet versions — no more stale hardcoded versions from templates\n\n```\nBefore (what dotnet new generates):\n  <PackageReference Include=\"Serilog\" Version=\"3.1.0\" />    ← stale, breaks CPM\n\nAfter (what template_instantiate produces):\n  .csproj:                    <PackageReference Include=\"Serilog\" />\n  Directory.Packages.props:   <PackageVersion Include=\"Serilog\" Version=\"4.2.0\" />\n```\n\nWorks for standalone projects too — versions are updated directly in the `.csproj`.\n\n### Multi-Template Composition\n\nChain multiple templates in one call with `template_compose`:\n\n```json\n[\n  {\"templateName\": \"webapi\", \"name\": \"MyApi\", \"parametersJson\": \"{\\\"auth\\\": \\\"Individual\\\"}\"},\n  {\"templateName\": \"gitignore\", \"target\": \".\"}\n]\n```\n\n📖 [Architecture & smart behaviors →](docs/architecture.md)\n\n### Tool Profiles (Lite vs Full)\n\nBy default, all 15 tools are available. If your agent works better with fewer tools, set the `MCP_TEMPLATE_TOOL_PROFILE` environment variable:\n\n| Profile | Tools | When to use |\n|---------|-------|-------------|\n| `full` (default) | All 15 tools | Full control — advanced workflows, composition, custom templates |\n| `lite` | 5 core tools | Simpler agents that just need to find and create projects |\n\n**Lite profile tools:** `template_from_intent`, `template_instantiate`, `template_inspect`, `template_search`, `template_dry_run`\n\n```json\n{\n  \"servers\": {\n    \"dotnet-template-mcp\": {\n      \"command\": \"dotnet-template-mcp\",\n      \"env\": {\n        \"MCP_TEMPLATE_TOOL_PROFILE\": \"lite\"\n      }\n    }\n  }\n}\n```\n\nNon-lite tools will return a helpful message explaining they're disabled and how to enable them.\n\n## Documentation\n\n| Doc | What's in it |\n|-----|-------------|\n| [Configuration](docs/configuration.md) | VS Code, Claude Desktop, Cursor setup + troubleshooting |\n| [Tool Reference](docs/tool-reference.md) | Every tool's parameters, types, and examples |\n| [Architecture](docs/architecture.md) | Template cache, smart behaviors, telemetry, project structure |\n| [MCP vs Skills](docs/mcp-vs-skills.md) | Why MCP over Copilot Skills — benefits and downsides |\n| [Plain LLM vs MCP](docs/plain-llm-vs-mcp.md) | Side-by-side: what a plain LLM does vs. the MCP tool (4 scenarios) |\n| [Skills Equivalent](docs/skills-equivalent.md) | What it'd take to cover this with Skills instead |\n\n## Building & Testing\n\n```bash\ndotnet build\ndotnet test    # 185+ tests — unit, integration, and E2E\n```\n\nCI runs on push/PR via [GitHub Actions](.github/workflows/ci.yml) (Ubuntu + Windows).\n\n## Contributing\n\nContributions are welcome! Please open an issue to discuss proposed changes before submitting a PR.\n\n```bash\n# Setup\ndotnet restore\ndotnet build\n\n# Run tests\ndotnet test\n\n# Pack locally\ndotnet pack src/DotnetTemplateMcp -o nupkg/\n```\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for release history.\n\n## License\n\n[MIT](LICENSE)",
  "bytes": 11700,
  "sha": "b33a9769d84403db0ec47a6b2057d55d86800c12df9d00ffc52ebd4dbc11a9da",
  "repo_slug": "yuliiakovalova/dotnet-template-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_yuliiakovalova_dotnet_template_9d51b117/readme"
}