Skip to content

feat: MCP server refactor with fine-grained tools and incremental update support#66

Open
mambo-wang wants to merge 5 commits into
FSoft-AI4Code:mainfrom
mambo-wang:feat/mcp-refactor-and-incremental
Open

feat: MCP server refactor with fine-grained tools and incremental update support#66
mambo-wang wants to merge 5 commits into
FSoft-AI4Code:mainfrom
mambo-wang:feat/mcp-refactor-and-incremental

Conversation

@mambo-wang

Copy link
Copy Markdown

Summary

  • Refactor MCP server into fine-grained, IDE-driven tools (analyze_repo, read_code_components, view_repo_file, write_doc_file, edit_doc_file, save_module_tree, get_processing_order, get_prompt, close_session) alongside legacy tools, enabling zero-LLM-config documentation workflows
  • Add incremental update support (--update / commit_id) to MCP analyze_repo, so only changed modules are re-analyzed
  • Fix commit_id passthrough to metadata.json in CLI mode for --update support
  • Add missing MCP dependencies to pyproject.toml

Test plan

  • Verify MCP server starts via python -m codewiki.mcp.server and all new tools are listed
  • Run analyze_repo tool, confirm session is created and dependency graph is built
  • Run analyze_repo again with commit_id to verify incremental update works correctly
  • Verify CLI --update flag passes commit_id to metadata.json as expected
  • Test legacy tools (generate_docs, get_module_tree) still function

- Add _detect_changes() with git diff + mtime dual-strategy detection
- Add _find_affected_modules() to map changed files to affected modules
- analyze_repo now returns a 'changes' field with affected/cascade modules
- Decouple codewiki/__init__.py from CLI imports for lightweight MCP startup
- Update skill and IDE_DRIVEN_GUIDE.md with incremental update docs
Previously, CLIDocumentationGenerator never received or forwarded the
git commit SHA, so metadata.json always had commit_id: null. This made
--update fall back to full regeneration every time. Now the commit hash
is obtained before generator creation and threaded through to the
backend DocumentationGenerator, matching the behavior already present
in Web mode (background_worker.py).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant