site/AntDesign.Docs.MCP/README.md
AntDesign.Docs.MCP is an MCP (Model Context Protocol) server that exposes tools for querying Ant Design Blazor component documentation and demo source code. It can run locally for development, be integrated into editors (VS Code / Visual Studio) via MCP, or be packaged as a NuGet/dotnet tool for distribution.
The MCP server is built as a self-contained application and does not require the .NET runtime to be installed on the target machine. However, since it is self-contained, it must be built for each target platform separately. By default, the template is configured to build for:
win-x64win-arm64osx-arm64linux-x64linux-arm64linux-musl-x64If your users require more platforms to be supported, update the list of runtime identifiers in the project's <RuntimeIdentifiers /> element.
See aka.ms/nuget/mcp/guide for the full guide.
Please note that this template is currently in an early preview stage. If you have feedback, please take a brief survey.
Note: packaging & publishing remains the same (use
dotnet packanddotnet nuget pushwhen you are ready).
Quick start (from repository root):
dotnet run --project site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj
# list components
dotnet run --project site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj -- component list
# list demos for Button
dotnet run --project site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj -- demo list Button
# print demo source
dotnet run --project site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj -- demo source Button:Icon
Pack & test locally:
dotnet pack -c Release -o nupkgs
# add the generated nupkgs to your workspace/local feed for dnx or tool install tests
Install as a dotnet tool (optional):
# local install from workspace feed
dotnet tool install -g AntDesign.Docs.MCP --add-source ./nupkgs --version 0.1.0
# run installed tool
antdesign-docs-mcp component list
VS Code example (.vscode/mcp.json) is included in this repository for convenience.
Prerequisites:
dnx based flows. For local development dotnet run works with .NET 8+.From source (development):
dotnet run --project site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj
Pack and test NuGet-based flow locally:
dotnet pack -c Release -o nupkgs
# In VS Code, update .vscode/mcp.json to point to your local nupkgs source (already provided in this repo)
# Or run using dnx (requires .NET 10 with dnx):
dnx [email protected] --add-source ${workspaceFolder}/nupkgs --yes
Install as a dotnet global tool (optional):
# global install from local feed
dotnet tool install -g AntDesign.Docs.MCP --add-source ${PWD}/nupkgs --version 0.1.0
# run it
dotnet tool run andesign-docs-mcp
VS Code configuration (example .vscode/mcp.json):
{
"servers": {
"AntDesign.Docs.MCP (local)": {
"type": "stdio",
"command": "dotnet",
"args": [ "run", "--project", "site/AntDesign.Docs.MCP/AntDesign.Docs.MCP.csproj" ]
},
"AntDesign.Docs.MCP (nuget/dnx)": {
"type": "stdio",
"command": "dnx",
"args": [ "[email protected]", "--add-source", "${workspaceFolder}/nupkgs", "--yes" ]
},
"AntDesign.Docs.MCP (dotnet tool)": {
"type": "stdio",
"command": "dotnet",
"args": [ "tool", "run", "antdesign-docs-mcp" ]
}
}
}
Notes:
dnx is only available in .NET 10+ SDKs; if you don't have .NET 10 installed, use the local dotnet run flow..mcp/server.json with accurate package metadata and inputs before publishing.CLI commands (local tool)
Cli/ (ComponentCommand.cs, DemoCommand.cs) and are independent from the MCP server runtime.Examples (after installing the tool or running via dotnet run):
antdesign-docs-mcp component listantdesign-docs-mcp component search Button,Inputantdesign-docs-mcp demo list Buttonantdesign-docs-mcp demo source Button:IconThe MCP server prefers to download the documentation metadata from the remote site by default. If the download fails (network issues, firewall, etc.), the server will fall back to reading pre-generated JSON files shipped inside the NuGet package (under the data/ path). You can generate these JSON files as part of your release pipeline using AntDesign.Docs.Build.CLI and include them in the package.
A sample GitHub Actions workflow .github/workflows/publish-mcp.yml is included that builds the project and attempts to run the build CLI to generate JSON files into site/AntDesign.Docs.MCP/data before packing and publishing the NuGet package.
.NET MCP servers use the ModelContextProtocol C# SDK. For more information about MCP: