An enterprise-grade Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to MudBlazor component documentation, code examples, and API reference.
Disclaimer: This project is not affiliated with, endorsed by, or officially supported by the MudBlazor team. It is an independent implementation that extracts and serves documentation from the official MudBlazor repository.
- Overview
- Features
- Quick Start
- Documentation
- Available MCP Tools
- Project Structure
- Contributing
- License
Mud MCP bridges the gap between AI assistants and MudBlazor component documentation. It clones the official MudBlazor repository, parses source files using Roslyn, and exposes an indexed API via the Model Context Protocolβenabling AI agents like GitHub Copilot, Claude, and other MCP-compatible clients to provide accurate, context-aware assistance for Blazor development.
- Real-time Documentation: Always serves the latest documentation from MudBlazor's dev branch
- AI-Optimized Output: Formats responses in Markdown for optimal LLM consumption
- Production-Ready: Built with Aspire 13.1, health checks, and observability
- Flexible Deployment: Supports both HTTP and stdio transports
| Feature | Description |
|---|---|
| Component Discovery | List all ~85 MudBlazor components with category filtering |
| Detailed Documentation | Access parameters, events, methods, and inheritance info |
| Code Examples | Extract real examples from the MudBlazor documentation |
| Semantic Search | Search components by name, description, or parameters |
| API Reference | Full API reference for components and enum types |
| Related Components | Discover related components through inheritance and categories |
| Health Monitoring | Built-in health checks with detailed status reporting |
| Expert Agent | Pre-built agent file for optimal MCP tool usage with GitHub Copilot |
To maximize the value of the MCP server, this project includes a specialized GitHub Copilot agent file:
Location: .github/agents/mudblazor-expert.agent.md
The agent file teaches GitHub Copilot how to effectively use the MudBlazor MCP tools by providing:
- Decision Logic: Automatically selects the right MCP tool for each query
- Best Practices: Enforces "query before answering" to prevent hallucination
- Blazor Guidelines: Includes component architecture and rendering optimization patterns
- Tool Chaining: Combines multiple tools for comprehensive answers
Example workflow:
User: "How do I create a form with validation?"
Agent:
1. search_components("form input validation") β Find relevant components
2. get_component_detail("MudForm") β Get parameters and events
3. get_component_examples("MudTextField", filter="validation") β Get code examples
4. Provide complete, accurate answer with working code
Credits: This agent file is derived from work in the github/awesome-copilot repository.
dotnet builddotnet runThe server will:
- Clone the MudBlazor repository (~500MB)
- Build an in-memory index of all components
- Start the MCP server on
http://localhost:5180
curl http://localhost:5180/healthExpected response:
{
"status": "Healthy",
"totalDuration": 15.2,
"checks": [{
"name": "indexer",
"status": "Healthy",
"description": "Index contains 85 components in 12 categories."
}]
}VS Code (mcp.json):
{
"servers": {
"mudblazor": {
"url": "http://localhost:5180/mcp"
}
}
}For comprehensive documentation, see the docs folder:
| Document | Description |
|---|---|
| Overview | Architecture, design principles, and system overview |
| Getting Started | Installation, prerequisites, and first run |
| Architecture | Technical architecture and component design |
| Best Practices | Implemented patterns and practices |
| Tools Reference | Complete reference for all 12 MCP tools |
| Configuration | Configuration options and environment setup |
| Testing | Unit testing strategy and examples |
| MCP Inspector | Testing with MCP Inspector tool |
| IDE Integration | VS Code, Visual Studio, and Claude Desktop setup |
| Troubleshooting | Common issues and solutions |
| Changelog | Version history and release notes |
| Tool | Description |
|---|---|
list_components |
Lists all MudBlazor components with optional category filter |
list_categories |
Lists all component categories with descriptions |
get_component_detail |
Gets comprehensive details about a specific component |
get_component_parameters |
Gets all parameters for a component |
get_component_examples |
Gets code examples for a component |
get_example_by_name |
Gets a specific example by name |
list_component_examples |
Lists all example names for a component |
search_components |
Searches components by query |
get_components_by_category |
Gets all components in a specific category |
get_related_components |
Gets components related to a specific component |
get_api_reference |
Gets full API reference for a type |
get_enum_values |
Gets all values for a MudBlazor enum |
Example Interaction:
Ask your AI assistant:
- "List all MudBlazor button components"
- "Show me how to use MudTextField with validation"
- "What parameters does MudDataGrid support?"
- "What are the available Color enum values?"
MudBlazor.Mcp/
βββ .github/
β βββ agents/
β βββ mudblazor-expert.agent.md # GitHub Copilot agent file
βββ src/
β βββ MudBlazor.Mcp/ # Main MCP server
β β βββ Configuration/ # Strongly-typed options
β β βββ Models/ # Domain models (immutable records)
β β βββ Services/ # Core services
β β β βββ Parsing/ # Roslyn-based parsers
β β βββ Tools/ # MCP tool implementations
β βββ MudBlazor.Mcp.AppHost/ # Aspire orchestration
β βββ MudBlazor.Mcp.ServiceDefaults/ # Shared service configuration
βββ tests/
β βββ MudBlazor.Mcp.Tests/ # Unit tests
βββ docs/ # Documentation
βββ README.md
Contributions are welcome! Please see the Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU General Public License v2.0 (GPL-2.0) in compliance with MudBlazor's licensing.
- Source code is provided under GPL-2.0
- Original copyright notices are retained
- Modifications are documented
See the LICENSE file for full details.
- MudBlazor β The excellent Blazor component library
- Model Context Protocol β The protocol specification
- .NET Aspire β Cloud-native orchestration
- Roslyn β The .NET Compiler Platform
- github/awesome-copilot β Inspiration for the expert agent file
Built with β€οΈ for the Blazor community