Skip to content

Add MCP (Model Context Protocol) Server for Component Documentation #4386

@AClerbois

Description

@AClerbois

Feature Request: MCP Server for Fluent UI Blazor Documentation

Summary

Add an MCP (Model Context Protocol) server that provides AI assistants (GitHub Copilot, Claude, etc.) with access to Fluent UI Blazor component documentation, enabling them to generate accurate, up-to-date code.

What is MCP?

Model Context Protocol is an open protocol that enables seamless integration between LLM applications and external data sources. Instead of relying solely on training data, AI assistants can query real-time documentation.

Proposed Implementation

Package

  • Name: Microsoft.FluentUI.AspNetCore.Components.McpServer
  • Type: .NET Global Tool (PackAsTool=true, PackageType=McpServer)
  • Command: fluentui-mcp

MCP Primitives

Tools (11 total) - Model-controlled

Tool Description
ListComponents Lists all available components with names and descriptions
GetComponentDetails Gets detailed documentation including parameters, events, methods
SearchComponents Searches components by name or description
ListCategories Lists all component categories
GetEnumValues Gets enum type information with all possible values
GetComponentEnums Lists enums used by a specific component
ListEnums Lists all enum types in the library
GetComponentExample Gets usage examples for a component
GetGuide Gets documentation guides (installation, migration, styles, etc.)
SearchGuides Searches documentation guides
ListGuides Lists all available guides

Resources (8 total) - User-selected context

URI Description
fluentui://components Complete list of all components
fluentui://categories List of component categories
fluentui://enums All enum types
fluentui://guides Available documentation guides
fluentui://component/{name} Specific component documentation
fluentui://category/{name} Components in a category
fluentui://enum/{name} Specific enum details
fluentui://guide/{key} Specific guide content

Prompts (11 total) - Pre-defined templates

Prompt Description
create_component Generate component code with configuration
explain_component Get detailed component explanation
compare_components Compare multiple components
create_form Generate form with validation
create_datagrid Generate DataGrid with features
create_dialog Generate dialog/modal component
create_drawer Generate drawer/panel component
migrate_to_v5 Migration guidance from v4 to v5
setup_project Project setup instructions
configure_theming Theming and styles guidance
configure_localization Localization implementation

Architecture

┌─────────────────────────────────────────────────────────┐
│                    AI Assistant                          │
│              (Copilot, Claude, etc.)                     │
└─────────────────────────────────────────────────────────┘
                           │
                           │ MCP Protocol (stdio)
                           │
┌─────────────────────────────────────────────────────────┐
│                  FluentUI MCP Server                     │
├─────────────────────────────────────────────────────────┤
│  Tools          │  Resources       │  Prompts           │
├─────────────────────────────────────────────────────────┤
│              FluentUIDocumentationService                │
│                (Reflection + XML Docs)                   │
└─────────────────────────────────────────────────────────┘
                           │
┌─────────────────────────────────────────────────────────┐
│      Microsoft.FluentUI.AspNetCore.Components            │
└─────────────────────────────────────────────────────────┘

Configuration Example

VS Code / GitHub Copilot (.vscode/mcp.json):

{
  "servers": {
    "fluentui-blazor": {
      "command": "fluentui-mcp",
      "args": []
    }
  }
}

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "fluentui-blazor": {
      "command": "fluentui-mcp",
      "args": []
    }
  }
}

Benefits

  1. Accurate code generation: AI gets real-time access to current API documentation
  2. Up-to-date information: No reliance on potentially outdated training data
  3. Rich context: Parameters, events, methods, enums, and examples
  4. Migration support: Built-in v4→v5 migration guidance
  5. Improved developer experience: Better AI assistance for Fluent UI Blazor projects

Technical Details

  • Target Framework: .NET 9.0
  • Dependencies:
    • ModelContextProtocol SDK
    • LoxSmoke.DocXml for XML documentation parsing
    • Microsoft.Extensions.Hosting
  • Documentation source: Reflection on component assembly + XML documentation file

Implementation Status

I have a working prototype available in my fork that includes:

  • Complete MCP server implementation
  • All 11 tools, 8 resources, and 11 prompts
  • Documentation page for the Demo site
  • NuGet package configuration

Would love to contribute this as a PR if there's interest!

Related Links

Metadata

Metadata

Assignees

Labels

community:contributionIssue will/can be addressed by community contribution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions