[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M756D26M97CQ5P6M372Q77VT":3,"skill-same:01M756D26M97CQ5P6M372Q77VT":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M756D26M97CQ5P6M372Q77VT","mcp-csharp-create",null,"Create MCP servers using the C# SDK and .NET project templates. Covers scaffolding, tool\u002Fprompt\u002Fresource implementation, and transport configuration for stdio and HTTP. USE FOR: creating new MCP server projects, scaffolding with dotnet new mcpserver, adding MCP tools\u002Fprompts\u002Fresources, choosing stdio vs HTTP transport, configuring MCP hosting in Program.cs, setting up ASP.NET Core MCP endpoints with MapMcp. DO NOT USE FOR: debugging or running existing servers (use mcp-csharp-debug), writing tests (use mcp-csharp-test), publishing or deploying (use mcp-csharp-publish), building MCP clients, non-.NET MCP servers.","weiflycc-cmd\u002Fskills","weiflycc-cmd","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F250846518?v=4","01M756C4PFGZJWKK04WFB9S5XF","威飛工作室","01M756C4QJJ66QDXN2RN6SXY87",0,"MIT","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-ai\u002Fskills\u002Fmcp-csharp-create\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: mcp-csharp-create\ndescription: >\n  Create MCP servers using the C# SDK and .NET project templates. Covers scaffolding,\n  tool\u002Fprompt\u002Fresource implementation, and transport configuration for stdio and HTTP.\n  USE FOR: creating new MCP server projects, scaffolding with dotnet new mcpserver, adding\n  MCP tools\u002Fprompts\u002Fresources, choosing stdio vs HTTP transport, configuring MCP hosting in\n  Program.cs, setting up ASP.NET Core MCP endpoints with MapMcp.\n  DO NOT USE FOR: debugging or running existing servers (use mcp-csharp-debug), writing tests\n  (use mcp-csharp-test), publishing or deploying (use mcp-csharp-publish), building MCP\n  clients, non-.NET MCP servers.\nlicense: MIT\n---\n\n# C# MCP Server Creation\n\nCreate Model Context Protocol servers using the official C# SDK (`ModelContextProtocol` NuGet package) and the `dotnet new mcpserver` project template. Servers expose tools, prompts, and resources that LLMs can discover and invoke via the MCP protocol.\n\n## When to Use\n\n- Starting a new MCP server project from scratch\n- Adding tools, prompts, or resources to an existing MCP server\n- Choosing between stdio (`--transport local`) and HTTP (`--transport remote`) transport\n- Setting up ASP.NET Core hosting for an HTTP MCP server\n- Wrapping an external API or service as MCP tools\n\n## Stop Signals\n\n- **Server already exists and needs debugging?** → Use `mcp-csharp-debug`\n- **Need tests or evaluations?** → Use `mcp-csharp-test`\n- **Ready to publish?** → Use `mcp-csharp-publish`\n- **Building an MCP client, not a server** → This skill is server-side only\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| Transport type | Yes | `stdio` (local\u002FCLI) or `http` (remote\u002Fweb). Ask user if not specified — default to stdio |\n| Project name | Yes | PascalCase name for the project (e.g., `WeatherMcpServer`) |\n| .NET SDK version | Recommended | .NET 10.0+ required. Check with `dotnet --version` |\n| Service\u002FAPI to wrap | Recommended | External API or service the tools will interact with |\n\n## Workflow\n\n> **Commit strategy:** Commit after completing each step so scaffolding and implementation are separately reviewable.\n\n### Step 1: Verify prerequisites\n\n1. Confirm .NET 10+ SDK: `dotnet --version` (install from https:\u002F\u002Fdotnet.microsoft.com if \u003C 10.0)\n\n2. Check if the MCP server template is already installed:\n   ```bash\n   dotnet new list mcpserver\n   ```\n   If \"No templates found\" → install: `dotnet new install Microsoft.McpServer.ProjectTemplates`\n\n### Step 2: Choose transport\n\n| Choose **stdio** if… | Choose **HTTP** if… |\n|----------------------|---------------------|\n| Local CLI tool or IDE plugin | Cloud\u002Fweb service deployment |\n| Single user at a time | Multiple simultaneous clients |\n| Running as subprocess (VS Code, GitHub Copilot) | Cross-network access needed |\n| Simpler setup, no network config | Containerized deployment (Docker\u002FAzure) |\n\n**Default:** stdio — simpler, works for most local development. Users can add HTTP later.\n\n### Step 3: Scaffold the project\n\n**stdio server:**\n```bash\ndotnet new mcpserver -n \u003CProjectName>\n```\nIf the template times out or is unavailable, use `dotnet new console -n \u003CProjectName>` and add `dotnet add package ModelContextProtocol`.\n\n**HTTP server:**\n```bash\ndotnet new web -n \u003CProjectName>\ncd \u003CProjectName>\ndotnet add package ModelContextProtocol.AspNetCore\n```\nThis is the recommended approach — faster and more reliable than the template. The template also supports HTTP via `dotnet new mcpserver -n \u003CProjectName> --transport remote`, but `dotnet new web` gives you more control over the project structure.\n\n**Template flags reference:** `--transport local` (stdio, default), `--transport remote` (ASP.NET Core HTTP), `--aot`, `--self-contained`.\n\n### Step 4: Implement tools\n\nTools are the primary way MCP servers expose functionality. Add a class with `[McpServerToolType]` and methods with `[McpServerTool]`:\n\n```csharp\nusing ModelContextProtocol.Server;\nusing System.ComponentModel;\n\n[McpServerToolType]\npublic static class MyTools\n{\n    [McpServerTool, Description(\"Brief description of what the tool does.\")]\n    public static async Task\u003Cstring> DoSomething(\n        [Description(\"What this parameter controls\")] string input,\n        CancellationToken cancellationToken = default)\n    {\n        \u002F\u002F Implementation\n        return $\"Result: {input}\";\n    }\n}\n```\n\n**Critical rules:**\n- Every tool method **must** have a `[Description]` attribute — LLMs use this to decide when to call the tool\n- Every parameter **must** have a `[Description]` attribute\n- Accept `CancellationToken` in all async tools\n- Use `[McpServerTool(Name = \"custom_name\")]` only if the default method name is unclear\n\n**DI injection patterns** — the SDK supports two styles:\n\n1. **Method parameter injection (static class):** DI services appear as method parameters. The SDK resolves them automatically — they do not appear in the tool schema.\n\n2. **Constructor injection (non-static class):** Use when tools need shared state or multiple services:\n```csharp\n[McpServerToolType]\npublic class ApiTools(HttpClient httpClient, ILogger\u003CApiTools> logger)\n{\n    [McpServerTool, Description(\"Fetch a resource by ID.\")]\n    public async Task\u003Cstring> FetchResource(\n        [Description(\"Resource identifier\")] string id,\n        CancellationToken cancellationToken = default)\n    {\n        logger.LogInformation(\"Fetching {Id}\", id);\n        return await httpClient.GetStringAsync($\"\u002Fapi\u002F{id}\", cancellationToken);\n    }\n}\n```\nRegister services in Program.cs:\n```csharp\nvar builder = Host.CreateApplicationBuilder(args);\nbuilder.Logging.AddConsole(options =>\n    options.LogToStandardErrorThreshold = LogLevel.Trace);\n\nbuilder.Services.AddHttpClient();        \u002F\u002F registers IHttpClientFactory + HttpClient\n\u002F\u002F ILogger\u003CT> is registered by default — no extra setup needed.\n\nbuilder.Services.AddMcpServer()\n    .WithStdioServerTransport()\n    .WithToolsFromAssembly();            \u002F\u002F discovers non-static [McpServerToolType] classes\n\nawait builder.Build().RunAsync();\n```\n\n**For the full attribute reference, return types, DI injection, and builder API patterns**, see [references\u002Fapi-patterns.md](references\u002Fapi-patterns.md).\n\n### Step 5: Add prompts and resources (optional)\n\n**Prompts** — reusable LLM interaction templates:\n```csharp\n[McpServerPromptType]\npublic static class MyPrompts\n{\n    [McpServerPrompt, Description(\"Summarize content into one sentence.\")]\n    public static ChatMessage Summarize(\n        [Description(\"Content to summarize\")] string content) =>\n        new(ChatRole.User, $\"Summarize this into one sentence: {content}\");\n}\n```\n\n**Resources** — data the LLM can read:\n```csharp\n[McpServerResourceType]\npublic static class MyResources\n{\n    [McpServerResource(UriTemplate = \"config:\u002F\u002Fapp\", Name = \"App Config\",\n        MimeType = \"application\u002Fjson\"), Description(\"Application configuration\")]\n    public static string GetConfig() => JsonSerializer.Serialize(AppConfig.Current);\n}\n```\n\n### Step 6: Configure Program.cs\n\n**stdio transport:**\n```csharp\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing Microsoft.Extensions.Logging;\nusing ModelContextProtocol.Server;\n\nvar builder = Host.CreateApplicationBuilder(args);\nbuilder.Logging.AddConsole(options =>\n    options.LogToStandardErrorThreshold = LogLevel.Trace); \u002F\u002F CRITICAL: stderr only\n\nbuilder.Services.AddMcpServer()\n    .WithStdioServerTransport()\n    .WithToolsFromAssembly();\n\nawait builder.Build().RunAsync();\n```\n\n**HTTP transport:**\n```csharp\nusing ModelContextProtocol.Server;\n\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddMcpServer()\n    .WithHttpTransport()\n    .WithToolsFromAssembly();\n\n\u002F\u002F Register services your tools need via DI\n\u002F\u002F builder.Services.AddHttpClient();\n\u002F\u002F builder.Services.AddSingleton\u003CIMyService, MyService>();\n\nvar app = builder.Build();\napp.MapMcp();                     \u002F\u002F exposes MCP endpoint at \u002Fmcp (Streamable HTTP)\napp.MapGet(\"\u002Fhealth\", () => \"ok\"); \u002F\u002F health check for container orchestrators\napp.Run();\n```\n\n**Key HTTP details:** `MapMcp()` defaults to `\u002Fmcp` path. For containers, set `ASPNETCORE_URLS=http:\u002F\u002F+:8080` and `EXPOSE 8080`. The MCP HTTP protocol uses Streamable HTTP — no special client config needed beyond the URL.\n\n**For transport configuration details** (stateless mode, auth, path prefix, `HttpContextAccessor`), see [references\u002Ftransport-config.md](references\u002Ftransport-config.md).\n\n### Step 7: Verify the server starts\n\n```bash\ncd \u003CProjectName>\ndotnet build\ndotnet run\n```\n\nFor stdio: the process starts and waits for JSON-RPC input on stdin.\nFor HTTP: the server listens on the configured port.\n\n## Validation\n\n- [ ] Project builds with no errors (`dotnet build`)\n- [ ] All tool classes have `[McpServerToolType]` attribute\n- [ ] All tool methods have `[McpServerTool]` and `[Description]` attributes\n- [ ] All parameters have `[Description]` attributes\n- [ ] stdio: logging directed to stderr, not stdout\n- [ ] HTTP: `app.MapMcp()` is called in Program.cs\n- [ ] Server starts successfully with `dotnet run`\n\n## Common Pitfalls\n\n| Pitfall | Solution |\n|---------|----------|\n| stdio server outputs garbage or hangs | Logging to stdout corrupts JSON-RPC protocol. Set `LogToStandardErrorThreshold = LogLevel.Trace` |\n| Tool not discovered by LLM clients | Missing `[McpServerToolType]` on the class or `[McpServerTool]` on the method. Verify `.WithToolsFromAssembly()` in Program.cs |\n| LLM doesn't understand when to use a tool | Add clear `[Description]` attributes on both the method and all parameters |\n| `WithToolsFromAssembly()` fails in AOT | Reflection-based discovery is incompatible with Native AOT. Use `.WithTools\u003CMyTools>()` instead |\n| Parameters not appearing in tool schema | `CancellationToken`, `IMcpServer`, and DI services are injected automatically — they do not appear in the schema. Only parameters with `[Description]` are exposed |\n| HTTP server returns 404 | `app.MapMcp()` must be called. Check the request path matches the configured route |\n\n## Related Skills\n\n- `mcp-csharp-debug` — Run, debug, and test with MCP Inspector\n- `mcp-csharp-test` — Unit tests, integration tests, evaluations\n- `mcp-csharp-publish` — NuGet, Docker, Azure deployment\n\n## Reference Files\n\n- [references\u002Fapi-patterns.md](references\u002Fapi-patterns.md) — Complete attribute reference, return types, DI injection, builder API, dynamic tools, experimental APIs. **Load when:** implementing tools, prompts, or resources beyond the basic patterns shown above.\n- [references\u002Ftransport-config.md](references\u002Ftransport-config.md) — Detailed transport configuration: stateless HTTP mode, OAuth\u002Fauth, custom path prefix, `HttpContextAccessor`, OpenTelemetry observability. **Load when:** configuring advanced transport options or authentication.\n\n## More Info\n\n- [C# MCP SDK](https:\u002F\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fcsharp-sdk) — Official SDK repository\n- [Build an MCP server (.NET)](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fai\u002Fquickstarts\u002Fbuild-mcp-server) — Microsoft quickstart\n- [MCP Specification](https:\u002F\u002Fmodelcontextprotocol.io\u002Fspecification\u002F) — Protocol specification\n","# C# MCP Server Creation\n\nCreate Model Context Protocol servers using the official C# SDK (`ModelContextProtocol` NuGet package) and the `dotnet new mcpserver` project template. Servers expose tools, prompts, and resources that LLMs can discover and invoke via the MCP protocol.\n\n## When to Use\n\n- Starting a new MCP server project from scratch\n- Adding tools, prompts, or resources to an existing MCP server\n- Choosing between stdio (`--transport local`) and HTTP (`--transport remote`) transport\n- Setting up ASP.NET Core hosting for an HTTP MCP server\n- Wrapping an external API or service as MCP tools\n\n## Stop Signals\n\n- **Server already exists and needs debugging?** → Use `mcp-csharp-debug`\n- **Need tests or evaluations?** → Use `mcp-csharp-test`\n- **Ready to publish?** → Use `mcp-csharp-publish`\n- **Building an MCP client, not a server** → This skill is server-side only\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| Transport type | Yes | `stdio` (local\u002FCLI) or `http` (remote\u002Fweb). Ask user if not specified — default to stdio |\n| Project name | Yes | PascalCase name for the project (e.g., `WeatherMcpServer`) |\n| .NET SDK version | Recommended | .NET 10.0+ required. Check with `dotnet --version` |\n| Service\u002FAPI to wrap | Recommended | External API or service the tools will interact with |\n\n## Workflow\n\n> **Commit strategy:** Commit after completing each step so scaffolding and implementation are separately reviewable.\n\n### Step 1: Verify prerequisites\n\n1. Confirm .NET 10+ SDK: `dotnet --version` (install from https:\u002F\u002Fdotnet.microsoft.com if \u003C 10.0)\n\n2. Check if the MCP server template is already installed:\n   ```bash\n   dotnet new list mcpserver\n   ```\n   If \"No templates found\" → install: `dotnet new install Microsoft.McpServer.ProjectTemplates`\n\n### Step 2: Choose transport\n\n| Choose **stdio** if… | Choose **HTTP** if… |\n|----------------------|---------------------|\n| Local CLI tool or IDE plugin | Cloud\u002Fweb service deployment |\n| Single user at a time | Multiple simultaneous clients |\n| Running as subprocess (VS Code, GitHub Copilot) | Cross-network access needed |\n| Simpler setup, no network config | Containerized deployment (Docker\u002FAzure) |\n\n**Default:** stdio — simpler, works for most local development. Users can add HTTP later.\n\n### Step 3: Scaffold the project\n\n**stdio server:**\n```bash\ndotnet new mcpserver -n \u003CProjectName>\n```\nIf the template times out or is unavailable, use `dotnet new console -n \u003CProjectName>` and add `dotnet add package ModelContextProtocol`.\n\n**HTTP server:**\n```bash\ndotnet new web -n \u003CProjectName>\ncd \u003CProjectName>\ndotnet add package ModelContextProtocol.AspNetCore\n```\nThis is the recommended approach — faster and more reliable than the template. The template also supports HTTP via `dotnet new mcpserver -n \u003CProjectName> --transport remote`, but `dotnet new web` gives you more control over the project structure.\n\n**Template flags reference:** `--transport local` (stdio, default), `--transport remote` (ASP.NET Core HTTP), `--aot`, `--self-contained`.\n\n### Step 4: Implement tools\n\nTools are the primary way MCP servers expose functionality. Add a class with `[McpServerToolType]` and methods with `[McpServerTool]`:\n\n```csharp\nusing ModelContextProtocol.Server;\nusing System.ComponentModel;\n\n[McpServerToolType]\npublic static class MyTools\n{\n    [McpServerTool, Description(\"Brief description of what the tool does.\")]\n    public static async Task\u003Cstring> DoSomething(\n        [Description(\"What this parameter controls\")] string input,\n        CancellationToken cancellationToken = default)\n    {\n        \u002F\u002F Implementation\n        return $\"Result: {input}\";\n    }\n}\n```\n\n**Critical rules:**\n- Every tool method **must** have a `[Description]` attribute — LLMs use this to decide when to call the tool\n- Every parameter **must** have a `[Description]` attribute\n- Accept `CancellationToken` in all async tools\n- Use `[McpServerTool(Name = \"custom_name\")]` only if the default method name is unclear\n\n**DI injection patterns** — the SDK supports two styles:\n\n1. **Method parameter injection (static class):** DI services appear as method parameters. The SDK resolves them automatically — they do not appear in the tool schema.\n\n2. **Constructor injection (non-static class):** Use when tools need shared state or multiple services:\n```csharp\n[McpServerToolType]\npublic class ApiTools(HttpClient httpClient, ILogger\u003CApiTools> logger)\n{\n    [McpServerTool, Description(\"Fetch a resource by ID.\")]\n    public async Task\u003Cstring> FetchResource(\n        [Description(\"Resource identifier\")] string id,\n        CancellationToken cancellationToken = default)\n    {\n        logger.LogInformation(\"Fetching {Id}\", id);\n        return await httpClient.GetStringAsync($\"\u002Fapi\u002F{id}\", cancellationToken);\n    }\n}\n```\nRegister services in Program.cs:\n```csharp\nvar builder = Host.CreateApplicationBuilder(args);\nbuilder.Logging.AddConsole(options =>\n    options.LogToStandardErrorThreshold = LogLevel.Trace);\n\nbuilder.Services.AddHttpClient();        \u002F\u002F registers IHttpClientFactory + HttpClient\n\u002F\u002F ILogger\u003CT> is registered by default — no extra setup needed.\n\nbuilder.Services.AddMcpServer()\n    .WithStdioServerTransport()\n    .WithToolsFromAssembly();            \u002F\u002F discovers non-static [McpServerToolType] classes\n\nawait builder.Build().RunAsync();\n```\n\n**For the full attribute reference, return types, DI injection, and builder API patterns**, see [references\u002Fapi-patterns.md](references\u002Fapi-patterns.md).\n\n### Step 5: Add prompts and resources (optional)\n\n**Prompts** — reusable LLM interaction templates:\n```csharp\n[McpServerPromptType]\npublic static class MyPrompts\n{\n    [McpServerPrompt, Description(\"Summarize content into one sentence.\")]\n    public static ChatMessage Summarize(\n        [Description(\"Content to summarize\")] string content) =>\n        new(ChatRole.User, $\"Summarize this into one sentence: {content}\");\n}\n```\n\n**Resources** — data the LLM can read:\n```csharp\n[McpServerResourceType]\npublic static class MyResources\n{\n    [McpServerResource(UriTemplate = \"config:\u002F\u002Fapp\", Name = \"App Config\",\n        MimeType = \"application\u002Fjson\"), Description(\"Application configuration\")]\n    public static string GetConfig() => JsonSerializer.Serialize(AppConfig.Current);\n}\n```\n\n### Step 6: Configure Program.cs\n\n**stdio transport:**\n```csharp\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing Microsoft.Extensions.Logging;\nusing ModelContextProtocol.Server;\n\nvar builder = Host.CreateApplicationBuilder(args);\nbuilder.Logging.AddConsole(options =>\n    options.LogToStandardErrorThreshold = LogLevel.Trace); \u002F\u002F CRITICAL: stderr only\n\nbuilder.Services.AddMcpServer()\n    .WithStdioServerTransport()\n    .WithToolsFromAssembly();\n\nawait builder.Build().RunAsync();\n```\n\n**HTTP transport:**\n```csharp\nusing ModelContextProtocol.Server;\n\nvar builder = WebApplication.CreateBuilder(args);\nbuilder.Services.AddMcpServer()\n    .WithHttpTransport()\n    .WithToolsFromAssembly();\n\n\u002F\u002F Register services your tools need via DI\n\u002F\u002F builder.Services.AddHttpClient();\n\u002F\u002F builder.Services.AddSingleton\u003CIMyService, MyService>();\n\nvar app = builder.Build();\napp.MapMcp();                     \u002F\u002F exposes MCP endpoint at \u002Fmcp (Streamable HTTP)\napp.MapGet(\"\u002Fhealth\", () => \"ok\"); \u002F\u002F health check for container orchestrators\napp.Run();\n```\n\n**Key HTTP details:** `MapMcp()` defaults to `\u002Fmcp` path. For containers, set `ASPNETCORE_URLS=http:\u002F\u002F+:8080` and `EXPOSE 8080`. The MCP HTTP protocol uses Streamable HTTP — no special client config needed beyond the URL.\n\n**For transport configuration details** (stateless mode, auth, path prefix, `HttpContextAccessor`), see [references\u002Ftransport-config.md](references\u002Ftransport-config.md).\n\n### Step 7: Verify the server starts\n\n```bash\ncd \u003CProjectName>\ndotnet build\ndotnet run\n```\n\nFor stdio: the process starts and waits for JSON-RPC input on stdin.\nFor HTTP: the server listens on the configured port.\n\n## Validation\n\n- [ ] Project builds with no errors (`dotnet build`)\n- [ ] All tool classes have `[McpServerToolType]` attribute\n- [ ] All tool methods have `[McpServerTool]` and `[Description]` attributes\n- [ ] All parameters have `[Description]` attributes\n- [ ] stdio: logging directed to stderr, not stdout\n- [ ] HTTP: `app.MapMcp()` is called in Program.cs\n- [ ] Server starts successfully with `dotnet run`\n\n## Common Pitfalls\n\n| Pitfall | Solution |\n|---------|----------|\n| stdio server outputs garbage or hangs | Logging to stdout corrupts JSON-RPC protocol. Set `LogToStandardErrorThreshold = LogLevel.Trace` |\n| Tool not discovered by LLM clients | Missing `[McpServerToolType]` on the class or `[McpServerTool]` on the method. Verify `.WithToolsFromAssembly()` in Program.cs |\n| LLM doesn't understand when to use a tool | Add clear `[Description]` attributes on both the method and all parameters |\n| `WithToolsFromAssembly()` fails in AOT | Reflection-based discovery is incompatible with Native AOT. Use `.WithTools\u003CMyTools>()` instead |\n| Parameters not appearing in tool schema | `CancellationToken`, `IMcpServer`, and DI services are injected automatically — they do not appear in the schema. Only parameters with `[Description]` are exposed |\n| HTTP server returns 404 | `app.MapMcp()` must be called. Check the request path matches the configured route |\n\n## Related Skills\n\n- `mcp-csharp-debug` — Run, debug, and test with MCP Inspector\n- `mcp-csharp-test` — Unit tests, integration tests, evaluations\n- `mcp-csharp-publish` — NuGet, Docker, Azure deployment\n\n## Reference Files\n\n- [references\u002Fapi-patterns.md](references\u002Fapi-patterns.md) — Complete attribute reference, return types, DI injection, builder API, dynamic tools, experimental APIs. **Load when:** implementing tools, prompts, or resources beyond the basic patterns shown above.\n- [references\u002Ftransport-config.md](references\u002Ftransport-config.md) — Detailed transport configuration: stateless HTTP mode, OAuth\u002Fauth, custom path prefix, `HttpContextAccessor`, OpenTelemetry observability. **Load when:** configuring advanced transport options or authentication.\n\n## More Info\n\n- [C# MCP SDK](https:\u002F\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fcsharp-sdk) — Official SDK repository\n- [Build an MCP server (.NET)](https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fai\u002Fquickstarts\u002Fbuild-mcp-server) — Microsoft quickstart\n- [MCP Specification](https:\u002F\u002Fmodelcontextprotocol.io\u002Fspecification\u002F) — Protocol specification\n",{"name":5,"license":15,"description":24},"Create MCP servers using the C# SDK and .NET project templates. Covers scaffolding, tool\u002Fprompt\u002Fresource implementation, and transport configuration for stdio and HTTP. USE FOR: creating new MCP server projects, scaffolding with dotnet new mcpserver, adding MCP tools\u002Fprompts\u002Fresources, choosing stdio vs HTTP transport, configuring MCP hosting in Program.cs, setting up ASP.NET Core MCP endpoints with MapMcp. DO NOT USE FOR: debugging or running existing servers (use mcp-csharp-debug), writing tests (use mcp-csharp-test), publishing or deploying (use mcp-csharp-publish), building MCP clients, non-.NET MCP servers.\n","main","5810d492c9b301d8227f932bf87b5c954c4fa4d6","plugins\u002Fdotnet-ai\u002Fskills\u002Fmcp-csharp-create","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd","weiflycc.com","2026-11-10 03:26:55",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add weiflycc-cmd\u002Fskills --skill mcp-csharp-create",{"tool":38,"command":39},"bunx","bunx skills add weiflycc-cmd\u002Fskills --skill mcp-csharp-create",{"tool":41,"command":42},"pnpm","pnpm dlx skills add weiflycc-cmd\u002Fskills --skill mcp-csharp-create","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-ai\u002Fskills\u002Fmcp-csharp-create\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fapi-patterns.md","REFERENCE","参考文档",5467,"https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-ai\u002Fskills\u002Fmcp-csharp-create\u002Freferences\u002Fapi-patterns.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Ftransport-config.md",3564,"https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-ai\u002Fskills\u002Fmcp-csharp-create\u002Freferences\u002Ftransport-config.md",[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M76SGT4WG5682JQJ0V3NSK6X","system-text-json-net11","Provides guidance on new System.Text.Json APIs introduced in .NET 11. It covers typed JsonTypeInfo access via GetTypeInfo\u003CT> and TryGetTypeInfo\u003CT> on JsonSerializerOptions, and the new JsonNamingPolicy.PascalCase static property. Use when serializing or deserializing JSON in .NET 11 applications and needing typed metadata access or PascalCase property naming.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet11\u002Fskills\u002Fsystem-text-json-net11\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M76SGPNZYYV9BCZJW7BF7J8A","nuget-trusted-publishing","Set up NuGet trusted publishing (OIDC) on a GitHub Actions repo — replaces long-lived API keys with short-lived tokens. USE FOR: trusted publishing, NuGet OIDC, keyless NuGet publish, migrate from NuGet API key, NuGet\u002Flogin, secure NuGet publishing. DO NOT USE FOR: publishing to private feeds or Azure Artifacts (OIDC is nuget.org only). INVOKES: shell (powershell or bash), edit, create, ask_user for guided repo setup.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet\u002Fskills\u002Fnuget-trusted-publishing\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M76SGHVNBNVM1DMVDYTMAE5G","dotnet-pinvoke","Correctly call native (C\u002FC++) libraries from .NET using P\u002FInvoke and LibraryImport. Covers function signatures, string marshalling, memory lifetime, SafeHandle, and cross-platform patterns. USE FOR: writing new P\u002FInvoke or LibraryImport declarations, reviewing or debugging existing native interop code, wrapping a C or C++ library for use in .NET, diagnosing crashes, memory leaks, or corruption at the managed\u002Fnative boundary. DO NOT USE FOR: COM interop, C++\u002FCLI mixed-mode assemblies, or pure managed code with no native dependencies.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet\u002Fskills\u002Fdotnet-pinvoke\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M76SGDB9Z3GSB1CFW314NC84","csharp-scripts","Run file-based C# apps with the .NET CLI when the user explicitly wants C#\u002F.NET code without creating a project. Use for C# language\u002FAPI experiments, one-file C# apps, small multi-file C# apps composed with `#:include`\u002F`#:exclude`, or C# file-based apps linked with `#:ref`. Do not use for language-agnostic throwaway scripts, generic computations, Python\u002FPowerShell-style automation, full projects, or existing app integration.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet\u002Fskills\u002Fcsharp-scripts\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M76SG805T8W764WAKB1NP3CJ","thread-abort-migration","Guides migration of .NET Framework Thread.Abort usage to cooperative cancellation in modern .NET. USE FOR: modernizing code that calls Thread.Abort, catching ThreadAbortException, replacing Thread.ResetAbort, replacing Thread.Interrupt for thread termination, resolving PlatformNotSupportedException or SYSLIB0006 after retargeting to .NET 6+, migrating ASP.NET Response.End or Response.Redirect(url, true) which internally call Thread.Abort. DO NOT USE FOR: code that only uses Thread.Join, Thread.Sleep, or Thread.Start without any abort, interrupt, or ThreadAbortException usage — these APIs work identically in modern .NET and need no migration. Also not for projects staying on .NET Framework, or Thread.Abort usage inside third-party libraries you do not control.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-upgrade\u002Fskills\u002Fthread-abort-migration\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M76SG2588ZJBE5C51HYJJSKV","migrate-nullable-references","Enable nullable reference types in a C# project and systematically resolve all warnings. USE FOR: adopting NRTs in existing codebases, file-by-file or project-wide migration, fixing CS8602\u002FCS8618\u002FCS86xx warnings, annotating APIs for nullability, cleaning up null-forgiving operators, upgrading dependencies with new nullable annotations. DO NOT USE FOR: projects already fully migrated with zero warnings (unless auditing suppressions), fixing a handful of nullable warnings in code that already has NRTs enabled, suppressing warnings without fixing them, C# 7.3 or earlier projects. INVOKES: Get-NullableReadiness.ps1 scanner script.","https:\u002F\u002Fgithub.com\u002Fweiflycc-cmd\u002Fskills\u002Fblob\u002Fmain\u002Fplugins\u002Fdotnet-upgrade\u002Fskills\u002Fmigrate-nullable-references\u002FSKILL.md",[],[]]