Skip to content

Commit e887921

Browse files
fix(mcp): default get_module_tree output_dir to repo docs path
1 parent a9de7d0 commit e887921

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
@@ -513,7 +513,12 @@ async def _legacy_generate_docs(arguments: dict[str, Any]) -> list[TextContent]:
513513
async def _legacy_get_module_tree(arguments: dict[str, Any]) -> list[TextContent]:
514514
"""Legacy get_module_tree."""
515515
repo_path = Path(arguments["repo_path"]).expanduser().resolve()
516-
output_dir = Path(arguments.get("output_dir", "docs")).expanduser().resolve()
516+
output_dir_arg = arguments.get("output_dir")
517+
if output_dir_arg:
518+
output_dir = Path(output_dir_arg).expanduser().resolve()
519+
else:
520+
# Default docs live next to the repo, not relative to the MCP process cwd.
521+
output_dir = (repo_path / "docs").resolve()
517522

518523
module_tree_path = output_dir / "module_tree.json"
519524
if not module_tree_path.exists():

0 commit comments

Comments
 (0)