← Prompts
Task / Create Copilot Instructions Collection

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

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

# 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

Sign in to view the full prompt.

Sign In

Classification

Task Immediate work request to complete
Task Create
Generate or transform
Scope Project
This codebase
Invoked Called by name -- slash commands, named tools