Skip to content

Add git_operations and github_operations modules from mcp_coder #98

@MarcusJellinghaus

Description

@MarcusJellinghaus

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

  • All git_operations functions exist in mcp_workspace and are exposed as MCP tools
  • All github_operations functions exist in mcp_workspace and are exposed as MCP tools
  • Unit tests moved and passing (pytest -n auto)
  • pylint, mypy, ruff pass
  • mcp-coder check file-size --max-lines 750 passes
  • No logic changes — only import adjustments (verify with mcp-coder git-tool compact-diff)
  • CLAUDE.md updated if needed

Related

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions