🔌
MCP工具

.NET MCP桥接工具

基于 C# · 让 AI 助手直接操作你的系统与工具
英文名:MCP-Plugin-dotnet
⭐ 13 Stars 🍴 6 Forks 💻 C# 📄 Apache-2.0 🏷 AI 7.2分
7.2AI 综合评分
MCP协议.NET集成LLM工具HTTP桥接C#
✦ AI Skill Hub 推荐

AI Skill Hub 推荐使用:.NET MCP桥接工具 是一款优质的MCP工具。AI 综合评分 7.2 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。

📚 深度解析
.NET MCP桥接工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 .NET MCP桥接工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。.NET MCP桥接工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 .NET MCP桥接工具 评为 AI 评分 7.2 分,属于同类工具中的优质选择。
📋 工具概览

将.NET应用方法和数据暴露为MCP工具、提示词和资源的开源桥接方案。支持HTTP协议,帮助.NET开发者快速集成LLM功能,适合需要构建智能应用的C#开发团队。

.NET MCP桥接工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 13
开发语言
C#
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
Apache-2.0
AI 综合评分
7.2 分
工具类型
MCP工具
Forks
6
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

将.NET应用方法和数据暴露为MCP工具、提示词和资源的开源桥接方案。支持HTTP协议,帮助.NET开发者快速集成LLM功能,适合需要构建智能应用的C#开发团队。

