csharp-mcp-server-generator

Installation
Summary

Scaffold a production-ready C# MCP server with tools, logging, and proper configuration.

  • Generates a complete .NET 8.0+ console application with Host builder pattern, DI configuration, and stdio transport setup
  • Includes automatic tool discovery via WithToolsFromAssembly(), attribute-based tool definitions, and structured logging routed to stderr
  • Provides example tool implementations with parameter validation, async support, and McpProtocolException error handling
  • Covers project structure, NuGet dependencies, XML documentation, nullable reference types, and testing guidance with MCP client examples
SKILL.md

Generate C# MCP Server

Create a complete Model Context Protocol (MCP) server in C# with the following specifications:

Requirements

  1. Project Structure: Create a new C# console application with proper directory structure
  2. NuGet Packages: Include ModelContextProtocol (prerelease) and Microsoft.Extensions.Hosting
  3. Logging Configuration: Configure all logs to stderr to avoid interfering with stdio transport
  4. Server Setup: Use the Host builder pattern with proper DI configuration
  5. Tools: Create at least one useful tool with proper attributes and descriptions
  6. Error Handling: Include proper error handling and validation

Implementation Details

Basic Project Setup

  • Use .NET 8.0 or later
  • Create a console application
  • Add necessary NuGet packages with --prerelease flag
Related skills

More from github/awesome-copilot

Installs
8.4K
GitHub Stars
32.7K
First Seen
Feb 25, 2026