MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 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
# 安装后在 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 生效
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.
dotnet ef dbcontext info ```
Database scaffolded successfully. Generated MyExistingDbContext.cs and 15 entity classes (Customer, Order, Product, etc.) in the Models folder.
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
dotnet ef migrations list
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
Click to install in your preferred environment:
Note: Quick install requires .NET 10 SDK.
Use the install badges at the top of this page to automatically configure the MCP server in your environment. The server will be downloaded from NuGet.org on first use.
dotnet tool install dotnet-ef --global
dotnet clean dotnet build -c Release
User: "I'm getting HTTPS certificate errors when running my web app"
AI: Let me check your HTTPS development certificate...
```bash
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.
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
dotnet workload list
*Output:*
text
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
dotnet workload update ```
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.
Once configured, you can use natural language with your AI assistant:
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.
Follow the instructions below for your specific development environment:
You can also configure this MCP server at the repository level for GitHub Copilot coding agent.
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.
dotnet format
User: "Set up user secrets for my API project with a database connection string"
AI: I'll initialize user secrets for your project...
```bash
- 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
dotnet-mcp uses the official MCP C# SDK and exercises a broad set of MCP features beyond basic tool invocation:
| Feature | How dotnet-mcp uses it | Why |
|---|---|---|
| [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. |
dotnet new webapi -n MyMicroservices.Api --use-minimal-apis
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.
dotnet user-secrets set "Azure:OpenAI:ApiKey" "sk-..."
dotnet user-secrets set "SendGrid:ApiKey" "SG...."
*Let me show you what's configured:*
bash
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
dotnet add package Microsoft.EntityFrameworkCore dotnet add package Microsoft.EntityFrameworkCore.SqlServer dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add MyMicroservices.IntegrationTests package Microsoft.AspNetCore.Mvc.Testing dotnet add MyMicroservices.IntegrationTests package Microsoft.Testing.Extensions.CodeCoverage
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
dotnet package update
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 协议的客户端环境。
项目提供两种安装方式:推荐使用 Quick Install 方式,通过页面顶部的安装徽章一键自动配置您的环境,服务端将首次运行时从 NuGet.org 下载;若需手动部署,可根据具体开发环境(如 Docker 或本地环境)进行配置,并确保已通过 `dotnet dev-certs https --trust` 信任必要的证书。
配置完成后,您可以直接使用自然语言与 AI 助手交互。例如,您可以要求 AI "创建一个名为 WeatherService 的 web API 项目" 或 "更新所有包并运行测试",AI 将自动解析指令并调用相应的 dotnet 命令来执行项目创建、包管理及测试任务。
除了快速安装,您还可以进行手动配置。针对 GitHub Copilot coding agent,您可以在 GitHub 仓库的 Settings > Copilot > Coding agent 页面中,将提供的 JSON 配置粘贴到 MCP 配置框内,实现仓库级别的 MCP 能力扩展。
dotnet-mcp 基于官方的 MCP C# SDK 构建,不仅实现了基础的 Tool 调用,还深度利用了 MCP 的高级特性,如 Resources(资源)功能,使其能够超越简单的命令执行,实现更深层次的上下文感知与数据交互。
dotnet-mcp 支持完整的现代化开发工作流(Modernization Workflow)。从添加 Entity Framework 依赖、创建微服务模板、编写集成测试,到最后的代码格式化与自动化构建,AI 能够串联起整个开发生命周期,极大简化了复杂的工程化操作。
在安装或使用过程中,如果遇到证书信任问题,请确保执行了证书信任命令;若在 Docker 环境中使用,请记得导出相关证书。对于环境配置问题,请优先检查 .NET SDK 版本是否符合要求。
高质量MCP工具,易于集成
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,MCP工具 在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# |
收录时间:2026-05-31 · 更新时间:2026-06-01 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端