Skip to content
/ MudMCP Public

MCP server that provides AI assistants with comprehensive access to MudBlazor component documentation, code examples, and API reference. Not affiliated with MudBlazor team.

License

Notifications You must be signed in to change notification settings

mcbodge/MudMCP

Repository files navigation

Mud MCP

An enterprise-grade Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to MudBlazor component documentation, code examples, and API reference.

.NET 10 MCP Protocol License: GPL-2.0

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.


πŸ“– Table of Contents


Overview

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.

Key Value Propositions

  • 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

Features

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

MudBlazor Expert Agent

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.


Quick Start

Prerequisites

1. Clone and Build

dotnet build

2. Run the Server

dotnet run

The server will:

  1. Clone the MudBlazor repository (~500MB)
  2. Build an in-memory index of all components
  3. Start the MCP server on http://localhost:5180

3. Verify

curl http://localhost:5180/health

Expected response:

{
  "status": "Healthy",
  "totalDuration": 15.2,
  "checks": [{
    "name": "indexer",
    "status": "Healthy",
    "description": "Index contains 85 components in 12 categories."
  }]
}

4. Connect Your AI Assistant

VS Code (mcp.json):

{
  "servers": {
    "mudblazor": {
      "url": "http://localhost:5180/mcp"
    }
  }
}

Documentation

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

Available MCP Tools

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?"

Project Structure

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

Contributing

Contributions are welcome! Please see the Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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.


Acknowledgments


Built with ❀️ for the Blazor community

About

MCP server that provides AI assistants with comprehensive access to MudBlazor component documentation, code examples, and API reference. Not affiliated with MudBlazor team.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •