Skip to content

Mcp Renderer

docforge.renderers.mcp_renderer

Summary

MCP renderer implementation.

This module defines the MCPRenderer class, which generates documentation resources compatible with the Model Context Protocol (MCP).

Classes

MCPRenderer

Renderer that generates MCP-compatible documentation resources.

This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP).

Functions
generate_sources
generate_sources(project: Project, out_dir: Path) -> None

Generate MCP documentation resources for a project.

The renderer serializes each module into a JSON resource and produces supporting metadata files such as nav.json and index.json.

Parameters:

Name Type Description Default
project Project

Documentation project model to render.

required
out_dir Path

Directory where MCP resources will be written.

required