본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)40k · #7179

dotnet-mcp-builder

하는 일

이 기능은 Model Context Protocol(MCP)을 사용해 통신하는 C#/.NET 프로그램(서버)을 만드는 데 도움을 줍니다. 프로토콜에 맞는 올바른 버전과 최신 설정을 사용하도록 보장합니다.

사용하는 경우

  • ✓새 .NET MCP 서버를 시작할 때.
  • ✓AI 모델이 실수하거나 오래된 설정을 사용할 때.
  • ✓MCP 서버에 새 기능을 추가할 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/dotnet-mcp-builder/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/dotnet-mcp-builder/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“명령줄 통신을 사용하는 기본 C# MCP 서버는 어떻게 만드나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

MCP 프로토콜 메시지를 이해하고 응답하도록 .NET 애플리케이션을 설정합니다. 기능을 간단한 C# 메서드로 정의하면, 통신은 시스템이 처리합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Building MCP servers in .NET

This skill helps you write production-quality MCP servers and basic clients in C#/.NET against the official ModelContextProtocol NuGet packages, maintained by Microsoft and the MCP project. It targets the stable 2.x line and the current spec (2026-07-28).

When this skill earns its keep

The .NET MCP SDK had years of preview packages (0.x-preview) before reaching 1.0, and v2 flipped several defaults. Without help, the model tends to:

  • Pin a stale preview version that won't compile against current samples.
  • Apply 1.x-era defaults that v2 reversed (HTTP was stateful by default; in 2.x Stateless defaults to true).
  • Recommend capabilities the 2026-07-28 spec deprecates (roots, sampling, MCP-channel logging — now [Obsolete], warning MCP9005).
  • Miss recent spec features (multi-round-trip input_required, discovery-first negotiation, MCP Apps/Tasks extension packages, elicitation URL mode, structured content blocks).
  • Get HTTP transport details wrong (stateful/stateless, proxy buffering, OAuth wiring).
  • Forget the STDIO stdout/stderr trap.

If the task is one of those, load the matching reference and follow it. If it's truly trivial (e.g. "rename this tool method"), you don't need to read everything — the cardinal rules below are the minimum.

Mental model in 30 seconds

A .NET MCP server is an ordinary Microsoft.Extensions.Hosting (or WebApplication) app that wires an MCP server through DI:

builder.Services
    .AddMcpServer()
    .WithStdioServerTransport()      // OR .WithHttpTransport(...)
    .WithToolsFromAssembly()         // discover [McpServerToolType] classes
    .WithPrompts<MyPrompts>()        // optional
    .WithResources<MyResources>();   // optional

Primitives are plain C# methods on classes marked with attributes ([McpServerToolType] + [McpServerTool], [McpServerPromptType] + [McpServerPrompt], [McpServerResourceType] + [McpServerResource]). Parameters bind from JSON-RPC; the SDK builds the JSON Schema from the signature plus [Description] attributes.

Server-to-client features (elicitation, progress notifications, and the now-deprecated sampling/roots/log notifications) are methods on the injected IMcpServer.

Decision tree → which references to load

Always load references/packages.md if you're creating a new project or unsure of the current package version.

Task Load
New STDIO server references/transport-stdio.md
New HTTP (Streamable) server references/transport-http.md
Add/modify a tool references/tool-primitive.md
Add/modify a prompt references/prompt-primitive.md
Add/modify a resource references/resource-primitive.md
Ask the user a question mid-tool references/elicitation.md
Call the client's LLM from a tool (deprecated in 2026-07-28) references/sampling.md
Read the user's project roots (deprecated in 2026-07-28) references/roots.md
Return an interactive UI references/mcp-apps.md
Argument completions, log/progress notifications, filters, server instructions references/server-features.md
Write a .NET program that consumes an MCP server references/client.md
MCP Inspector, in-memory tests, mocks, CI references/testing.md

For multi-primitive tasks, load several at once. For trivial edits in an existing file, you usually don't need any.

Cardinal rules (apply always; these prevent the highest-frequency breakages)

  1. Pin the current stable package, not a preview. Use ModelContextProtocol / ModelContextProtocol.AspNetCore / ModelContextProtocol.Core at the latest 2.x. If you find yourself writing 0.3-preview or 0.4-preview, stop and check NuGet — preview APIs have breaking differences. 1.x still works but predates the 2026-07-28 spec.
  2. STDIO servers must not write to stdout. Stdout is the JSON-RPC channel. Configure LogToStandardErrorThreshold = LogLevel.Trace before anything else and never Console.WriteLine from a tool.

…

자주 묻는 질문

MCP가 무엇인가요?

프로그램 간, 특히 AI 모델과 다른 애플리케이션 간의 통신 규칙 모음인 프로토콜입니다.

버전에 왜 신경 써야 하나요?

프로토콜의 버전마다 규칙이 다릅니다. 잘못된 버전을 쓰면 프로그램이 작동하지 않거나 예상과 다르게 동작할 수 있습니다.

이 맥락에서 '도구'는 무엇인가요?

MCP 프로그램이 수행할 수 있는 구체적인 작업이나 기능입니다. C# 코드의 메서드로 정의합니다.

상세 정보

작성자의 원본 설명

Build Model Context Protocol (MCP) servers in C#/.NET against the current ModelContextProtocol 2.x NuGet packages. Helps with cases the model gets wrong without guidance — stale versions (0.x preview or 1.x-era defaults), the v2 stateless-by-default HTTP flip, the 2026-07-28 spec deprecations (roots/sampling/logging), MCP Apps and Tasks extension packages, elicitation URL mode, per-session HTTP wi

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7179
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