.NET MCP桥接工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/IvanMurzak/MCP-Plugin-dotnet

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "-net-mcp----": {
      "command": "npx",
      "args": ["-y", "mcp-plugin-dotnet"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 .NET MCP桥接工具 执行以下任务...
Claude: [自动调用 .NET MCP桥接工具 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "_net_mcp____": {
      "command": "npx",
      "args": ["-y", "mcp-plugin-dotnet"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 52/100 含工作流图 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

Overview

MCP Plugin for .NET is a comprehensive solution for integrating .NET applications with the Model Context Protocol (MCP). It allows you to easily expose methods and data from your .NET applications as Tools, Prompts, and Resources to AI assistants (like Claude) and other MCP clients.

Features

  • Attribute-Based Registration: Easily expose tools, prompts, and resources using [McpPluginTool], [McpPluginPrompt], and [McpPluginResource] attributes.
  • Powered by ReflectorNet:
  • Complex Type Support: Seamlessly handle nested objects, collections, and custom types in tool parameters.
  • Fuzzy Matching: AI can find and call methods even with partial names or slightly mismatched signatures.
  • Automatic Schema Generation: Precise JSON schemas are generated for your C# types to help LLMs understand your code perfectly.
  • Real-time Bidirectional Communication: Uses SignalR for a persistent, low-latency link between your apps and the bridge.
  • Flexible Transport: The bridge supports both stdio (for local AI agents like Claude Desktop) and http (for remote connections).
  • Dependency Injection: First-class support for Microsoft.Extensions.DependencyInjection.
  • Assembly Scanning: Automatically discover and register components from your entire project.

Advanced Features

Getting Started

Docker Support

You can run the bridge server in a Docker container:

docker build -t mcp-bridge -f McpPlugin.Server/Dockerfile .
docker run -p 8080:8080 mcp-bridge port=8080 client-transport=http

Configuration Reference

MCP Plugin for .NET

NuGet netstandard2.1 Tests

Stars Discord License Stand With Ukraine

1. The Server (`McpPlugin.Server`)

The server acts as a hub. You can run the provided DemoWebApp or host it in your own ASP.NET Core application.

Running the Demo Server:

cd DemoWebApp
dotnet run port=11111 client-transport=stdio

Note: Use client-transport=stdio if connecting from Claude Desktop, or client-transport=http for HTTP-based clients.

Hosting in your own Web App:

// Program.cs
using com.IvanMurzak.McpPlugin.Common;
using com.IvanMurzak.McpPlugin.Common.Utils;
using com.IvanMurzak.McpPlugin.Server;

var builder = WebApplication.CreateBuilder(args);

// 1. Prepare arguments (or load from config)
var dataArguments = new DataArguments(args);

// 2. Register MCP Server services
builder.Services
    .WithMcpServer(dataArguments) // Configures transport based on dataArguments.ClientTransport
    .WithMcpPluginServer(dataArguments);

// 3. Configure Kestrel with separate IPv4/IPv6 bindings (avoids dual-stack issues on macOS)
builder.WebHost.UseKestrelForMcpPlugin(dataArguments.Port);

var app = builder.Build();

// 4. Use MCP Server middleware
app.UseMcpPluginServer(dataArguments);

app.Run();

2. The Client App (`McpPlugin`)

Add the com.IvanMurzak.McpPlugin package to your .NET application.

Defining Tools, Prompts, and Resources:

using com.IvanMurzak.McpPlugin;
using System.ComponentModel;

[McpPluginToolType]
public static class MyMcpComponents
{
    // --- Tools ---
    [McpPluginTool("calculate-sum", "Adds two numbers")]
    [Description("Adds two numbers")]
    public static int Add(int a, int b) => a + b;

    // --- Prompts ---
    [McpPluginPrompt("explain-code", "Explains a piece of code")]
    public static string ExplainCode(string code) => $"The following code: {code} does X, Y, and Z.";

    // --- Resources ---
    [McpPluginResource("system-logs", "Returns the latest system logs", "logs://system")]
    public static string GetLogs() => "Log entry 1: System started...";
}

Connecting to the Server:

using com.IvanMurzak.McpPlugin;
using com.IvanMurzak.ReflectorNet;

// 1. Initialize Reflector (The core engine)
var reflector = new Reflector();

// 2. Configure and build the plugin
var version = new com.IvanMurzak.McpPlugin.Common.Version
{
    Api = "1.0.0",
    Plugin = "1.0.0"
};
var plugin = new McpPluginBuilder(version)
    .WithConfig(config => {
        config.Host = "http://localhost:11111"; // Match your server port
    })
    // Option A: Scan assemblies for [McpPluginTool], [McpPluginPrompt], [McpPluginResource]
    .WithToolsFromAssembly(typeof(MyMcpComponents).Assembly)
    .WithPromptsFromAssembly(typeof(MyMcpComponents).Assembly)
    .WithResourcesFromAssembly(typeof(MyMcpComponents).Assembly)
    .Build(reflector);

// 3. Connect to the MCP server
await plugin.Connect();

Server (`McpPlugin.Server`)

Command-line arguments take priority over environment variables.

ArgumentEnv VarDescriptionDefault
portMCP_PLUGIN_PORTThe port the SignalR hub listens on.8080
client-transportMCP_PLUGIN_CLIENT_TRANSPORTTransport method: stdio or streamableHttp.streamableHttp
plugin-timeoutMCP_PLUGIN_CLIENT_TIMEOUTTimeout for plugin operations (ms).10000
idle-timeout-secondsMCP_PLUGIN_IDLE_TIMEOUT_SECONDSstreamableHttp only: idle window before an MCP session is evicted from the in-memory tracker. Longer values reduce reconnect 404s / session-migration rehydrates at the cost of higher in-memory footprint (bounded by MaxIdleSessionCount). The SDK's own default is 7200 (2 h).600
tokenMCP_PLUGIN_TOKENBearer token required from connecting plugins.*(none)*
authorizationMCP_AUTHORIZATIONAuthorization mode: none or required.none

Analytics Webhooks

McpPlugin.Server can emit fire-and-forget HTTP POST notifications to external endpoints for observability and analytics. Each event category has an independent URL, so you can route tool, prompt, resource, and connection events to different systems.

ArgumentEnv VarDescriptionDefault
webhook-tool-urlMCP_PLUGIN_WEBHOOK_TOOL_URLEndpoint to receive tool call events.*(none)*
webhook-prompt-urlMCP_PLUGIN_WEBHOOK_PROMPT_URLEndpoint to receive prompt retrieval events.*(none)*
webhook-resource-urlMCP_PLUGIN_WEBHOOK_RESOURCE_URLEndpoint to receive resource access events.*(none)*
webhook-connection-urlMCP_PLUGIN_WEBHOOK_CONNECTION_URLEndpoint to receive client connect/disconnect events.*(none)*
webhook-tokenMCP_PLUGIN_WEBHOOK_TOKENSecurity token sent in each webhook request header.*(none)*
webhook-headerMCP_PLUGIN_WEBHOOK_HEADERHeader name for the security token.X-Webhook-Token
webhook-timeoutMCP_PLUGIN_WEBHOOK_TIMEOUTHTTP delivery timeout in milliseconds.10000

Example — enable tool and connection analytics:

dotnet run \
  client-transport=stdio \
  webhook-tool-url=https://analytics.example.com/hooks/tools \
  webhook-connection-url=https://analytics.example.com/hooks/connections \
  webhook-token=my-secret-token

Event payload structure (all events follow this envelope):

{
  "schemaVersion": "1.0",
  "eventType": "tool.call.completed",
  "timestamp": "2026-03-01T12:34:56.789Z",
  "data": {
    "toolName": "add",
    "requestSizeBytes": 42,
    "responseSizeBytes": 18,
    "status": "success",
    "durationMs": 150
  }
}

Supported event types:

Event TypeTrigger
tool.call.completedEvery MCP tool call (success or failure)
prompt.retrievedEvery MCP prompt retrieval
resource.accessedEvery MCP resource access
connection.ai-agent.connectedAI agent (MCP client) connects
connection.ai-agent.disconnectedAI agent (MCP client) disconnects
connection.plugin.connectedMcpPlugin (.NET client) connects via SignalR
connection.plugin.disconnectedMcpPlugin (.NET client) disconnects

Notes:

  • Webhooks are fire-and-forget — delivery failures are logged but never block MCP responses.
  • If no webhook URLs are configured, the entire subsystem is inactive with zero overhead.
  • Use HTTPS endpoints in production to protect the security token in transit.

Authorization Webhooks

McpPlugin.Server can be configured with a synchronous authorization webhook that gates connections from both MCP clients (AI agents via HTTP) and McpPlugin clients (.NET apps via SignalR). Unlike the fire-and-forget analytics webhooks above, authorization webhooks block the connection until your endpoint responds.

ArgumentEnv VarDescriptionDefault
webhook-authorization-urlMCP_PLUGIN_WEBHOOK_AUTHORIZATION_URLEndpoint that authorizes/denies connections.*(none)*
webhook-authorization-fail-openMCP_PLUGIN_WEBHOOK_AUTHORIZATION_FAIL_OPENWhen true, allow connections if webhook times out or errors. When false, deny on failure.false

Example — enable connection authorization with fail-closed behavior:

dotnet run \
  client-transport=stdio \
  webhook-authorization-url=https://auth.example.com/authorize \
  webhook-token=my-secret-token \
  webhook-authorization-fail-open=false

Request format (POST from server to your webhook):

For AI agent connections (authorization.ai-agent):

{
  "schemaVersion": "1.0",
  "eventType": "authorization.ai-agent",
  "timestamp": "2025-03-04T22:45:30.1234567Z",
  "connectionId": "trace-id-or-connection-id",
  "clientType": "ai-agent",
  "bearerToken": "<token-from-client>",
  "remoteIpAddress": "192.168.1.100",
  "userAgent": "claude-ai/1.0",
  "requestPath": "/mcp",
  "clientName": null,
  "clientVersion": null,
  "hmacSignature": "sha256=abc123..."
}

For plugin connections (authorization.plugin):

{
  "schemaVersion": "1.0",
  "eventType": "authorization.plugin",
  "timestamp": "2025-03-04T22:45:30.1234567Z",
  "connectionId": "trace-id-or-connection-id",
  "clientType": "plugin",
  "bearerToken": "<token-from-plugin>",
  "remoteIpAddress": null,
  "userAgent": null,
  "requestPath": null,
  "clientName": "my-unity-plugin",
  "clientVersion": "1.2.0",
  "hmacSignature": "sha256=def456..."
}
Note: The hmacSignature field is only present when webhook-token is configured. It contains an HMAC-SHA256 signature of the request body (before the signature field is added), computed using the webhook token as the secret key.

Expected response format (from your webhook to server):

{ "allowed": true }

or

{ "allowed": false, "reason": "IP not in allowlist" }

Behavior:

  • 2xx response with allowed: true → Connection proceeds
  • 2xx response with allowed: false → Connection denied (reason logged as warning)
  • Non-2xx response, timeout, or parse error → Connection denied (unless fail-open=true)

Security:

  • The server sends the configured security token in the header named by webhook-header (default: X-Webhook-Token)
  • Your webhook must validate this token to prevent unauthorized authorization requests
  • Use HTTPS endpoints in production

Notes:

  • Authorization webhooks are synchronous — the server waits (default timeout 10 seconds) for your response
  • Keep webhook response times under 1 second for best performance
  • Authorization webhooks operate independently from the analytics webhooks above
  • If webhook-authorization-url is not configured, authorization is disabled (all connections allowed)

Plugin (`McpPlugin`)

Command-line arguments and environment variables are parsed automatically via ConnectionConfig.BuildFromArgsOrEnv(). They can also be overridden programmatically via McpPluginBuilder.WithConfig(...).

ArgumentEnv VarPropertyDescriptionDefault
mcp-server-endpointMCP_SERVER_ENDPOINTHostThe URL of the bridge server.http://localhost:8080
mcp-server-timeoutMCP_SERVER_TIMEOUTTimeoutMsOperation timeout (ms).10000
mcp-plugin-tokenMCP_PLUGIN_TOKENTokenBearer token sent to the server for authentication.*(none)*
mcp-skills-folderMCP_SKILLS_FOLDERSkillsPathPath for generated skill markdown files.SKILLS

Programmatic-only properties (set via WithConfig(...)):

PropertyDescriptionDefault
KeepConnectedAutomatically reconnect if the connection is lost.true
GenerateSkillFilesAuto-generate skill markdown files for each registered tool.true
🎯 aiskill88 AI 点评 B 级 2026-05-22

填补.NET与MCP生态的空白,设计思路清晰。但项目初期热度不足,需社区推动和文档完善才能成为主流方案。

⚡ 核心功能
👥 适合人群
Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师
🎯 使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
⚖️ 优点与不足
✅ 优点
  • +Apache-2.0 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。

🔗 相关工具推荐
❓ 常见问题 FAQ
MCP-Plugin-dotnet 是一款C#开发的AI辅助工具。开源MCP工具:.NET MCP bridge: expose app methods/data as MCP tools, prompts, and resources vi。⭐13 · C# 主要应用场景包括:将.NET应用接入Claude等LLM、.NET后端暴露为MCP服务、构建智能助手和Agent。
💡 AI Skill Hub 点评

总体来看,.NET MCP桥接工具 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ Apache-2.0 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 .NET MCP桥接工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 MCP-Plugin-dotnet
原始描述 开源MCP工具:.NET MCP bridge: expose app methods/data as MCP tools, prompts, and resources vi。⭐13 · C#
Topics MCP协议.NET集成LLM工具HTTP桥接C#
GitHub https://github.com/IvanMurzak/MCP-Plugin-dotnet
License Apache-2.0
语言 C#
🔗 原始来源
🐙 GitHub 仓库  https://github.com/IvanMurzak/MCP-Plugin-dotnet

收录时间:2026-05-21 · 更新时间:2026-05-22 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。