AntDesign.Cli
AntDesign.Cli is a command-line interface tool for manipulating Ant Design components using C#. It allows developers to quickly set up projects and generate components directly from the command line. This enhances the efficiency of UI development and ensures a standardized design.
GitHub Stars
6
User Rating
Not Rated
Favorites
0
Views
24
Forks
1
Issues
0
AntDesign.Cli
A command-line tool and MCP (Model Context Protocol) server for querying Ant Design Blazor component information. It helps developers quickly access component documentation and API details directly from the command line or through GitHub Copilot.
For detailed implementation guide and technical discussion, check out our blog posts:
Features
- Search for specific component information
- List all available components
- Filter components by category
- Supports both CLI and MCP Server modes
- GitHub Copilot integration
Supported Tools
CLI Commands
list: List all componentssearch -n <ComponentName1,ComponentName2,...>: Batch search components by namecategory -n <CategoryName>: Filter components by categorydemo-list: List all component demosdemo -n <ComponentName>: View demos for a specific component
MCP Server Tools
SearchComponents: Batch search components by nameListComponents: List all componentsGetComponentsByCategory: Get components by categoryListAllDemos: List all component demosSearchComponentDemos: Get demos by component name and scenario
Installation
dotnet tool install --global AntDesign.Cli
Usage
CLI Mode
# List all components
antblazor list
# Search for a specific component
antblazor search -n Button
# Get components by category
antblazor category -n Navigation
MCP Server Mode (for GitHub Copilot)
- Install the tool globally
- Add the following configuration to your VS Code's
mcp.json:
{
"servers": {
"antblazor": {
"type": "stdio",
"command": "antblazor",
"args": ["-mcp"]
}
}
}
Or use the installation link:
vscode:mcp/install?{"name":"antblazor","command":"antblazor","args":["-mcp"]}
Implementation Details
This project demonstrates how to:
- Create a .NET Global Tool
- Implement MCP Server functionality
- Load and parse component documentation
- Provide a clean CLI interface
- Enable GitHub Copilot integration
Key technologies used:
- .NET 9.0
- System.CommandLine
- ModelContextProtocol
- System.Text.Json
Technical Details
Converting a .NET CLI Tool to an MCP Server
The process of converting a .NET CLI tool to an MCP server involves several steps:
- Add Required Packages
<ItemGroup>
<PackageReference Include="ModelContextProtocol" Version="0.1.0-preview.12" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
</ItemGroup>
- Create MCP Tool Classes
[McpServerToolType]
public sealed class AntDesignTools
{
[McpServerTool]
[Description("Search for an Ant Design Blazor component by name")]
public async Task<string> SearchComponent(
[Description("The name of the component to search for")] string name)
{
// Implementation
}
}
- Configure MCP Server
if (args.Length == 1 && args[0] == "-mcp")
{
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddMcpServer()
.WithStdioServerTransport()
.WithTools<AntDesignTools>();
await builder.Build().RunAsync();
return 0;
}
- Handle Both CLI and MCP Modes
- Maintain existing CLI functionality
- Add MCP server support
- Share core business logic
- Benefits
- Enhanced developer experience
- AI-powered assistance
- Seamless integration with GitHub Copilot
- Improved documentation accessibility
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
0
Followers
0
Repositories
0
Gists
0
Total Contributions
AICalendar is a calendar management tool developed in C#. It features the ability to monitor specific ports and forcefully terminate processes. It also includes commands for updating Entity Framework tools, facilitating easy integration with databases. Overall, it focuses on developer-oriented functionalities, but there is a lack of information regarding user interface and usability.
mogzi is a developer-oriented tool built with C# that streamlines code generation and editing. It features an intuitive interface and offers functionalities that facilitate a smooth development process. Notably, it includes robust auto-completion and error-checking features, making it suitable for both beginners and advanced users.