agentleFS
CripacxCripacx/agentic-dotnet/skills/csharp-mcp-server-generator/SKILL.md

csharp-mcp-server-generator

Skill1 starsChanged 9 months agoMITView on GitHub

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

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

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

    line 8
  2. Distinctive:

    Project Structure: Create a new C# console application with proper directory structure

    line 12
  3. Distinctive:

    Server Setup: Use the Host builder pattern with proper DI configuration

    line 15
  4. Distinctive:

    Tools: Create at least one useful tool with proper attributes and descriptions

    line 16
  5. Distinctive:

    Use .NET 8.0 or later

    line 22
  6. Distinctive:

    Create a console application

    line 23
  7. Very specific:

    Add necessary NuGet packages with --prerelease flag

    line 24
  8. Very specific:

    Use Host.CreateApplicationBuilder for DI and lifecycle management

    line 28
  9. Very specific:

    Use WithToolsFromAssembly() for automatic tool discovery

    line 30
  10. Very specific:

    Ensure the server runs with RunAsync()

    line 31
  11. Very specific:

    Use [McpServerToolType] attribute on tool classes

    line 34
  12. Very specific:

    Use [McpServerTool] attribute on tool methods

    line 35
  13. Very specific:

    Add [Description] attributes to tools and parameters

    line 36
  14. Distinctive:

    Follow C# naming conventions

    line 41
  15. Distinctive:

    Use nullable reference types

    line 43
  16. Distinctive:

    Use structured logging for debugging

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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
  • 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
  • Implement proper error handling with McpProtocolException
  • Use structured logging for debugging

Example Tool Types to Consider

  • File operations (read, write, search)
  • Data processing (transform, validate, analyze)
  • External API integrations (HTTP requests)
  • System operations (execute commands, check status)
  • Database operations (query, update)

Testing Guidance

  • Explain how to run the server
  • Provide example commands to test with MCP clients
  • Include troubleshooting tips

Generate a complete, production-ready MCP server with comprehensive documentation and error handling.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.