mcp-csharp-create

Create MCP servers in C# using the ModelContextProtocol SDK and dotnet project templates.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill mcp-csharp-create-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-csharp-create
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/mcp-csharp-create
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill mcp-csharp-create-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a Model Context Protocol server from scratch requires knowing the C# SDK's attribute model, transport options, and hosting setup. This Skill guides you through scaffolding, implementing tools/prompts/resources, and configuring stdio or HTTP transport so your server works correctly the first time. ## Core Features & Use Cases - Project Scaffolding: Create new MCP server projects with dotnet new mcpserver or dotnet new web, choosing between stdio and HTTP transports. - Tool, Prompt, and Resource Implementation: Apply [McpServerTool], [McpServerPrompt], and [McpServerResource] attributes with proper descriptions and DI injection patterns. - Transport Configuration: Set up stdio hosting with stderr-only logging or ASP.NET Core HTTP hosting with MapMcp(), auth, and stateless options. - Use Case: You want to wrap an internal weather API as MCP tools for GitHub Copilot. This Skill walks you through scaffolding a stdio server, adding attributed tool methods with HttpClient injection, and verifying it runs. ## Quick Start Ask the AI to create a new C# MCP server project named WeatherMcpServer using the stdio transport with one sample tool.

Frequently Asked Questions about mcp-csharp-create

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an MCP server in C#?

Install the template with dotnet new install Microsoft.McpServer.ProjectTemplates, then run dotnet new mcpserver -n YourProject. Add tool classes with [McpServerToolType] and methods with [McpServerTool], then configure the server in Program.cs with AddMcpServer() and a transport.

Should I use stdio or HTTP transport for my MCP server?

Use stdio for local CLI tools, IDE plugins, and single-user subprocess scenarios like VS Code integration. Use HTTP for cloud deployment, multiple simultaneous clients, or containerized environments. Stdio is the recommended default for local development.

What .NET version is required for the C# MCP SDK?

The C# MCP server templates require .NET 10.0 SDK or later. Check your installed version with dotnet --version and install the latest SDK from dotnet.microsoft.com if needed.

Why is my MCP tool not discovered by LLM clients?

Tool discovery fails when the class lacks [McpServerToolType], the method lacks [McpServerTool], or Program.cs is missing .WithToolsFromAssembly(). Note that assembly scanning uses reflection and is incompatible with Native AOT, where you must use .WithTools<T>() instead.

Why does my stdio MCP server output garbage or hang?

Stdio servers reserve stdout for JSON-RPC messages, so any logging to stdout corrupts the protocol. Fix this by setting LogToStandardErrorThreshold = LogLevel.Trace in the console logging configuration so all logs go to stderr.

When should I not use this MCP server creation skill?

Do not use it for debugging existing servers (use mcp-csharp-debug), writing tests (use mcp-csharp-test), publishing to NuGet or Azure (use mcp-csharp-publish), or building MCP clients. It covers server-side creation only.