Goal
Land mcp_coder's utils/git_operations/ (13 files) and utils/github_operations/ (~15 files) into mcp_workspace as MCP tools. After this issue, mcp_workspace exposes git and GitHub functionality that mcp_coder can consume via MCP.
Why
Per the mcp_utils_plan Phase 5 and architectural rule #2 (one server per domain): git state is workspace state, and GitHub API mechanics belong with the server that already handles file/git ops.
Scope — what moves
Git operations → expand existing file_tools/git_operations.py (currently 134 lines, 3 functions):
core.py, branches.py, branch_queries.py, commits.py, diffs.py, compact_diffs.py, file_tracking.py, staging.py, remotes.py, parent_branch_detection.py, repository_status.py, workflows.py, __init__.py
GitHub operations → new file_tools/github_operations.py module:
base_manager.py, github_utils.py, pr_manager.py, labels_manager.py, label_config.py, ci_results_manager.py, issues/ subpackage (all 9 files)
Refactoring rules
Per mcp_coder/.claude/knowledge_base/refactoring_principles.md:
- Move, don't change. Functions/classes land as-is. No logic changes.
- Only adjust imports. Internal cross-references update to new paths, nothing else.
- Tests mirror source structure. Unit tests from mcp_coder move with the code.
- File size check. All new files must be under 750 lines. Split if needed.
Acceptance criteria
Related
Goal
Land
mcp_coder'sutils/git_operations/(13 files) andutils/github_operations/(~15 files) intomcp_workspaceas MCP tools. After this issue, mcp_workspace exposes git and GitHub functionality that mcp_coder can consume via MCP.Why
Per the mcp_utils_plan Phase 5 and architectural rule #2 (one server per domain): git state is workspace state, and GitHub API mechanics belong with the server that already handles file/git ops.
Scope — what moves
Git operations → expand existing
file_tools/git_operations.py(currently 134 lines, 3 functions):core.py,branches.py,branch_queries.py,commits.py,diffs.py,compact_diffs.py,file_tracking.py,staging.py,remotes.py,parent_branch_detection.py,repository_status.py,workflows.py,__init__.pyGitHub operations → new
file_tools/github_operations.pymodule:base_manager.py,github_utils.py,pr_manager.py,labels_manager.py,label_config.py,ci_results_manager.py,issues/subpackage (all 9 files)Refactoring rules
Per
mcp_coder/.claude/knowledge_base/refactoring_principles.md:Acceptance criteria
pytest -n auto)mcp-coder check file-size --max-lines 750passesmcp-coder git-tool compact-diff)Related