passing module for mcp server name

This commit is contained in:
2026-01-22 17:43:34 +05:30
parent 2ed962d639
commit cb68b0b93f
5 changed files with 12 additions and 5 deletions

View File

@@ -92,11 +92,13 @@ def build(
@cli.command()
@click.option("--mcp", is_flag=True, help="Serve MCP documentation")
@click.option("--mkdocs", is_flag=True, help="Serve MkDocs site")
@click.option("--module", help="Python module to serve")
@click.option("--mkdocs-yml", type=click.Path(path_type=Path), default=Path("mkdocs.yml"), help="MkDocs config path")
@click.option("--out-dir", type=click.Path(path_type=Path), default=Path("mcp_docs"), help="MCP root directory")
def serve(
mcp: bool,
mkdocs: bool,
module: Optional[str],
mkdocs_yml: Path,
out_dir: Path,
) -> None:
@@ -106,6 +108,7 @@ def serve(
Args:
mcp: Serve MCP resources via an MCP server.
mkdocs: Serve the MkDocs site using the built-in development server.
module: The dotted path of the module to serve.
mkdocs_yml: (MkDocs) Path to the mkdocs.yml configuration.
out_dir: (MCP) Path to the mcp_docs/ directory.
"""
@@ -113,11 +116,13 @@ def serve(
raise click.UsageError("Cannot specify both --mcp and --mkdocs")
if not mcp and not mkdocs:
raise click.UsageError("Must specify either --mcp or --mkdocs")
if mcp and not module:
raise click.UsageError("--module is required for MCP serve")
if mkdocs:
mkdocs_utils.serve(mkdocs_yml)
elif mcp:
mcp_utils.serve(out_dir)
mcp_utils.serve(module, out_dir)
@cli.command()