-
Notifications
You must be signed in to change notification settings - Fork 459
[dev-v5] Add MCP documentation support to DocViewer demo #4434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-v5
Are you sure you want to change the base?
[dev-v5] Add MCP documentation support to DocViewer demo #4434
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive Model Context Protocol (MCP) documentation support to the DocViewer demo, enabling AI-powered assistance for Fluent UI Blazor components through integration with Visual Studio and VS Code. The implementation includes models for loading MCP documentation (tools, resources, prompts), enhanced MarkdownViewer rendering capabilities with new table views, updated Section parsing for MCP content blocks, and build automation to generate and include mcp-documentation.json.
Key changes:
- Added MCP documentation models and service for loading tools, resources, and prompts
- Enhanced MarkdownViewer with new rendering capabilities for MCP sections (detailed and summary views)
- Automated MCP documentation generation through build scripts and PreBuild/PostBuild targets
- Added comprehensive documentation pages explaining MCP usage, installation, and examples
Reviewed changes
Copilot reviewed 26 out of 30 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tools/McpServer/README.md | Updated MCP client configuration examples (removed nested "mcp" wrapper) |
| src/Tools/McpServer/Microsoft.FluentUI.AspNetCore.McpServer.csproj | Added PostBuild target to copy XML documentation files to DocApiGen directory |
| examples/Tools/FluentUI.Demo.DocViewer/Services/McpDocumentationService.cs | New service for loading and caching MCP documentation with filtering methods |
| examples/Tools/FluentUI.Demo.DocViewer/Models/SectionType.cs | Added Mcp and McpSummary section types for detailed and lightweight views |
| examples/Tools/FluentUI.Demo.DocViewer/Models/Section.cs | Enhanced section parsing to support MCP and McpSummary blocks with type/filter arguments |
| examples/Tools/FluentUI.Demo.DocViewer/Models/Mcp/*.cs | New model classes for MCP documentation (Tool, Resource, Prompt, Parameter, Metadata, Documentation) |
| examples/Tools/FluentUI.Demo.DocViewer/Models/Api/*.cs | Refactored API documentation models into separate files (ApiDocSummary, ApiClassMember, ApiClass) |
| examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor.css | Added CSS styles for MCP tables (detailed and summary views) with responsive design |
| examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor.cs | Added MCP documentation loading logic on component initialization |
| examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor | Added rendering logic for MCP and McpSummary sections with grouped tables |
| examples/Tools/FluentUI.Demo.DocApiGen/Properties/launchSettings.json | Added launch profile for generating MCP documentation |
| examples/Tools/FluentUI.Demo.DocApiGen/Microsoft.FluentUI.AspNetCore.McpServer.xml | New XML documentation file for MCP Server (653 lines of API documentation) |
| examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Mcp/*.md | Six new documentation pages covering MCP overview, installation, resources, tools, prompts, and examples |
| _PublishDemoLocally.ps1 | Added build steps for MCP Server and MCP documentation generation |
| Microsoft.FluentUI-v5.slnx | Added .mcp.json to solution items folder |
| .mcp.json | New MCP configuration file (commented out local server configuration) |
| .gitignore | Added mcp-documentation.json to ignored files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor.css
Outdated
Show resolved
Hide resolved
examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Mcp/Installation.md
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Services/McpDocumentationService.cs
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Services/McpDocumentationService.cs
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Services/McpDocumentationService.cs
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Components/MarkdownViewer.razor
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocApiGen/Microsoft.FluentUI.AspNetCore.McpServer.xml
Outdated
Show resolved
Hide resolved
examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Mcp/Overview.md
Outdated
Show resolved
Hide resolved
|
|
||
| Resources provide static documentation that users can attach to conversations: | ||
|
|
||
| {{ McpSummary Type=resources }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Mcp/Overview.md
Show resolved
Hide resolved
examples/Demo/FluentUI.Demo.Client/Documentation/GetStarted/Mcp/Overview.md
Outdated
Show resolved
Hide resolved
|
|
||
| ## Available Prompts | ||
|
|
||
| {{ MCP Type=prompts }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| The Fluent UI Blazor MCP Server provides the following tools: | ||
|
|
||
| {{ MCP Type=tools }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/Tools/FluentUI.Demo.DocViewer/Components/Markdown/McpSummaryViewer.razor
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Components/Markdown/McpSummaryViewer.razor.cs
Outdated
Show resolved
Hide resolved
examples/Tools/FluentUI.Demo.DocViewer/Components/Markdown/McpViewer.razor
Outdated
Show resolved
Hide resolved
6cf6604 to
cc764ec
Compare
- Add models and service for loading MCP (Model Context Protocol) documentation (tools, resources, prompts)
- Enhance MarkdownViewer to render MCP sections and summaries with new table views and CSS
- Update Section parsing to support {{ MCP ... }} and {{ McpSummary ... }} blocks
- Update build scripts to generate and include mcp-documentation.json
- Add .mcp.json config, update solution/project files for MCP integration
- Add/refresh documentation for MCP server usage and configuration
- Minor: reformat legacy API doc files, update .gitignore, add XML doc for DocApiGen
Standardize MCP config docs, improve code thread safety
- Clarified and unified MCP server configuration examples for VS Code and Visual Studio 2022 in documentation, with consistent JSON and server naming.
- Improved instructions for .NET tool and dnx usage, and reorganized debugging guidance.
- Updated string comparisons in Section.cs to use OrdinalIgnoreCase for consistency.
- Refactored section type handling with a SetMcpSection helper to reduce duplication.
- Made McpDocumentationService static and replaced SemaphoreSlim with double-checked locking for thread-safe caching.
- Removed !important from mobile table CSS for better style flexibility.
Refactor MCP documentation components for improved structure and readability
- Introduced McpViewer and McpSummaryViewer components to encapsulate MCP tools, resources, and prompts rendering logic.
- Removed redundant rendering logic from MarkdownViewer.razor.
- Updated styles for MCP tables and messages for better visual consistency.
- Simplified the McpDocumentationService by removing unnecessary configuration options.
- Enhanced mobile responsiveness for MCP tables.
- Added new component files and corresponding CSS for better modularity and maintainability.
Add MCP server XML file to .gitignore for cleaner builds
Rename SetMcpSection method to SetSection for clarity
Refactor: unify section handling with SetSection method
Replaced SetMcpSection calls with SetSection for "API", "MCP", and "McpSummary" components to consolidate section assignment logic and improve code maintainability.
Improve responsive tables and accessibility in viewers
Enhanced summary tables in McpSummaryViewer and McpViewer for better mobile responsiveness and accessibility. Added data-labels to table cells, updated CSS for mobile-friendly layouts, improved code/URI styling, and ensured better screen reader support. Tables now display as card-like blocks on small screens with clearer context and improved usability.
Refactor table markup and CSS for simpler mobile layout
Removed data-labels and card-style mobile tables in McpSummaryViewer and McpViewer.razor. Refactored CSS to use flexbox for mobile responsiveness, simplifying styles and markup. Cleaned up code/URI cell styling for a more streamlined, maintainable layout.
cc764ec to
f308971
Compare
- Changed references from Visual Studio 2022 to Visual Studio 2026 in Installation.md and Overview.md. - Removed outdated build instructions and added new components for displaying MCP prompts, resources, and tools. - Introduced McpType enum to streamline MCP type handling across components. - Refactored McpViewer and related components to utilize the new McpType enum. - Enhanced the rendering logic for tools, resources, and prompts to improve maintainability and readability. - Updated README.md files to reflect the changes in configuration for Visual Studio 2026.



Pull Request
Add a new sub section under get started :

With several content :

Content with autogenerated documentation for prompt, tools and ressources :
🎫 Issues
👩💻 Reviewer Notes
📑 Test Plan
✅ Checklist
General
Component-specific