dotnet-mcp-server

dotnet-mcp-server is a skill for Claude Code, Codex from Arasz/ai-raccoon. It costs 106 tokens per session (4,935 once invoked), scanned A, original, MIT.

A guide to building MCP servers and tools in .NET. MCP, or Model Context Protocol, is a way for an AI application to discover and call tools provided by another program.

In plain words
What is it for?
Use it to create C# MCP tools and servers with the .NET SDK, including standard-input/output or HTTP hosting, typed HTTP clients, dependency injection, and mock-based tests.
Why use it?
It removes uncertainty around registering tools, hosting them over standard connections, calling REST APIs, wiring dependencies, and testing the tool inventory.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create C# MCP tools and servers with the .NET SDK, including standard-input/output or HTTP hosting, typed HTTP clients, dependency injection, and mock-based tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arasz/ai-raccoon/dotnet-mcp-server
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Arasz/ai-raccoon --skill dotnet-mcp-server
Clone the repo
git clone --depth 1 https://github.com/Arasz/ai-raccoon

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dotnet-mcp-server

README.md
[![agentmods](https://agentmods.dev/badge/skills/arasz/ai-raccoon/dotnet-mcp-server/github.svg)](https://agentmods.dev/skills/arasz/ai-raccoon/dotnet-mcp-server)
Your own site
<a href="https://agentmods.dev/skills/arasz/ai-raccoon/dotnet-mcp-server"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/dotnet-mcp-server/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dotnet-mcp-server

Your own site · 80×15
<a href="https://agentmods.dev/skills/arasz/ai-raccoon/dotnet-mcp-server"><img src="https://agentmods.dev/badge/skills/arasz/ai-raccoon/dotnet-mcp-server.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,935 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00106 $0.04935
Opus 5.5 $0.00042 $0.01974
Sonnet 5.5 $0.00021 $0.00987
Haiku 4.5 $0.00011 $0.00494

Measured yesterday against content hash 8a9a60128825, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dotnet-mcp-server scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/mcp-stdio-probe.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.ai-badger/skills/dotnet-mcp-server/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

dotnet-mcp-server

Implement MCP servers in .NET using the ModelContextProtocol NuGet package (SDK v1.4+).

Prerequisites

  • .NET 10+ (the SDK targets net10.0 but works on net8.0+)
  • NuGet packages: ModelContextProtocol, Microsoft.Extensions.Hosting
  • For HTTP-calling tools: Microsoft.Extensions.Http

1. Project setup

<!-- .csproj -->
<PropertyGroup>
    <OutputType>Exe</OutputType>
    <PackAsTool>true</PackAsTool>
    <PackageType>McpServer</PackageType>
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Hosting" />
    <PackageReference Include="Microsoft.Extensions.Http" />   <!-- for REST-calling tools -->
    <PackageReference Include="ModelContextProtocol" />
</ItemGroup>

<!-- Let tests access internal tool classes -->
<ItemGroup>
    <InternalsVisibleTo Include="YourProject.Mcp.Tests" />
</ItemGroup>

2. Tool class pattern

Tools are plain C# classes annotated with [McpServerTool] and [Description]. The MCP SDK discovers them via DI.

using System.ComponentModel;
using System.Net.Http.Json;
using System.Text.Json;
using ModelContextProtocol.Server;

namespace YourProject.Mcp.Tools;

internal sealed class MyTools(HttpClient httpClient)
{
    private static readonly JsonSerializerOptions JsonOptions = new()
    {
        PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
        WriteIndented = true
    };

    [McpServerTool]
    [Description("Does something useful with the given input.")]
    public async Task<string> DoSomething(
        [Description("The resource ID.")] string resourceId,
        [Description("Amount value.")] decimal amount,
        [Description("Optional period.")] string period = "Monthly")
    {
        var request = new { Amount = amount, Period = period };
        var response = await httpClient.PostAsJsonAsync(
            $"/api/resources/{resourceId}/action", request, JsonOptions);
        response.EnsureSuccessStatusCode();
        return await response.Content.ReadAsStringAsync();
    }
}

Read the full file on GitHub · 277 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 277 lines · 106 tokens per session scan A 8a9a60128825

Subscribe to this mod's changes

dotnet-mcp-server is a skill published in the GitHub repository Arasz/ai-raccoon (7 stars, last pushed today), licensed MIT. It adds 106 tokens to every session and 4,935 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-05.

Related

dotnet-mcp-server compared with skills from other repositories

dotnet-mcp-server next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dotnet-mcp-serverArasz/ai-raccoonSkill7todayMITA106Claude Code, Codex
http-client-migrationGen-Verse/PAST-BenchSkill404mo agoApache-2.0A14Claude Code, Codex
azure-eventgrid-dotnetrootcastleco/rei-skillsSkill115d agononeA80Claude Code, Codex
Cursor rules for Aspnet AbpAmariahAK/atlarix-skillsSkill02mo agoApache-2.0A7Claude Code, Codex
C# PatternsAmariahAK/atlarix-skillsSkill02mo agoApache-2.0A3Claude Code, Codex
.NET PatternsAmariahAK/atlarix-skillsSkill02mo agoApache-2.0A2Claude Code, Codex
agui-dotnet-streaming-chatag-ui-protocol/ag-uiSkill23kyesterdayMITA223Claude Code