csharp-mcp-server-generator

Solid

Generate a complete MCP server project in C# with tools, prompts, and proper configuration

AI & Automation 34,233 stars 4188 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 - Configure logging to stderr ### Server Configuration - Use `Host.CreateApplicationBuilder` for DI and lifecycle management - Configure `AddMcpServer()` with stdio transport - Use `WithToolsFromAssembly()` for automatic tool discovery - Ensure the server runs with `RunAsync()` ### Tool Implementation - Use `[McpServerToolType]` attribute on tool classes - Use `[McpServerTool]` attribute on tool methods - Add `[Description]` attributes to tools and parameters - Support async operations where appropriate - Include proper parameter validation ### Code Quality - Follow C# naming conventions - Include XML documentation comments - Use nullable reference types - Implem...

Details

Author
github
Repository
github/awesome-copilot
Created
11 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category