mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
7286c31118
* Add C# MCP server skills (create, debug, test, publish) Four new skills for the C# MCP server development lifecycle: - mcp-csharp-create: Scaffolding with dotnet new mcpserver, tools/prompts/resources, transport config - mcp-csharp-debug: MCP Inspector, VS Code integration, breakpoint debugging, logging - mcp-csharp-test: Unit tests with ClientServerTestBase, integration with WebApplicationFactory, evals - mcp-csharp-publish: NuGet packaging, Docker/Azure deployment, MCP Registry publishing Each skill includes SKILL.md with progressive disclosure references/ and eval.yaml tests. * Fix mcp-csharp-create eval: use regex assertions for combined attribute syntax Replace scaffolding-heavy scenarios with implementation-focused ones that test MCP-specific features (resources, prompts, logging). Fix assertion patterns to match combined C# attribute syntax [McpServerTool, Description()] instead of requiring standalone [McpServerTool]. Increase timeouts to 180s to account for skill-reading overhead. Validator result: passed=True, improvement=44.6% (threshold=10%) * Add CODEOWNERS entries for MCP C# skills (create, debug, publish, test) * Update plugins/dotnet/skills/mcp-csharp-test/references/test-patterns.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update plugins/dotnet/skills/mcp-csharp-debug/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update plugins/dotnet/skills/mcp-csharp-publish/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update plugins/dotnet/skills/mcp-csharp-publish/references/nuget-packaging.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update plugins/dotnet/skills/mcp-csharp-debug/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove evaluation step and guide from mcp-csharp-test skill * Add CODEOWNERS entries for dotnet-maui skills * Update CODEOWNERS to add @artl93 as co-owner for mcp-csharp skills * Replace parent-directory file references with backtick skill names Cross-skill references used ../sibling/SKILL.md paths which the validator rejects. Replace with backtick-quoted skill names to match the convention used by other skills in the repo. * Add known domains for MCP server development skills Add domains referenced by the mcp-csharp-* skills: - github.com/modelcontextprotocol/registry - github.com/open-telemetry/semantic-conventions - npmjs.com, xunit.net, fluentassertions.com, nugettest.org Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Docker commands to use placeholder for registry and image names * moved mcp skills and their evals into dotnet-ai plugin * cleaned up moved files to dotnet-ai * cleaned up files * Update .github/CODEOWNERS Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update nuget-packaging.md * Update repository URL format in nuget-packaging.md * Add github.com/ to known-domains to allow truncated placeholder URLs The URL regex truncates at angle brackets (invalid in URIs), so placeholder URLs like https://github.com/<yourusername>/<repo> become https://github.com/ which didn't match any path-scoped entry. Adding github.com/ (with trailing slash) covers only this case without broadly allowing all github.com URLs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Docker tag command to use placeholder for server name * Update known domains and fix GitHub username placeholders in documentation * Remove McpServerToolType from mcp-csharp-create eval McpServerToolType is only needed with WithToolsFromAssembly(), which is discouraged because it is not Native AOT compatible. Updated eval assertions and rubrics to prefer WithTools<T>() instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Improve eval resilience for mcp-csharp-create and mcp-csharp-debug - Increase mcp-csharp-create timeouts from 180s (or default 120s) to 360s for all 3 scenarios. These scenarios consistently time out because the model spends time on bash exploration/scaffolding before writing code. - Add explicit timeout to scenario 3 which was relying on the 120s default. - Broaden mcp-csharp-debug Inspector rubric to accept both the concise single CLI command style and the step-by-step UI configuration walkthrough, since both are correct approaches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update eng/known-domains.txt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Broaden debug 'failing tool' rubric to accept multiple debugging approaches The rubric criterion 'Shows how to attach a debugger' was too narrow. The skilled answer correctly focused on the #1 cause (stdout pollution) but scored low because it didn't show a specific 'attach to process' flow. Broadened to accept any valid debugging approach: attaching, Debugger.Launch(), or launch.json configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix 4 eval failures in mcp-csharp-debug and mcp-csharp-test skills mcp-csharp-debug: - Trim SKILL.md verbosity (183->160 lines) and mcp-inspector.md (67->54 lines) - Add Diagnosing Tool Errors section covering debugger, output panel, Inspector, common culprits - Rebalance debugging narrative away from stderr-only focus - Move HTTP logging config to ide-config.md reference mcp-csharp-test: - Add eval/evaluations keywords to frontmatter for activation - Add HTTP tool invocation test pattern (tools/call via WebApplicationFactory) - Trim test-patterns.md bloat (remove Test Categories, Coverage, Input Validation) - Create references/evaluations.md with qa_pair format and read-only/deterministic guidance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Dan Moseley <danmose@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
50 lines
2.4 KiB
YAML
50 lines
2.4 KiB
YAML
scenarios:
|
|
- name: "Debug an MCP server with MCP Inspector"
|
|
prompt: |
|
|
I have a C# MCP server that uses stdio transport. I want to test it
|
|
interactively with the MCP Inspector to see if my tools are working.
|
|
How do I connect and debug?
|
|
assertions:
|
|
- type: "output_contains"
|
|
value: "npx @modelcontextprotocol/inspector"
|
|
- type: "output_matches"
|
|
pattern: "(dotnet run|--project)"
|
|
rubric:
|
|
- "Shows how to launch MCP Inspector with npx @modelcontextprotocol/inspector"
|
|
- "Explains how to connect it to the stdio server using dotnet run — either as a single CLI command (npx @modelcontextprotocol/inspector dotnet run ...) or via the Inspector UI configuration (Transport Type, Command, Arguments)"
|
|
- "Mentions that the Inspector UI shows tools, prompts, and resources"
|
|
- "Notes that server logging must go to stderr, not stdout"
|
|
timeout: 120
|
|
- name: "Configure VS Code to use an MCP server"
|
|
prompt: |
|
|
I built a C# MCP server at src/MyMcpServer/MyMcpServer.csproj.
|
|
I want to use it with GitHub Copilot in VS Code agent mode.
|
|
How do I configure mcp.json?
|
|
assertions:
|
|
- type: "output_contains"
|
|
value: "mcp.json"
|
|
- type: "output_matches"
|
|
pattern: "(dotnet|run|--project)"
|
|
rubric:
|
|
- "Shows the mcp.json configuration with type stdio"
|
|
- "Uses dotnet run --project with the correct project path"
|
|
- "Places the config in .vscode/mcp.json for workspace or user settings"
|
|
- "Mentions testing the configuration by asking Copilot to use the tools"
|
|
timeout: 120
|
|
- name: "Debug a failing MCP server tool"
|
|
prompt: |
|
|
My C# MCP server is returning errors when I call one of its tools from
|
|
VS Code Copilot. The tool works fine when I run it manually as a console
|
|
app. How do I debug this?
|
|
assertions:
|
|
- type: "output_matches"
|
|
pattern: "(stderr|Console\\.Error|logging)"
|
|
- type: "output_matches"
|
|
pattern: "(breakpoint|attach|debugger)"
|
|
rubric:
|
|
- "Explains that stdout is reserved for MCP protocol in stdio mode"
|
|
- "Recommends checking that all logging goes to stderr"
|
|
- "Shows how to further diagnose the issue — such as attaching a debugger to the running process, using Debugger.Launch(), or configuring launch.json to debug the server"
|
|
- "Suggests using MCP Inspector or VS Code debug config to test or step through the server"
|
|
timeout: 120
|