能力标签
MCP工具
🔌
MCP工具

MCP工具

基于 C# · 让 AI 助手直接操作你的系统与工具
英文名:dotnet-mcp
⭐ 26 Stars 🍴 1 Forks 💻 C# 📄 MIT 🏷 AI 7.5分
7.5AI 综合评分
mcpc#dotnet
✦ AI Skill Hub 推荐

MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

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

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

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

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

📋 工具概览

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

GitHub Stars
⭐ 26
开发语言
C#
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
7.5 分
工具类型
MCP工具
Forks
1

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

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/jongalloway/dotnet-mcp

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

# 配置文件位置
# 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 对话中直接使用
# 示例:
用户: 请帮我用 MCP工具 执行以下任务...
Claude: [自动调用 MCP工具 MCP 工具处理请求]

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

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

.NET MCP Server

Build and Test Coverage Dependabot NuGet Published to MCP Registry CodeQL Advanced

Give your AI assistant superpowers for .NET development! This MCP server connects GitHub Copilot, Claude, and other AI assistants directly to the .NET SDK, enabling them to create projects, manage packages, run builds, and more—all through natural language.

Get detailed info about the DbContext

dotnet ef dbcontext info ```

Database scaffolded successfully. Generated MyExistingDbContext.cs and 15 entity classes (Customer, Order, Product, etc.) in the Models folder.

Workload ID Description

maui-android .NET MAUI SDK for Android maui-ios .NET MAUI SDK for iOS maui-windows .NET MAUI SDK for Windows maui-tizen .NET MAUI SDK for Tizen


*Now I'll install the workloads you need:*
bash

List migrations to see what's pending

dotnet ef migrations list

Requirements

  • For Quick Install: .NET 10 SDK
  • For Manual Install: .NET 10 SDK
  • Visual Studio Code, Visual Studio 2022 (v17.13+), or Claude Desktop

Trust the certificate (may require elevation)

dotnet dev-certs https --trust


*Certificate is now trusted. Try running your app again. If you're using Docker, you can export the certificate:*
bash

Quick Install

Click to install in your preferred environment: VS Code - Install .NET MCP VS Code Insiders - Install .NET MCP Visual Studio - Install .NET MCP

Note: Quick install requires .NET 10 SDK.

Installation

Install dotnet-ef tool globally

dotnet tool install dotnet-ef --global

Clean and rebuild

dotnet clean dotnet build -c Release

HTTPS Development Setup

User: "I'm getting HTTPS certificate errors when running my web app"

AI: Let me check your HTTPS development certificate...

```bash

Export for Docker containers

dotnet dev-certs https --export-path ./certs/aspnetapp.pfx --password "SecurePassword123!" ```

Certificate exported to ./certs/aspnetapp.pfx. You can now mount it in your Docker container.

Mobile and MAUI Development Setup

User: "I want to develop a .NET MAUI app for Android and iOS"

AI: I'll help you set up the necessary workloads for MAUI development...

```bash

Install MAUI workloads for Android and iOS

List installed workloads

dotnet workload list


*Output:*
text

Installed Workload Id Manifest Version Installation Source

maui-android 10.0.100/10.0.100 SDK 10.0.100 maui-ios 10.0.100/10.0.100 SDK 10.0.100


*Now you can create a MAUI project:*
bash

Update all installed workloads

dotnet workload update ```

Building from Source

For development or contributing:

git clone https://github.com/jongalloway/dotnet-mcp.git
cd dotnet-mcp
dotnet build --project DotNetMcp/DotNetMcp.csproj

Run the server:

dotnet run --project DotNetMcp/DotNetMcp.csproj

The server communicates via stdio transport and is designed to be invoked by MCP clients.

Usage Examples

Once configured, you can use natural language with your AI assistant:

Quick Start - Single Project

User: "Create a new web API project called WeatherService"

AI: I'll create a new web API project for you...

dotnet new webapi -n WeatherService

The project has been created successfully in the WeatherService directory.

Option 2: Manual Configuration

Follow the instructions below for your specific development environment:

GitHub Copilot coding agent (Repository MCP configuration)

You can also configure this MCP server at the repository level for GitHub Copilot coding agent.

  1. Open your repo on GitHub
  2. Go to Settings > Copilot > Coding agent
  3. Paste the JSON below into the MCP configuration box
  4. Click Save

For details, see GitHub's documentation: Extending GitHub Copilot coding agent with the Model Context Protocol (MCP)

{
  "mcpServers": {
    "dotnet": {
      "type": "local",
      "command": "dnx",
      "args": ["Community.Mcp.DotNet@1.*", "--yes"],
      "tools": [
        "dotnet_project",
        "dotnet_package",
        "dotnet_solution",
        "dotnet_sdk",
        "dotnet_help",
        "dotnet_server_capabilities",
        "dotnet_server_info"
      ]
    }
  }
}

This configuration uses a curated allowlist of tools (instead of "*") so the agent can use the .NET MCP server safely and predictably.

Note: Copilot coding agent runs on GitHub Actions runners. If you need to ensure .NET 10 is installed for your repository, add a setup workflow like .github/workflows/copilot-setup-steps.yml.

Format all code according to .editorconfig

dotnet format

Secure Configuration with User Secrets

User: "Set up user secrets for my API project with a database connection string"

AI: I'll initialize user secrets for your project...

```bash

