aayushmdesai/mcp-dotnet-diagnostics

📊 Monitoring
0 Views
0 Installs

🏠 🍎 🐧 - Live .NET runtime diagnostics for AI assistants. Ask Claude to diagnose memory leaks, GC pressure, LOH fragmentation, and thread starvation in any running .NET process — no code changes required. Install: dotnet tool install -g mcp-dotnet-diagnostics

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "aayushmdesai-mcp-dotnet-diagnostics": {
      "command": "npx",
      "args": [
        "-y",
        "aayushmdesai-mcp-dotnet-diagnostics"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

CI mcp-dotnet-diagnostics MCP server

mcp-dotnet-diagnostics

Give your AI assistant real-time visibility into your .NET application's runtime health.

Connect this Model Context Protocol server to Claude Desktop and ask plain questions about any running .NET process — memory leaks, GC pressure, thread starvation, allocation hotspots. Claude calls the right tools, reads real runtime data, and tells you what's actually wrong.


What this looks like in practice

Health check demo

You ask:

"Why does my API have high memory usage? PID is 12345."

Claude calls get_process_info to confirm connectivity, then get_memory_stats, then get_gc_events — and responds:

"Every GC event in the last 5 seconds was a Gen2 collection triggered by AllocLarge. Something is continuously allocating objects above the 85KB LOH threshold at ~10.5 MB/s. LOH is never compacted by default — fragmentation is at 55% and growing. The fix is ArrayPool<byte>.Shared. Rent a buffer, use it, return it."

You don't tell Claude which tools to call. It figures that out from your question.


Tools

ToolWhat it returnsReach for it when...
get_process_infoName, PID, uptime, .NET version, OSStarting any investigation — confirms the process is reachable
get_memory_statsGC heap, LOH size, alloc rate, Gen0/1/2 counts, fragmentationMemory is high or growing
get_gc_eventsPer-collection timeline — generation, reason, timestampGC pauses are affecting latency
get_thread_statsThreadPool count, queue depth, completed items, lock contentionRequests are slow or backing up
get_event_countersAll 27 System.Runtime metrics in one snapshotYou want a broad health overview
get_environment_infoRuntime config, filtered env vars (no secrets)Debugging configuration issues
list_countersRaw EventCounter names and current valuesDiscovering what's available on an unfamiliar process

Installation

1. Install the tool

dotnet tool install -g mcp-dotnet-diagnostics

Requires .NET 8 SDK or later. Get it here if needed.

2. Add to Claude Desktop

Open ~/Library/Application Support/Claude/claude_desktop_config.json while Claude Desktop is fully quit (Cmd+Q — not just the window closed), then add:

{
  "mcpServers": {
    "dotnet-diagnostics": {
      "command": "mcp-dotnet-diagnostics",
      "env": {
        "TMPDIR": "/var/folders/xx/your-tmpdir/T/"
      }
    }
  }
}

3. Reopen Claude Desktop

The dotnet-diagnostics connector appears in the tools menu. Ask it about any .NET process.


macOS: the TMPDIR step is not optional.

The .NET diagnostics protocol finds processes through a Unix socket. On macOS, that socket lives under $TMPDIR — not /tmp/ where the library looks by default. Without this, every tool call returns "process not found."

Find yours with: echo $TMPDIR


Want to contribute or build from source? See CONTRIBUTING.md for how to clone, build, and add new tools.

Usage

Find the PID of your target process:

dotnet-counters ps

Then ask Claude naturally: "Do a full health check on PID 12345." "Why is memory climbing on PID 12345?" "Any thread starvation in PID 12345?" "What's the GC situation on PID 12345?"


How it works

The server uses Microsoft.Diagnostics.NETCore.Client to attach to any running .NET process by PID — the same library that powers dotnet-counters, dotnet-trace, and dotnet-dump. It streams telemetry directly from the CLR over EventPipe, which means you get the same data as the official .NET CLI tools, available to Claude as structured tool responses.

The tool descriptions are written to guide Claude's investigation sequence. When you report high memory, Claude calls get_process_info first (connectivity), then get_memory_stats (heap overview), then get_gc_events (collection details) — because the descriptions say to. The chaining is implicit, not hardcoded.


Requirements

  • .NET 8 SDK or later to build; .NET 10 recommended
  • Claude Desktop or any MCP-compatible client
  • A running .NET process to inspect (your app, an API, anything)

Tests

dotnet test src/McpDotnetDiagnostics.Tests

34 tests across all 7 tools — unit tests against invalid PIDs, integration tests against the live test runner process (Environment.ProcessId). Runs in ~17 seconds.


Design decisions

Three decisions shaped this project in ways that aren't obvious from the outside:


License

MIT

Related MCP Servers

adanb13/cirdan

🐍 🏠 🍎 🪟 🐧 - AI infrastructure cartographer & MCP server: fingerprints, graphs, and watches the live infrastructure an agent can reach (Docker, Kubernetes, cloud, IaC) and detects incidents.

📊 Monitoring0 views
agentkitai/agentlens

📇 🏠 ☁️ 🍎 🪟 🐧 - Tamper-evident observability for AI agents: a SHA-256 hash-chained audit log with chain verification and signed export (EU AI Act Art. 12). Instrument any agent with zero code via npx -y @agentlensai/mcp; also ingests OpenTelemetry GenAI traces.

📊 Monitoring0 views
alilxxey/openobserve-community-mcp

🐍 🏠 🍎 🪟 🐧 - Read-only MCP server for OpenObserve Community Edition via REST API. Search logs, traces, stream schemas, and dashboards without requiring the Enterprise license.

📊 Monitoring0 views
alimuratkuslu/byok-observability-mcp

📇 🏠 ☁️ 🍎 🪟 🐧 - Comprehensive MCP server for Grafana, Prometheus, Kafka UI, and Datadog with a secure "Bring Your Own Key" or BYOK model.

📊 Monitoring0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

Last checked: 7/28/2026, 5:30:23 AM

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.