Add MCP server for Fluent UI Blazor documentation#4425
Add MCP server for Fluent UI Blazor documentation#4425vnbaaij merged 4 commits intomicrosoft:dev-v5from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive MCP (Model Context Protocol) server for Fluent UI Blazor component documentation, enabling AI assistants to access structured component metadata including parameters, events, methods, and enums. The implementation uses pre-generated JSON documentation for fast, dependency-free access with robust error handling.
Key changes:
- New MCP server project with stdio transport, tools, resources, and comprehensive test coverage
- Service and model layers for querying pre-generated JSON documentation
- Build infrastructure for generating and embedding documentation
- Extensive unit and integration tests covering all major functionality
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Tools/McpServer.Tests/*.cs |
Comprehensive test suite with 30+ test classes covering models, services, tools, resources, and integration scenarios |
tests/Tools/McpServer.Tests/TestHelpers.cs |
Custom test skip mechanism implementation |
src/Tools/McpServer/Tools/*.cs |
MCP tool implementations for component listing, details, and enum queries |
src/Tools/McpServer/Services/*.cs |
Documentation service and JSON reader with caching and error handling |
src/Tools/McpServer/Resources/*.cs |
MCP resource implementations for static documentation access |
src/Tools/McpServer/Models/*.cs |
Domain models representing components, enums, properties, events, and methods |
src/Tools/McpServer/Helpers/*.cs |
Utility helpers for formatting tool output |
src/Tools/McpServer/Extensions/*.cs |
Service collection extensions for DI configuration |
src/Tools/McpServer/*.csproj |
Project configuration with NuGet packaging, tool setup, and pre-build documentation generation |
src/Tools/McpServer/README.md |
Comprehensive documentation covering installation, architecture, usage, and debugging |
Directory.Packages.props |
Added ModelContextProtocol and Microsoft.Extensions.Hosting package references |
Microsoft.FluentUI-v5.slnx |
Updated solution to include MCP server and test projects |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Love this!. But the code should not be in the Please rename the project and namspace used to |
|
@vnbaaij That's a very good point. I just pushed up the renamed version. |
Introduces a new MCP (Model Context Protocol) server project that exposes comprehensive Fluent UI Blazor component documentation (names, summaries, parameters, events, methods, enums) via the MCP protocol for AI assistants and tools. The server uses pre-generated JSON documentation for fast, dependency-free access, with robust error handling and support for both development and packaged scenarios. Includes: - New server project with stdio transport, tools, and resources for component and enum queries. - Service and model layer for querying documentation data. - Pre-build generation and embedding of JSON documentation. - Comprehensive unit and integration tests. - Documentation, packaging, and solution updates. No changes to the main Fluent UI Blazor component library; all changes are isolated to the new MCP server and its infrastructure. Downgrade server and package versions; update icon source Downgraded server and NuGet package versions from 5.0.0-preview.4 to 5.0.0-preview.1. Changed the icon from a PNG on GitHub to an SVG on fluentui-blazor.net, updating the MIME type accordingly. Also updated the NuGet package identifier to Microsoft.FluentUI.AspNetCore.Components.McpServer. Refactor LINQ usage in finder, cache init, and tests Refactored JsonDocumentationFinder to use LINQ for file path selection, simplifying the code. Updated FluentUIDocumentationService cache initialization to use LINQ's Select for conversion. Adjusted integration tests to discard unused list tool results, clarifying test intent. Refactor test loop to use LINQ Select for details Refactored the foreach loop in SearchAndDetails_ShouldBeConsistent to use LINQ's Select for projecting components to their details before iteration. This simplifies the code by removing the inner call to GetComponentDetails and makes the loop more concise and readable. Rename MCP server project to Microsoft.FluentUI.AspNetCore.McpServer Renamed the MCP server and test projects from Microsoft.FluentUI.AspNetCore.Components.McpServer to Microsoft.FluentUI.AspNetCore.McpServer. Updated all namespaces, using directives, project references, and InternalsVisibleTo attributes accordingly. Adjusted solution, server manifest, launch settings, and documentation to use the new project and package name. No functional changes; this is a pure rename for clarity and consistency.
517b5c6 to
29691e7
Compare
- Move all MCP JSON model classes to dedicated files under Models.McpDocumentation for better organization - Centralize log prefix with McpServerConstants.LogPrefix for consistent logging - Use case-insensitive sorting/grouping for components, enums, and categories throughout - Remove unused ExtractEventType method and related tests - Refactor markdown generation in ComponentResources for clarity - Add Meziantou.Analyzer to project for code analysis - Use case-insensitive equality in MethodInfo - Change GetEnumsForComponent to return IDictionary for abstraction - Update tests and usages to new model namespace - Overall, improves code structure, maintainability, and consistency Refactor: case-insensitive ops, JSON models, logging - Use case-insensitive ordering and comparisons for all component, enum, and category listings, as well as in tests. - Move JSON documentation models to dedicated files and a new namespace for better organization. - Remove obsolete ExtractEventType method and legacy test helpers; introduce dedicated skip/test attribute files. - Standardize console logging with a new log prefix constant. - Refactor component markdown generation into focused helper methods. - Add Meziantou.Analyzer to main and test projects. - Improve path handling and use consistent dictionary types. - Clean up project files and test code for clarity and maintainability.
|
@dvoituron your comments have been fixed. |
dvoituron
left a comment
There was a problem hiding this comment.
I think there are a few errors in the Readme.md file (for example, the MCP json content).
But I suggest merging this tool and creating another PR with complete documentation only, including a tutorial for VSCode and Visual Studio (where to write the configuration files, how to start the tool—where to click, etc.).
Introduces a new MCP (Model Context Protocol) server project that exposes comprehensive Fluent UI Blazor component documentation (names, summaries, parameters, events, methods, enums) via the MCP protocol for AI assistants and tools. The server uses pre-generated JSON documentation for fast, dependency-free access, with robust error handling and support for both development and packaged scenarios.
Includes:
No changes to the main Fluent UI Blazor component library; all changes are isolated to the new MCP server and its infrastructure.
Pull Request
📖 Description
This pull request introduces a new MCP (Model Context Protocol) server for Fluent UI Blazor component documentation, along with supporting infrastructure and utilities. The main focus is on enabling AI assistants and tools to access structured metadata about Fluent UI Blazor components, including their parameters, events, methods, and enums. The changes include new project files, models, helpers, and build logic to generate and serve component documentation in a machine-readable format.
Key changes:
MCP Server Infrastructure
Microsoft.FluentUI.AspNetCore.Components.McpServerwith configuration for building, packaging, and serving as a .NET tool MCP server, including NuGet packaging metadata, build targets for generating documentation JSON, and embedding resources..mcp/server.jsondescribing the server, its metadata, and how it is discovered and used by MCP clients..gitignoreentries for generated documentation and VS Code settings in the MCP server directory.Component Documentation Model
ComponentInfo,ComponentDetails,EnumInfo, and related types for properties, events, and methods. These models provide a structured representation of component APIs for use by the MCP server. [1] [2] [3]Utilities and Service Extensions
JsonDocumentationFinder), formatting MCP tool output (ToolOutputHelper), and extension methods for configuring the MCP server and related services (ServiceCollectionExtensions). [1] [2] [3]Solution and Dependency Management
ModelContextProtocolandMicrosoft.Extensions.Hosting. [1] [2]Minor Example/Test Updates
[Parameter]attribute inApiClassPerformanceTests.csto align with Blazor component conventions.✅ Checklist
General
Component-specific
⏭ Next Steps