Skip to content

Commit c9d0c4a

Browse files
authored
Merge pull request #73 from BrahmendraBachi/fix/get_module_tree_mcp
fix(mcp): default get_module_tree output_dir to repo docs path
2 parents 67f27e6 + e887921 commit c9d0c4a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

codewiki/mcp/server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,12 @@ async def _legacy_generate_docs(arguments: dict[str, Any]) -> list[TextContent]:
529529
async def _legacy_get_module_tree(arguments: dict[str, Any]) -> list[TextContent]:
530530
"""Legacy get_module_tree."""
531531
repo_path = Path(arguments["repo_path"]).expanduser().resolve()
532-
output_dir = Path(arguments.get("output_dir", "docs")).expanduser().resolve()
532+
output_dir_arg = arguments.get("output_dir")
533+
if output_dir_arg:
534+
output_dir = Path(output_dir_arg).expanduser().resolve()
535+
else:
536+
# Default docs live next to the repo, not relative to the MCP process cwd.
537+
output_dir = (repo_path / "docs").resolve()
533538

534539
module_tree_path = output_dir / "module_tree.json"
535540
if not module_tree_path.exists():

0 commit comments

Comments
 (0)