feat(mcp): add MCP JSON renderer and CLI support, update tests accordingly
- Add MCPRenderer to generate MCP-native JSON bundles (index.json, nav.json, modules/*.json) - Expose MCPRenderer via public API and CLI (`generate-mcp` command) - Replace Markdown-based MCP output with structured JSON resources - Update MCP renderer type stubs to match new JSON-based implementation - Refactor MCP tests to validate JSON content, bundle structure, and navigation - Fix MCP module coverage test to use explicit project_root for reliable discovery
This commit is contained in:
@@ -47,6 +47,34 @@ def generate(
|
||||
) -> None:
|
||||
"""Generate documentation source files using MkDocs renderer."""
|
||||
|
||||
@cli.command(name="generate-mcp")
|
||||
@click.option(
|
||||
"--module",
|
||||
required=True,
|
||||
help="Python module import path to document",
|
||||
)
|
||||
@click.option(
|
||||
"--project-name",
|
||||
help="Project name (defaults to first module)",
|
||||
)
|
||||
@click.option(
|
||||
"--out-dir",
|
||||
type=click.Path(path_type=Path),
|
||||
default=Path("mcp_docs"),
|
||||
)
|
||||
def generate_mcp(
|
||||
module: str,
|
||||
project_name: str | None,
|
||||
out_dir: Path,
|
||||
) -> None:
|
||||
"""
|
||||
Generate MCP-compatible documentation resources for the specified module.
|
||||
|
||||
Args:
|
||||
module: The primary module path to document.
|
||||
project_name: Optional project name override.
|
||||
out_dir: Directory where MCP resources will be written.
|
||||
"""
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
|
||||
Reference in New Issue
Block a user