Expose one .NET operation and verify its local MCP tool contract
Build a bounded C# stdio MCP tool, inspect its discovered schema, and check a harmless fixture through a separate client.
npx skills add agentskillexchange/skills --skill verify-local-dotnet-mcp-tool-contract
Invoke this workflow when an agent must expose one selected .NET operation to an MCP client and produce evidence that its tool contract works. The deliverable is a local stdio server, a tool-discovery record, and a checked result from a harmless fixture. Keep the task bounded to the chosen operation and its arguments.
What this skill actually does
Prepare the local check
Identify the method, allowed inputs, expected result, project path and cancellation behavior. Start with a deterministic fixture before connecting business data. In a new console project, add ModelContextProtocol and Microsoft.Extensions.Hosting. Follow the upstream server example: register AddMcpServer(), WithStdioServerTransport() and WithToolsFromAssembly(); annotate the intended tool with McpServerToolType and McpServerTool. Send console logs to stderr so stdout remains available for protocol messages.
Discover and invoke the tool
Build the server. Create a separate console client with ModelContextProtocol. Adapt the documented StdioClientTransport to launch your built local server with an explicit project or assembly path. Connect using McpClient.CreateAsync, inspect ListToolsAsync and record the actual tool name and input schema before calling CallToolAsync with the fixture arguments. Check the returned text against the expected value and inspect error results. For the upstream Echo fixture, message Hello MCP! should yield hello Hello MCP!.
Return reviewable evidence
Report the selected SDK package version, build result, command and working directory, discovered tool schema, fixture input, observed output and pass/fail conclusion. Stop and report a missing tool, protocol error or output mismatch. This workflow ends at a local contract check; production HTTP deployment, authentication changes and unrelated tool exposure require separate tasks. SDK source and invocation metadata were verified; this intake did not compile or execute the examples.
Use this when repeatable agent handoff and a recorded acceptance check are needed beyond ordinary SDK browsing. MCP is central to invocation. Pinned upstream client/server guide.