Back to MCP directory
publicPublicdnsLocal runtime

MSBuild

一个用于分析MSBuild项目的MCP服务演示

article

README

🚀 MSBuild MCP 演示

本项目是一个简单的演示,展示了如何借助模型上下文协议(Model Context Protocol)服务器(MCP)公开工具和提示,从而对任何MCP服务器上的MSBuild项目进行分析。

🚀 快速开始

配置步骤

  1. msbuild.mcp 目录下,使用 dotnet build 命令构建仓库。
  2. 配置 Claude 或者 VSCode,以便使用该服务器。
  3. 启动服务器应用程序,即可开始使用!

本地调试方法

若要进行本地调试,可使用 npx 运行模型上下文协议检查仪,命令如下:

npx @modelcontextprotocol/inspector ./bin/Debug/net9.0/msbuild.mcp

📚 详细文档

Claude 配置

在你的配置文件中添加以下内容:

{
  "mcpServers": {
    "msbuild": {
      "command": "<your repo root>\\msbuild.mcp\\bin\\Debug\\net9.0\\msbuild.mcp.exe"
    }
  }
}

VSCode 配置

已配置 Claude 的情况

若你已经完成了 Claude 的配置,可通过在 settings.json 文件中添加以下内容,让 VSCode 使用相同的设置:

  "chat.mcp.discovery.enabled": true,

未配置 Claude 的情况

若尚未配置 Claude,则可直接配置服务器,添加以下内容:

{
    "mcp": {
        "inputs": [],
        "servers": {
            "msbuild": {
                "command": "<repo root>\\msbuild.mcp\\bin\\Debug\\net9.0\\msbuild.mcp.exe",
                "args": [],
                "env": {}
            }
        }
    }
}
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client