Skip to content

Guide · Agent skill

How to use the Build .NET MCP Servers agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The dotnet-mcp-builder skill is an agent skill that teaches an AI agent how to build Model Context Protocol (MCP) servers and basic clients in C# and .NET using Microsoft's official ModelContextProtocol NuGet packages, targeting the stable 2.x line. It is for .NET developers who want an agent to scaffold a correct STDIO or Streamable HTTP MCP server, or to migrate older preview code. After this guide you will know how to install the skill, trigger it with a normal request, and check the output before you rely on it.

Build .NET MCP Serversgithub/awesome-copilot · MIT

Quick start

  1. 1Download the ZIP. Download the dotnet-mcp-builder ZIP from this page and unzip it so the folder contains SKILL.md and references/.
  2. 2Place the skill folder. Move the unzipped folder into ~/.claude/skills/ for personal use, or into your project's .claude/skills/ folder for one project.
  3. 3Or upload in the Claude apps. If you prefer the apps, open Settings → Capabilities → Skills and upload the skill there.
  4. 4Confirm your setup. Make sure the .NET SDK is installed and that you plan to use ModelContextProtocol 2.x packages.
  5. 5Make a natural request. Describe your MCP task in C# terms, naming the transport and primitives you want.
  6. 6Build and test. Ask the agent to run dotnet build, then test the server with the MCP Inspector or in-memory tests described in the testing reference.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and reference notes that an AI agent loads when a task matches the skill's description. This skill's main file, SKILL.md, tells the agent how to build a .NET MCP server and points it to detailed reference files for each part of the job: transports, tools, prompts, resources, elicitation, testing and a basic .NET client.

The skill exists because the model often gets .NET MCP work wrong without guidance. The source names several common problems: pinning stale 0.x preview versions, applying 1.x-era defaults that v2 reversed (such as HTTP being stateful by default), recommending capabilities the 2026-07-28 spec deprecates, and getting HTTP transport or STDIO details wrong. The skill steers the agent away from these.

  • Scaffolds STDIO and Streamable HTTP servers that use the ModelContextProtocol 2.x packages.
  • Adds tools, prompts and resources with the correct attributes and registration lines.
  • Warns about the STDIO stdout trap, where anything written to stdout breaks the JSON-RPC channel.
  • Helps debug common errors such as HTTP 404 path mismatches and tools that do not appear.

Install the skill from the ZIP

Download the ZIP for this skill from this page and unzip it. The skill folder contains SKILL.md and a references folder with 13 Markdown files. Then place the folder in one of two locations, depending on how you want to use it.

For a personal setup available across your projects, put it in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder so it applies only there.

If you use the Claude apps instead, you can upload the skill under Settings → Capabilities → Skills rather than copying files.

  • Personal: unzip into ~/.claude/skills/
  • Per project: unzip into the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload

Check your requirements

The skill needs the .NET SDK and the ModelContextProtocol NuGet packages at version 2.x. The skill's own metadata says it runs no scripts and uses no network access. The agent writes code and runs dotnet build in your project, so you still need the .NET SDK installed locally.

The skill defaults to .NET 10 for new projects. If you are on another SDK, tell the agent before it scaffolds anything.

  • .NET SDK installed on your machine
  • ModelContextProtocol packages at 2.x (the skill directs the agent to the latest 2.x, not a preview)
  • Optional: the MCP Inspector and in-memory tests, covered in the testing reference

How to trigger the skill with a natural request

You do not need a special command. Describe the .NET MCP work in ordinary words. The skill is triggered by requests that mention MCP in a C# or .NET context, such as the names of library items (ModelContextProtocol, McpServerTool, MapMcp, WithStdioServerTransport), phrases like "MCP server in C#" or "expose this as MCP", or a primitive name like prompt, resource, elicitation or MCP App.

If the agent works in another language, the skill does not apply. The source says it skips MCP work in TypeScript, Python and other languages.

  • "Build an MCP server in C# that exposes my invoice lookup as a tool."
  • "Add a prompt and a resource to my existing .NET MCP server."
  • "My MapMcp endpoint returns 404, help me fix it."
  • "Migrate this ModelContextProtocol 0.4-preview code to the stable 2.x packages."

Example: scaffold a basic STDIO server

A typical request is a new STDIO server with one tool. The skill guides the agent to register the server with a Microsoft.Extensions.Hosting app and discover tools from the assembly. The registration pattern from the skill looks like this:

  • Ask for the transport, .NET version and primitives if you have not stated them, since the skill asks you to confirm these first.
  • Expect the agent to add [McpServerToolType] and [McpServerTool] attributes and a [Description] on each tool and parameter.
  • Expect a dotnet build run to catch missing usings and attribute typos.
builder.Services .AddMcpServer() .WithStdioServerTransport() .WithToolsFromAssembly();

Safety notes: scripts and network

The skill metadata states that it runs no scripts and uses no network. It only supplies instructions and reference notes. The code the agent writes, however, is yours to run, and the source says generated code and deployment advice should be checked against current NuGet and spec documentation before production use.

Be careful with secrets. A STDIO client example in the reference passes environment variables such as an API key to the launched server, so keep real keys out of source files and out of prompts you share.

  • Review every generated file before running it, especially any code that touches credentials or files.
  • Verify package versions on NuGet yourself rather than trusting a number from the agent.
  • Treat OAuth and reverse-proxy deployment advice as a starting point to check, not a finished production setup.

Tips for better results

Give the agent the details it needs up front: transport, .NET version, and which primitives you want. Keep changes small. The skill asks the agent to add to existing classes rather than restructure your project, which makes review easier.

If you are migrating old code, say so and paste the current package reference. Most failures in this area come from preview APIs or from stdout being written by a logger or Console.WriteLine.

  • Name the transport: STDIO for local tools launched by a client, Streamable HTTP for a networked server.
  • Note SSE is deprecated in the skill, so ask for Streamable HTTP unless you must support an old client.
  • If a tool is missing from the client, check it has the [McpServerToolType] class attribute and that the tools are registered.
  • If HTTP returns 404, check whether the server maps MCP at the root or at a path such as /mcp.

What people use it for

  • Scaffolding a new STDIO MCP server that exposes a function from an existing C# app as a tool.
  • Adding a prompt or resource to a .NET MCP server that already runs.
  • Migrating older ModelContextProtocol preview code to the stable 2.x packages.
  • Debugging a Streamable HTTP server that returns 404 or fails to show its tools.
  • Writing a basic .NET client that launches a local MCP server to test it.

Frequently asked questions

How do I install the dotnet-mcp-builder skill?

Download the ZIP from this page and unzip it. Put the folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder for one project. You can also upload it in the Claude apps under Settings → Capabilities → Skills.

What do I need to use this skill?

You need the .NET SDK and the ModelContextProtocol NuGet packages at version 2.x. The skill is documented as running no scripts and using no network access, but the code it writes must still be built and reviewed on your machine.

Is the dotnet-mcp-builder skill free?

The skill is published under the MIT licence on the github/awesome-copilot repository. The source does not state any price, so check the licence file in the repository for the terms.

Does this skill work for TypeScript or Python MCP servers?

No. The skill explicitly skips MCP work in other languages such as TypeScript or Python. For those, use a skill or guide written for that language.

Why does my STDIO MCP server break when I add logging?

STDIO servers use stdout as the JSON-RPC channel, so anything else written there corrupts the messages. The skill advises setting LogToStandardErrorThreshold to LogLevel.Trace and never calling Console.WriteLine from a tool.

Why does my MapMcp endpoint return 404?

The path may not match. app.MapMcp() serves at the root, while app.MapMcp("/mcp") serves under /mcp. Check the path your client is calling against the path you mapped.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits .NET developers who want an agent to add or fix an MCP server or tool in C#, and teams moving off preview SDK code to the stable 2.x packages. It is not suited to MCP work in other languages, or to production deployments that skip review, since the source asks you to check generated code and deployment advice against current NuGet and spec documentation.

Download the skill