MCP Csharp
atherio-danp/cde-dotnetcc
Create, debug, test, and publish MCP (Model Context Protocol) servers in C using the official ModelContextProtocol SDK — tools/prompts/resources, stdio vs HTTP transport, MapMcp hosting.
A skill your agent uses when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-servers --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .claude/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .claude/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-serversType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-servers --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .agents/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .agents/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-servers --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .cursor/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .cursor/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/SebastienDegodez/copilot-instructions.git --path skills/creating-dotnet-mcp-servers--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-servers --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .gemini/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .gemini/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-serversInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .github/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .github/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install SebastienDegodez/copilot-instructions creating-dotnet-mcp-servers --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/creating-dotnet-mcp-servers .opencode/skills/creating-dotnet-mcp-servers && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "creating-dotnet-mcp-servers" agent skill from https://github.com/SebastienDegodez/copilot-instructions/tree/main/skills/creating-dotnet-mcp-servers into .opencode/skills/creating-dotnet-mcp-servers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "creating-dotnet-mcp-servers", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
creating-dotnet-mcp-serversA skill your agent uses when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints
Creating Dotnet MCP Servers is an agent skill from SebastienDegodez/copilot-instructions. Use when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/advanced.md`, `references/error-handling.md` and `references/testing.md`).
It sits in Agent Workflows, covering MCP servers. It works with Model Context Protocol and .NET. The repository describes itself as: A comprehensive codebase of best practices, coding rules, and workflow automation for AI-assisted development with GitHub Copilot. Includes DDD, Clean Architecture, testing… The licence is Apache-2.0.
2 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 0f0dccf. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
dotnetFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
modelcontextprotocol.ionuget.orgFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Creating Dotnet MCP Servers loads about 1.3k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 47 tokens; SKILL.md has 272 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from SebastienDegodez/copilot-instructions at commit 0f0dccf, republished under its Apache-2.0 licence (© SebastienDegodez). 272 words, ~1,256 tokens.
.claude/skills/creating-dotnet-mcp-servers/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.Build production-ready Model Context Protocol (MCP) servers in .NET with AOT compatibility.
Core principle: MCP servers expose tools via standardized protocol using attribute-based registration and explicit JSON serialization contexts for AOT.
graph TD
A[Need to build server?] -->|Yes| B[Using .NET?]
B -->|Yes| C[MCP Protocol?]
C -->|Yes| D[✅ Use this skill]
C -->|No| E[❌ Use REST/gRPC guide]
B -->|No| F[❌ See Python/TS MCP docs]
A -->|No| G[❌ Skip]Use this skill when:
Not for: Non-.NET MCP, client-side integration, generic APIs
| Task | Implementation |
|---|---|
| Install packages | dotnet add package ModelContextProtocol + ModelContextProtocol.AspNetCore |
| Mark tool class | [McpServerToolType] |
| Mark tool method | [McpServerTool(Name = "ToolName"), Description("...")] |
| Parameter description | [Description("param description")] string param |
| Register server | services.AddMcpServer().WithHttpTransport().WithTools<T>() |
| Map endpoints | app.MapMcp() (exposes /sse) |
| AOT serialization | Create JsonSerializerContext with [JsonSerializable] |
| Test transport | Use SseClientTransport + McpClientFactory |
dotnet add package ModelContextProtocol --version 0.3.0-preview.1
dotnet add package ModelContextProtocol.AspNetCore --version 0.3.0-preview.1
# For testing (optional)
dotnet add package ModelContextProtocol.Client --version 0.3.0-preview.1Project configuration:
<PropertyGroup>
<PublishAot>true</PublishAot>
<JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>JSON serialization context:
[JsonSerializable(typeof(PackageMetadata))]
[JsonSerializable(typeof(IEnumerable<PackageMetadata>))]
public partial class McpJsonContext : JsonSerializerContext { }Register in Program.cs:
builder.Services.AddMcpServer()
.WithTools<PackageTools>(serializerOptions: McpJsonContext.Default.Options);Critical: Add ALL tool return types to [JsonSerializable] attributes.
Minimal example:
[McpServerToolType]
public sealed class PackageTools
{
public const string SearchPackages = "SearchPackages";
[McpServerTool(Name = SearchPackages)]
[Description("Search for NuGet packages by name or keyword")]
public async Task<IEnumerable<PackageMetadata>> SearchAsync(
[Description("The package name or search keyword")] string query,
[Description("Maximum number of results (default: 10)")] int limit = 10,
CancellationToken cancellationToken = default)
{
// Implementation
}
}Key patterns: Sealed classes, const tool names, [Description] on method and parameters, always accept CancellationToken.
SSE (HTTP):
builder.Logging.AddConsole(options => options.LogToStandardErrorThreshold = LogLevel.Trace);
builder.Services.AddMcpServer().WithHttpTransport().WithTools<PackageTools>(...);
app.MapMcp(); // Exposes /sseStdio (CLI):
builder.Services.AddMcpServer().WithStdioTransport().WithTools<PackageTools>(...);
// No MapMcp() needed📖 See references:
| Mistake | Fix |
|---|---|
Forgot [JsonSerializable] for return type | Add all tool return types to JsonSerializerContext |
| Not logging to stderr | Set LogToStandardErrorThreshold = LogLevel.Trace |
Missing CancellationToken | Always add CancellationToken parameter |
| Throwing exceptions in tools | Return ToolResult<T> with structured errors |
| Magic strings for tool names | Use const string in tool class |
No [Description] on parameters | Add [Description] to all parameters |
Forgetting MapMcp() | Required for HTTP/SSE transport |
© SebastienDegodez, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/creating-dotnet-mcp-servers of SebastienDegodez/copilot-instructions.
Open the folder on GitHubat commit 0f0dccf
Creating Dotnet MCP Servers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Creating Dotnet MCP Servers this skillSebastienDegodez/copilot-instructions | 198 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| MCP Csharpatherio-danp/cde-dotnetcc | 109 | — | ~1.2k | Automated safety check: Notes | None | |
| Csharp MCP Server GeneratorILoveDotNet/ilovedotnet | 155 | — | ~560 | Automated safety check: Pass | CC0-1.0 | |
| Dotnet MCP Builderboshi-xixixi/TraeSkill | 276 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Dotnet MCP Buildergithub/awesome-copilot | 40k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Microsoft Docsmicrosoft/ai-agents-for-beginners | 77k | — | ~1.5k | Automated safety check: Pass | MIT |
atherio-danp/cde-dotnetcc
Create, debug, test, and publish MCP (Model Context Protocol) servers in C using the official ModelContextProtocol SDK — tools/prompts/resources, stdio vs HTTP transport, MapMcp hosting.
ILoveDotNet/ilovedotnet
Generate a complete MCP server project in C with tools, prompts, and proper configuration
boshi-xixixi/TraeSkill
Build Model Context Protocol (MCP) servers in C/.NET against the current ModelContextProtocol 1.x NuGet packages.
github/awesome-copilot
Build Model Context Protocol (MCP) servers in C/.NET against the current ModelContextProtocol 2.x NuGet packages.
microsoft/ai-agents-for-beginners
Küsib ametlikku Microsofti dokumentatsiooni, et leida mõisteid, juhendeid ja koodinäiteid Azure'i, .NET-i, Agent Frameworki, Aspire'i, VS Code'i, GitHubi ja muu kohta.
intellectronica/agent-skills
This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java.
SebastienDegodez/copilot-instructions
A skill your agent uses when configuring Git hooks in .NET projects before team commits occur, to enforce commit message standards and code formatting automatically
SebastienDegodez/copilot-instructions
A skill your agent uses when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD…
SebastienDegodez/copilot-instructions
A skill your agent uses when writing tests from the outside-in, defining behavior before code, or any feature where tests should start from observable business behavior and let internal design emerge
SebastienDegodez/copilot-instructions
A skill your agent uses when creating OpenAPI mock examples for Microcks, setting up request/response routing with dispatchers, or mapping request fields to mock responses
SebastienDegodez/copilot-instructions
A skill your agent uses when understanding project composition by language, measuring code change impact, or generating code statistics for CI/CD metrics
SebastienDegodez/copilot-instructions
A skill your agent uses when listing all methods, functions, or classes in a file, exploring unfamiliar code, getting API overviews, or deciding what to read selectively without loading entire files
Works with
Categories
A skill your agent uses when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints. Creating Dotnet MCP Servers is an agent skill from SebastienDegodez/copilot-instructions.
Creating Dotnet MCP Servers fits situations like: building Model Context Protocol (MCP) servers in .NET; configuring tools; transports (SSE/stdio); JSON serialization for AOT.
Run `npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a claude-code`. Or copy the skill folder (skills/creating-dotnet-mcp-servers in SebastienDegodez/copilot-instructions) into .claude/skills/creating-dotnet-mcp-servers in your project. Claude Code loads it when a task matches its description.
Run `npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a codex`. Or copy the skill folder (skills/creating-dotnet-mcp-servers in SebastienDegodez/copilot-instructions) into .agents/skills/creating-dotnet-mcp-servers in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SebastienDegodez/copilot-instructions --skill creating-dotnet-mcp-servers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/creating-dotnet-mcp-servers, .gemini/skills/creating-dotnet-mcp-servers, .github/skills/creating-dotnet-mcp-servers and .opencode/skills/creating-dotnet-mcp-servers in your project.
Going by SKILL.md and its folder, Creating Dotnet MCP Servers needs the command-line tools its instructions call (dotnet).
SKILL.md names 2 domains. As links in the text: modelcontextprotocol.io and nuget.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Creating Dotnet MCP Servers is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.6k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Creating Dotnet MCP Servers: MCP Csharp (atherio-danp/cde-dotnetcc, 109 stars), Csharp MCP Server Generator (ILoveDotNet/ilovedotnet, 155 stars), Dotnet MCP Builder (boshi-xixixi/TraeSkill, 276 stars) and Dotnet MCP Builder (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
SebastienDegodez (a GitHub user) maintains it in SebastienDegodez/copilot-instructions, which has 198 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.
Source: SebastienDegodez/copilot-instructions on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.