"Unrecognized option '--project'" or "Unknown switch" when running tests

- Cause: Test runner mismatch or SDK version incompatibility - Background: The --project flag is only supported by Microsoft Testing Platform (MTP). The legacy VSTest runner uses positional arguments instead. - Solution: The MCP server now auto-detects the test runner from global.json: 1. Auto mode (default): Add { "test": { "runner": "Microsoft.Testing.Platform" } } to global.json if using MTP, otherwise it defaults to VSTest 2. Explicit mode: Set testRunner: "MicrosoftTestingPlatform" or testRunner: "VSTest" when calling dotnet_project Test action 3. Legacy parameter: Use useLegacyProjectArgument: true (deprecated, use testRunner: "VSTest" instead) - Verify support: Run dotnet test --help | grep -- --project to check if your SDK supports the --project flag - More info: See doc/testing.md for detailed test runner compatibility and troubleshooting - References: dotnet test overview | MTP | VSTest

🧩 **MCP C# SDK Features Used**

dotnet-mcp uses the official MCP C# SDK and exercises a broad set of MCP features beyond basic tool invocation:

FeatureHow dotnet-mcp uses itWhy
[Resources](https://modelcontextprotocol.io/specification/latest/server/resources)Exposes dotnet://sdk-info, dotnet://runtime-info, dotnet://templates, dotnet://frameworks, and dotnet://workspace as read-only MCP resources.Lets clients answer environment and workspace topology questions quickly without shelling out, and reduces token churn from repeated CLI discovery.
[Prompts](https://modelcontextprotocol.io/specification/latest/server/prompts)Publishes reusable prompts such as create_new_webapi, add_package_and_restore, and run_tests_with_coverage.Gives MCP clients guided, discoverable workflows instead of rebuilding common prompt scaffolding from scratch.
[Roots](https://modelcontextprotocol.io/specification/latest/client/roots)Uses client workspace roots to auto-detect a single project or solution when the user omits an explicit path.Improves out-of-box behavior in IDE clients and reduces the number of parameters users need to supply.
[Sampling](https://modelcontextprotocol.io/specification/latest/client/sampling)Requests client-mediated LLM summaries for build and test failures when the client supports sampling.Keeps intelligent diagnostics inside the MCP flow without requiring separate server-side model credentials.
[Elicitation](https://modelcontextprotocol.io/specification/latest/client/elicitation)Requests explicit confirmation before destructive actions such as clean and solution removal.Adds a human-in-the-loop safety check for operations that delete artifacts or mutate project structure.
[Progress notifications](https://modelcontextprotocol.io/specification/latest/basic/utilities/progress)Reports start/completion progress for long-running restore, build, test, publish, pack, tool, and workload operations.Gives clients a better UX for slow operations and makes orchestration easier for agents that surface progress.
[Tasks](https://modelcontextprotocol.io/specification/latest/basic/utilities/tasks)Registers an IMcpTaskStore and marks dotnet_project with optional task support for long-running operations.Enables async execution, polling, and cancellation patterns instead of forcing every long-running request to block the session.
[Tools and tool metadata](https://modelcontextprotocol.io/specification/latest/server/tools)Uses consolidated tools with rich metadata such as titles, categories, priorities, action lists, and task support declarations.Improves discoverability, routing, and client-side presentation, especially in MCP-aware IDE integrations.
[Prompt and resource completion](https://modelcontextprotocol.io/specification/latest/server/utilities/completion)Implements a completion handler so clients can autocomplete prompt and resource argument values.Makes guided workflows faster and reduces invalid argument entry in clients that support completion UX.
[Icons and server metadata](https://csharp.sdk.modelcontextprotocol.io/)Configures server-level icons plus per-tool IconSource, title, and descriptive metadata across the consolidated surface.Helps clients present the server and tool catalog more clearly, especially in visual MCP management UIs.

Create minimal API

dotnet new webapi -n MyMicroservices.Api --use-minimal-apis

Add project references for tests

dotnet add MyMicroservices.Api.Tests/MyMicroservices.Api.Tests.csproj reference MyMicroservices.Api/MyMicroservices.Api.csproj ```

Solution created with 4 projects: AppHost for orchestration, Web app, API, and unit tests. Ready to run with dotnet run --project MyMicroservices.AppHost.

Add Azure OpenAI API key

dotnet user-secrets set "Azure:OpenAI:ApiKey" "sk-..."

Add SendGrid API key

dotnet user-secrets set "SendGrid:ApiKey" "SG...."


*Let me show you what's configured:*
bash

Warning: This will download several GB of SDKs and tools

dotnet workload install maui-android maui-ios


> **Note**: The command above shows the raw `dotnet` CLI syntax, which uses space-separated workload IDs. When calling the .NET MCP workload install tool, pass workload IDs as a single comma-separated parameter, for example: `workloadIds: "maui-android,maui-ios"`. The MCP server will translate this into the equivalent CLI command.

*Workloads installed! Let's verify:*
bash

Add Entity Framework packages

dotnet add package Microsoft.EntityFrameworkCore dotnet add package Microsoft.EntityFrameworkCore.SqlServer dotnet add package Microsoft.EntityFrameworkCore.Design

Add integration test packages

dotnet add MyMicroservices.IntegrationTests package Microsoft.AspNetCore.Mvc.Testing dotnet add MyMicroservices.IntegrationTests package Microsoft.Testing.Extensions.CodeCoverage

Modernization Workflow

User: "Update all packages to latest versions, format all code to match our editorconfig rules, then build and run tests"

AI: I'll update packages, format code, build, and test...

```bash

Update all packages to latest compatible versions

dotnet package update

Troubleshooting

🇨🇳 中文文档镜像 AI 翻译 2026-06-01
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

dotnet-mcp 是一个专为 .NET 开发者设计的 MCP (Model Context Protocol) Server。它通过将 .NET CLI 命令、Entity Framework Core 工具以及项目管理能力集成到 AI 助手中,让开发者能够通过自然语言直接驱动 .NET 开发工作流,实现从项目创建到数据库迁移的智能化操作。

⚡ 功能介绍

该项目集成了强大的 .NET 开发能力,支持通过 AI 执行复杂的命令行操作。功能涵盖了 Entity Framework Core 的模型查看与迁移管理、.NET Workload 的安装、代码格式化(dotnet format)以及微服务架构的快速搭建,旨在通过 AI 提升 .NET 开发的自动化程度。

📋 环境依赖

在使用 dotnet-mcp 之前,请确保您的开发环境已安装 .NET 10 SDK。对于快速安装,建议使用自动化工具;若需手动配置,则需要 Visual Studio Code、Visual Studio 2022 (v17.13+) 或 Claude Desktop 等支持 MCP 协议的客户端环境。

🛠 安装步骤(Docker/pip/源码)

项目提供两种安装方式:推荐使用 Quick Install 方式,通过页面顶部的安装徽章一键自动配置您的环境,服务端将首次运行时从 NuGet.org 下载;若需手动部署,可根据具体开发环境(如 Docker 或本地环境)进行配置,并确保已通过 `dotnet dev-certs https --trust` 信任必要的证书。

🚀 使用教程

配置完成后,您可以直接使用自然语言与 AI 助手交互。例如,您可以要求 AI "创建一个名为 WeatherService 的 web API 项目" 或 "更新所有包并运行测试",AI 将自动解析指令并调用相应的 dotnet 命令来执行项目创建、包管理及测试任务。

⚙️ 配置说明(含 MCP / env)

除了快速安装,您还可以进行手动配置。针对 GitHub Copilot coding agent,您可以在 GitHub 仓库的 Settings > Copilot > Coding agent 页面中,将提供的 JSON 配置粘贴到 MCP 配置框内,实现仓库级别的 MCP 能力扩展。

🔌 API 说明

dotnet-mcp 基于官方的 MCP C# SDK 构建,不仅实现了基础的 Tool 调用,还深度利用了 MCP 的高级特性,如 Resources(资源)功能,使其能够超越简单的命令执行,实现更深层次的上下文感知与数据交互。

🔄 工作流/模块

dotnet-mcp 支持完整的现代化开发工作流(Modernization Workflow)。从添加 Entity Framework 依赖、创建微服务模板、编写集成测试,到最后的代码格式化与自动化构建,AI 能够串联起整个开发生命周期,极大简化了复杂的工程化操作。

❓ FAQ 摘要

在安装或使用过程中,如果遇到证书信任问题,请确保执行了证书信任命令;若在 Docker 环境中使用,请记得导出相关证书。对于环境配置问题,请优先检查 .NET SDK 版本是否符合要求。

🎯 aiskill88 AI 点评 A 级 2026-05-31

高质量MCP工具,易于集成

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
部署方案
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
dotnet-mcp 中文教程dotnet-mcp 安装报错怎么办dotnet-mcp MCP 配置dotnet-mcp 与同类工具对比dotnet-mcp 最佳实践dotnet-mcp 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

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

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

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

dotnet-mcp 是一款C#开发的AI辅助工具。开源MCP工具:MCP wrapper for the .NET SDK。⭐26 · C# 主要应用场景包括:MCP开发和集成。
💡 AI Skill Hub 点评

经综合评估,MCP工具 在MCP工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

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

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

📚 深入学习 MCP工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 dotnet-mcp
原始描述 开源MCP工具:MCP wrapper for the .NET SDK。⭐26 · C#
Topics mcpc#dotnet
GitHub https://github.com/jongalloway/dotnet-mcp
License MIT
语言 C#
🔗 原始来源
🐙 GitHub 仓库  https://github.com/jongalloway/dotnet-mcp

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