csharp-mcp-server-generator

Generates a .NET 8+ C# console app with MCP server stdio transport and automatic tool discovery.

1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/afonsoft/VideoChat --skill csharp-mcp-server-generator-afonsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: csharp-mcp-server-generator
Source: https://github.com/afonsoft/VideoChat/tree/main/.agents/skills/csharp-mcp-server-generator
Command: npx skills add https://github.com/afonsoft/VideoChat --skill csharp-mcp-server-generator-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates a complete MCP server project in C# with tooling, prompts, and proper configuration to accelerate server development.

Core Features & Use Cases

  • Produces a ready-to-run console app using .NET 8+ with Host.CreateApplicationBuilder
  • Includes MCP server setup with AddMcpServer() and stdio transport, automatic tool discovery, and structured logging
  • Provides extensible tool framework via McpServerToolType and McpServerTool attributes for reusable tasks

Quick Start

Run the generator to produce a production-ready MCP server skeleton in C# with DI, logging, and tool support.

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 an MCP server in C# using .NET 8?

Generating an MCP server in C# produces a .NET 8 console application using Host.CreateApplicationBuilder and AddMcpServer with stdio transport. It includes automatic tool discovery, structured logging, and extensible tool attributes for immediate execution.

What is the best way to set up stdio transport for a C# MCP server?

Setting up stdio transport for a C# MCP server involves using AddMcpServer with Host.CreateApplicationBuilder in .NET 8. This configuration provides robust error handling, structured logging, and automatic tool discovery from the assembly.

How does automatic tool discovery work in a .NET MCP server?

Automatic tool discovery in a .NET MCP server scans the assembly for McpServerTool and McpServerToolType attributes. This enables modular MCP operations by automatically registering annotated classes and methods as available tools.

Can I use dependency injection with a C# MCP server project?

Yes, a C# MCP server project supports dependency injection through Host.CreateApplicationBuilder. This provides a production-ready foundation with DI, structured logging, and an extensible tool framework for reusable tasks.

Do I need .NET 8 to run an MCP server generated in C#?

Yes, .NET 8 or later is required because the generated MCP server targets .NET 8 as a console application. It relies on Host.CreateApplicationBuilder and modern .NET hosting features for proper configuration.

Why use McpServerTool attributes for MCP server development in C#?

Using McpServerTool attributes provides an extensible tool framework that enables automatic discovery from the assembly. This allows modular MCP operations and reusable tasks without manual registration, accelerating server development.