csharp-mcp-server-generator

Generate a C# MCP server project with structured layout and dependency injection.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/74nu5/Narratum --skill csharp-mcp-server-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-mcp-server-generator
Source: https://github.com/74nu5/Narratum/tree/main/.github/skills/csharp-mcp-server-generator
Command: npx skills add https://github.com/74nu5/Narratum --skill csharp-mcp-server-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of a complete Model Context Protocol (MCP) server project in C#, including essential tools, logging, and error handling, streamlining development for MCP-based applications.

Core Features & Use Cases

  • Project Scaffolding: Generates a new C# console application with a robust directory structure.
  • Dependency Management: Includes necessary NuGet packages like ModelContextProtocol and Microsoft.Extensions.Hosting.
  • Configuration: Sets up logging to stderr and utilizes the Host builder pattern for dependency injection.
  • Tooling: Facilitates the creation of MCP tools with proper attributes and descriptions.
  • Use Case: Quickly bootstrap a new MCP server for a microservice that needs to communicate via the Model Context Protocol, ensuring all best practices are followed from the start.

Quick Start

Use the csharp-mcp-server-generator skill to create a new C# MCP server project.

Frequently Asked Questions about csharp-mcp-server-generator

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

FAQPage Schema
How do I generate a C# MCP server project with stdio transport?

To generate a C# MCP server project with stdio transport, use this skill to scaffold a complete console application with configured logging, dependency injection, and automatic tool discovery. The output includes a structured directory layout ready for development.

What is the Model Context Protocol server used for in C#?

The Model Context Protocol (MCP) server in C# is used to facilitate communication for microservices via the Model Context Protocol. This skill automates creating a production-ready server with async operations, parameter validation, and integrated Host builder pattern.

Can I use the Host builder pattern for dependency injection in an MCP server?

Yes, you can use the Host builder pattern for dependency injection in an MCP server. This skill sets up the C# project with Microsoft.Extensions.Hosting, ensuring proper dependency injection configuration and logging to stderr from the start.

How do I set up automatic tool discovery for an MCP server in dotnet?

You set up automatic tool discovery for an MCP server in dotnet by using McpServerToolType and McpServerTool attributes. This skill configures the generated C# project to automatically discover and register tools with proper descriptions.

Does the generated C# MCP server include NuGet packages for production?

Yes, the generated C# MCP server includes necessary NuGet packages like ModelContextProtocol and Microsoft.Extensions.Hosting for production. It supports async operations and parameter validation to ensure your microservice follows best practices immediately.

Why does my C# MCP server need logging to stderr?

Your C# MCP server needs logging to stderr because the stdio transport uses standard input and output for protocol communication. This skill configures logging to stderr specifically to avoid interfering with MCP message transmission.