Getting Started — DocumentationViewer

Host generated API documentation in an ASP.NET Core website.

1. Install the NuGet Package

The viewer expects data produced by DocumentationBuilder. Install DMBDocumentationViewer in the website that hosts the documentation — not the generator project.

Install DMBDocumentationViewer
dotnet add package DMBDocumentationViewer

2. Configure Services

Load the viewer after PageBuilder and BootstrapBuilder. The viewer also registers MCP tools from its assembly for agent-assisted documentation workflows.

Program.cs — services
using DMBPageBuilder;
using DMBBootstrapBuilder;
using DMBDocumentationViewer;

PageBuilderConfiguration.LoadCommonConfig(builder);
BootstrapBuilderConfiguration.LoadCommonConfig(builder);
DocumentationViewerConfiguration.LoadCommonConfig(builder);

3. Map the MCP Endpoint

Call UseApp after building the application so the viewer can map its MCP endpoint and documentation routes.

Program.cs — middleware
WebApplication app = builder.Build();

DocumentationViewerConfiguration.UseApp(app);

4. Register Generated Navigation

Register the generated sidebar provider after the documentation generation step has written it into the website. Then open the documentation home to verify the integration.

Sidebar registration
using DocumentationBuilders.Documentation;

DocumentationSidebarProvider.Register();
Key Configuration
DocumentationViewerConfiguration.LoadCommonConfig(...)
DocumentationViewerConfiguration.UseApp(...)
DocumentationSidebarProvider.Register()
Documentation/Index
MCP endpoint

Curious how it works under the hood?

Understand how DocumentationViewer routes requests and renders pages at runtime.

Architecture