forked from cardosofelipe/fast-next-template
feat(mcp): Implement Git Operations MCP Server #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement the Git Operations MCP server that provides version control capabilities for agents. This enables agents to clone repositories, create branches, commit changes, and manage pull requests across multiple Git providers.
Sub-Tasks
1. Project Setup
mcp-servers/git-ops/pyproject.tomlwith dependenciesfastmcp>=0.4.0,gitpython>=3.1.0,httpx>=0.25.0pygithub>=2.0.0,python-gitlab>=4.0.0Dockerfile,.dockerignore)docker-compose.dev.ymlREADME.mdwith setup instructions2. Workspace Management (
workspace.py)WorkspaceManagerclass/var/syndarix/workspaces/)get_workspace(project_id)methodcreate_workspace(project_id)methoddelete_workspace(project_id)method3. Credential Management (
credentials.py)CredentialStoreclass4. Git Wrapper (
git_wrapper.py)GitWrapperclass using gitpythonclone(repo_url, workspace, branch)methodcheckout(branch)methodcreate_branch(branch_name, base)methoddelete_branch(branch_name)methodlist_branches()methodstatus()method (modified, staged, untracked)add(files)methodcommit(message, author)methodpush(branch, force)methodpull(branch)methodfetch()methoddiff(base, target)methodlog(limit)methodreset(commit, mode)method5. Gitea Provider (
providers/gitea.py)GiteaProviderclasscreate_pull_request()methodlist_pull_requests()methodget_pull_request()methodmerge_pull_request()methodclose_pull_request()methodadd_pr_comment()methodadd_pr_reviewer()methodget_pr_diff()methodlist_branches()method (remote)create_branch()method (remote)delete_branch()method (remote)6. GitHub Provider (
providers/github.py)GitHubProviderclass using PyGithubcreate_pull_request()methodlist_pull_requests()methodget_pull_request()methodmerge_pull_request()methodclose_pull_request()methodadd_pr_comment()methodadd_pr_reviewer()methodget_pr_diff()methodlist_branches()methodcreate_branch()methoddelete_branch()method7. GitLab Provider (
providers/gitlab.py)GitLabProviderclass using python-gitlabcreate_merge_request()methodlist_merge_requests()methodget_merge_request()methodmerge_merge_request()methodclose_merge_request()methodadd_mr_comment()methodadd_mr_reviewer()methodget_mr_diff()methodlist_branches()methodcreate_branch()methoddelete_branch()method8. Provider Factory (
providers/factory.py)ProviderFactoryclass9. MCP Tools Implementation (
server.py)clone_repotoolcreate_branchtoollist_branchestoolcheckout_branchtoolcommit_changestoolpush_branchtoolpull_changestoolget_difftoolget_statustoolcreate_pull_requesttoollist_pull_requeststoolmerge_pull_requesttooladd_pr_commenttool10. Branch Naming Conventions
11. Conflict Detection
12. Error Handling
GitErrorbase exceptionCloneErrorfor clone failuresPushErrorfor push failuresMergeConflictErrorfor conflictsAuthenticationErrorfor auth issuesProviderErrorfor API failures13. Docker & Deployment
Dockerfile14. Testing
git_wrapper.py15. Documentation
Technical Specifications
MCP Tools
Acceptance Criteria
Dependencies
Assignable To
backend-engineer agent
Sub-Issues Created
This issue has been broken down into the following sub-issues for manageable implementation:
Implementation Order:
Branch:
feature/58-git-operations-mcp