Get the FREE Ultimate OpenClaw Setup Guide →

MCP-Plugin-dotnet

.NET MCP bridge: expose app methods/data as MCP tools, prompts, and resources via an in-app plugin + lightweight server (SignalR; stdio/http).

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ivanmurzak-mcp-plugin-dotnet dotnet run -p DemoWebApp port=11111 client-transport=stdio

How to use

This MCP server represents a bridge for .NET applications to expose their functionality to MCP clients (such as Claude Desktop or MCP Inspector) via the MCP Protocol. It enables exposing Tools, Prompts, and Resources directly from a running .NET application using a SignalR-based bridge. The server acts as a gateway that maintains a persistent connection to MCP clients and can invoke in-app methods as Tools, provide descriptive Prompts, and surface runtime data as Resources. The design focuses on allowing complex .NET apps (Unity, WPF, game servers, etc.) to stay running independently while still participating in MCP workflows through the bridge. Clients connect over a single HTTP port (default 8080 in typical setups), but this server-centric instance can be configured to match your hosting port and transport method (stdio for local agents, http for remote clients).

Using the server involves running the DemoWebApp (or your own ASP.NET Core host) which hosts the MCP bridge. The client application then discovers and interacts with exposed components via attributes like [McpPluginTool], [McpPluginPrompt], and [McpPluginResource]. You configure the client to target the server (host and port), and the bridge handles registration, schema generation, and method invocation. Real-time bidirectional communication enables you to push logs and progress from your .NET app back to the MCP client, and to receive tool invocations from the client in your running application.

How to install

Prerequisites:

  • .NET 6+ SDK installed on your machine
  • Access to NuGet to install the MCP plugin package (com.IvanMurzak.McpPlugin)

Step-by-step installation:

  1. Install .NET SDK (if not already installed)

  2. Create or open your .NET project where you want to expose MCP components. This typically uses a Unity, WPF, or Console app where you’ve added the MCP plugin library.

  3. Install the MCP plugin package via NuGet:

    • Package: com.IvanMurzak.McpPlugin
    • Example (dotnet CLI): dotnet add package com.IvanMurzak.McpPlugin
  4. Implement exposure attributes in your code:

    • Use [McpPluginTool], [McpPluginPrompt], and [McpPluginResource] to annotate your methods that you want available to MCP clients.
    • Ensure your project references the McpPlugin.Server bridge if you plan to host the server side within your app.
  5. Run the bridge server (DemoWebApp) that hosts the MCP bridge. For example:

    • Navigate to the DemoWebApp directory and run: dotnet run port=11111 client-transport=stdio
  6. Connect an MCP client to the server using the configured host/port (e.g., http://localhost:11111) and begin invoking tools, prompts, and accessing resources exposed by your app.

Additional notes

Tips and common issues:

  • Ensure port and transport settings match between server and client. If using Claude Desktop or stdio-based clients, set client-transport=stdio.
  • The bridge uses SignalR; if you’re behind a firewall, ensure the HTTP port is open for inbound connections.
  • When upgrading the MCP plugin package, re-check any breaking changes in exposed attributes or server bootstrap code.
  • For Unity or other heavy apps, consider starting the MCP bridge once and keeping the application running; avoid spawning new processes to host the bridge repeatedly.
  • If the server cannot connect, verify that the server is actually listening on the expected port and that the host URL in the client config matches (e.g., http://localhost:11111).
  • You can customize tools/prompts/resources by extending assemblies scanned by the bridge; ensure your attributes are discoverable by the scanner.

Related MCP Servers

Sponsor this space

Reach thousands of developers