跳到正文
cccskills
免费在 GitHub 公开

dotnet-mcp

Load when creating, scaffolding, configuring, debugging, testing, containerizing, or publishing a C#/.NET Model Context Protocol (MCP) server using the official Microsoft ModelContextProtocol SDK; not for non-.NET MCP servers, general ASP.NET Core APIs without MCP, or consuming external MCP tools as a client.

中文简介正在准备中。当前显示原文说明。

集成工具Docker
查看安装方法

包含的文件(15)

  • SKILL.md5.4 KB
  • resources/api-patterns.md5.5 KB
  • resources/debugging-and-inspector.md3.9 KB
  • resources/docker-azure.md4.8 KB
  • resources/evaluations.md2.8 KB
  • resources/ide-config.md4.6 KB
  • resources/index.md2.8 KB
  • resources/mcp-inspector.md2.5 KB
  • resources/mcp-registry.md3.9 KB
  • resources/nuget-packaging.md4.3 KB
  • resources/publishing-and-deployment.md4.7 KB
  • resources/server-scaffolding.md3.8 KB
  • resources/test-patterns.md3.6 KB
  • resources/testing-and-evaluations.md4.9 KB
  • resources/transport-config.md3.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

<!-- ABOUTME: Master router and invariant guardian for C#/.NET Model Context Protocol (MCP) server engineering. --> <!-- ABOUTME: Enforces transport selection, stdio protocol safety, tool contracts, and progressive resource disclosure. -->

.NET Model Context Protocol (MCP) Engineering

A unified skill for building, debugging, testing, and publishing C# Model Context Protocol (MCP) servers using Microsoft's official ModelContextProtocol SDK.

Resources

  • Resource Index — Load to locate the exact lifecycle guide, API specification, or deployment recipe needed.
  • Server Scaffolding & Configuration — Load when creating projects, selecting transports, configuring Program.cs, or implementing tools.
  • Debugging & Inspector — Load when running servers locally, troubleshooting stdout pollution, using MCP Inspector, or setting up IDE clients.
  • Testing & Evaluations — Load when authoring tool unit tests, McpClient integration fixtures, or LLM evaluation suites.
  • Publishing & Deployment — Load when packaging as a NuGet tool, building chiseled Docker images, or publishing to the MCP Registry.

Rules

  1. Official SDK & Target: Require .NET 10+ and use the official Microsoft ModelContextProtocol or ModelContextProtocol.AspNetCore package.
  2. Transport Hierarchy: Default to stdio for local command-line tools, desktop assistants, and IDE subprocesses. Use Streamable HTTP (MapMcp) for remote, multi-client, or containerized deployments.
  3. stdio stdout Safety Invariant: In stdio servers, standard output is strictly reserved for JSON-RPC messages. Any application logging to stdout corrupts protocol framing and causes client connections to hang. All console logging and diagnostics must be directed to stderr (LogToStandardErrorThreshold = LogLevel.Trace).
  4. Tool Contract: Tool classes must carry [McpServerToolType]; exposed methods must carry [McpServerTool]. Both methods and parameters require descriptive [Description] attributes to guide AI model tool selection. Asynchronous tools must accept and propagate a CancellationToken.
  5. Dependency Injection: Inject external clients, database contexts, and services via DI into constructors or tool methods. Never instantiate network clients or infrastructure directly inside tool methods.
  6. Inspector-First Verification: Always verify protocol correctness and tool discovery using the MCP Inspector (npx @modelcontextprotocol/inspector) before debugging consuming IDE clients.
  7. Testing Discipline: Tool logic should be verified with direct unit tests (mocking HttpMessageHandler or domain services). Protocol behavior must be verified via integration tests using McpClient asserting both ListToolsAsync() and CallToolAsync().
  8. Secrets & Packaging Safety: Never bake API keys, connection strings, or .env files into NuGet packages, Docker images, or server.json.

Task Routing

User Intent / TaskPrimary Lifecycle GuideDeep Reference
Scaffold new MCP server, choose transport, configure DIserver-scaffolding.mdtransport-config.md, api-patterns.md
Author complex tools, prompts, resources, or Native AOTserver-scaffolding.mdapi-patterns.md
Run locally, debug protocol, use MCP Inspectordebugging-and-inspector.mdmcp-inspector.md
Configure client IDEs (VS Code, Visual Studio, Copilot)debugging-and-inspector.mdide-config.md
Write unit or protocol integration teststesting-and-evaluations.mdtest-patterns.md
Create LLM tool quality evaluationstesting-and-evaluations.mdevaluations.md
Package as global .NET tool (dotnet pack)publishing-and-deployment.mdnuget-packaging.md
Build Docker container or deploy to Azure Container Appspublishing-and-deployment.mddocker-azure.md
Publish listing to the official MCP Registrypublishing-and-deployment.mdmcp-registry.md

Verification

  • Compilation: dotnet build --configuration Release
  • Protocol Inspection: npx @modelcontextprotocol/inspector dotnet run --project <Server.csproj>
  • Automated Tests: dotnet test --project <Server.Tests.csproj> --configuration Release
  • Clean stdout: Confirm that stdio servers print zero non-JSON-RPC lines to stdout during execution.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Load for Blazor/MudBlazor UI changes involving forms, dialogs, focus, keyboard navigation, landmarks, ARIA, color contrast, RTL-safe styling, or WCAG 2.2 AA tests; not for backend-only changes.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

Load when a task asks to research, verify, compare, or look up framework/package behavior, release notes, standards, RFCs, CVEs, or unfamiliar APIs; use repository evidence first, then official docs, and not for codebase navigation alone.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

aspire

免费

Load for Aspire AppHost work: start/stop/wait resources, inspect dashboard/logs/traces, add integrations/resources, rebuild a service, run isolated worktrees, or diagnose Aspire orchestration; not for plain dotnet apps, container-only deployments, or cloud deployment.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

Load for authentication or authorization changes involving BFF cookies/tokens, JWT validation, claims/user ID extraction, policies, handler access checks, impersonation, or 401/403 bugs; not for UI affordance gating alone.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

Load for Blazor BFF server work involving YARP proxy routes, cookie sessions, access-token forwarding/refresh, downstream API calls, BFF handlers, or browser-to-API auth failures; not for client component rendering or API JWT validation alone.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

Load when editing Blazor `.razor.css`, scoped selectors, `::deep`, BEM class names, RTL/logical CSS properties, or styling nested MudBlazor components; not for global design tokens or non-Blazor CSS.

中文简介正在准备中。当前显示原文说明。

islamu-ngo/Event82026年10月21日 更新

查看 islamu-ngo 的全部技能

报告此技能的问题