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:
2026-01-21 16:43:21 +05:30
parent ce2eafac85
commit 5370a7faa2
8 changed files with 180 additions and 74 deletions

View File

@@ -14,5 +14,10 @@ def test_mcp_directory_structure(tmp_path: Path):
renderer.generate_sources(project, out_dir)
assert (out_dir / "testpkg.md").exists()
assert (out_dir / "testpkg" / "sub.md").exists()
# Bundle-level files
assert (out_dir / "index.json").exists()
assert (out_dir / "nav.json").exists()
# Module resources
assert (out_dir / "modules" / "testpkg.json").exists()
assert (out_dir / "modules" / "testpkg.sub.json").exists()