removed mcp
This commit is contained in:
@@ -25,9 +25,8 @@ Optional flags:
|
||||
--package-root NAME Root Python package name (default: mail_intake)
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
from typing import Iterable
|
||||
|
||||
@@ -139,64 +138,6 @@ def extract_modules(md_file: Path) -> list[str]:
|
||||
return MKDOCSTRINGS_DIRECTIVE.findall(content)
|
||||
|
||||
|
||||
def cmd_build_mcp(args: argparse.Namespace) -> None:
|
||||
docs_root = args.docs_dir
|
||||
mcp_root = args.mcp_dir
|
||||
|
||||
modules_dir = mcp_root / "modules"
|
||||
modules_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
nav = []
|
||||
modules = []
|
||||
|
||||
for md in iter_markdown_files(docs_root):
|
||||
rel = md.relative_to(docs_root)
|
||||
|
||||
module_refs = extract_modules(md)
|
||||
if not module_refs:
|
||||
continue
|
||||
|
||||
nav.append({
|
||||
"page": str(rel),
|
||||
"modules": module_refs,
|
||||
})
|
||||
|
||||
for module in module_refs:
|
||||
module_entry = {
|
||||
"module": module,
|
||||
"doc_page": str(rel),
|
||||
}
|
||||
modules.append(module_entry)
|
||||
|
||||
out = modules_dir / f"{module}.json"
|
||||
out.parent.mkdir(parents=True, exist_ok=True)
|
||||
out.write_text(
|
||||
json.dumps(module_entry, indent=2),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
mcp_root.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
(mcp_root / "nav.json").write_text(
|
||||
json.dumps(nav, indent=2),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
(mcp_root / "index.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"project": "Aetoskia Mail Intake",
|
||||
"type": "docs-only",
|
||||
"modules_count": len(modules),
|
||||
},
|
||||
indent=2,
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
print(f"MCP artifacts written to: {mcp_root}")
|
||||
|
||||
|
||||
# -------------------------
|
||||
# CLI
|
||||
# -------------------------
|
||||
@@ -220,13 +161,6 @@ def main() -> None:
|
||||
help="Root Python package name",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--mcp-dir",
|
||||
type=Path,
|
||||
default=DEFAULT_MCP_DIR,
|
||||
help="Output directory for MCP artifacts",
|
||||
)
|
||||
|
||||
subparsers = parser.add_subparsers(dest="command", required=True)
|
||||
|
||||
subparsers.add_parser(
|
||||
@@ -244,13 +178,6 @@ def main() -> None:
|
||||
help="Serve the MkDocs site locally",
|
||||
).set_defaults(func=cmd_serve)
|
||||
|
||||
subparsers.add_parser(
|
||||
"build_mcp",
|
||||
help="Generate MCP artifacts (docs-only)",
|
||||
).set_defaults(
|
||||
func=cmd_build_mcp
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
args.func(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user