Forge
markdownf583a481
1## AIGuiders.DotnetMcp.Templates
2
3Template pack for `dotnet new` to bootstrap MCP servers on .NET.
4
5Release notes: see `docs/release.md`.
6
7### Why the template looks “heavy”
8
9The `mcp` template is intentionally aligned with our MCP repos (for example `hybrid-codebase-index`, `agent-notes-mcp`, `git-mcp`):
10
11- **`ToolCatalog` is the source of truth**: tool names + descriptions + input schemas live in code.
12- **`mcp-tools.manifest.json` is generated** from `ToolCatalog.Build()` using `tools/ExportMcpManifest`.
13 - This keeps the manifest and the docs consistent with the runtime contract.
14- **`docs/MCP-TOOLS.md` is generated** from the same catalog, so humans see the same descriptions the host sees.
15- **Tests validate consistency**: `*.Tests` compares manifest tool names/descriptions against `ToolCatalog`.
16
17### Why `tools/McpToolManifest` exists (instead of “just DTOs”)
18
19In the `mcp` template we include a tiny library `tools/McpToolManifest` that defines:
20
21- the canonical JSON shape (`schema_version`, `mcp_id`, `title`, `tools[]`)
22- a reader/validator (`McpToolManifestReader`)
23- a name comparer (`ToolCatalogNameComparer`)
24
25This gives a stable, reusable contract in every generated MCP repo and matches how the rest of our MCP repos are automated.
26
27### Why there are two readmes
28
29- **`README-NUGET.md`** is the public package readme shown on nuget.org (install + usage only).
30- **`README.md`** is the repo readme (may include maintainer notes and links to `docs/`).
31
32### Install
33
34```powershell
35dotnet new install AIGuiders.DotnetMcp.Templates
36```
37
38### Create a new MCP server (full pattern)
39
40```powershell
41dotnet new mcp -n MyCompany.MyMcp --mcp-id my-mcp
42```
43
44### Create a minimal MCP server
45
46```powershell
47dotnet new mcp-min -n MyCompany.MyMcp --mcp-id my-mcp
48```
49
50### Uninstall
51
52```powershell
53dotnet new uninstall AIGuiders.DotnetMcp.Templates
54```
55
56
View only · write via MCP/CIDE