feat(mcp): Git Operations MCP - Gitea Provider #108

Open
opened 2026-01-06 19:19:36 +00:00 by cardosofelipe · 0 comments

Parent Issue

Part of #58 (Git Operations MCP Server)

Summary

Implement the Gitea provider for remote Git operations (pull requests, branch management via API).

Tasks

GiteaProvider Class (providers/gitea.py)

  • Create GiteaProvider class implementing GitProvider protocol
  • Implement API client with authentication (token-based)
  • Implement create_pull_request() method
  • Implement list_pull_requests() method
  • Implement get_pull_request() method
  • Implement merge_pull_request() method (merge, squash, rebase strategies)
  • Implement close_pull_request() method
  • Implement add_pr_comment() method
  • Implement add_pr_reviewer() method
  • Implement get_pr_diff() method
  • Implement list_branches() method (remote)
  • Implement create_branch() method (remote)
  • Implement delete_branch() method (remote)

API Handling

  • Handle API rate limiting
  • Add pagination support for list operations
  • Implement retry logic with exponential backoff
  • Handle API errors gracefully

Testing

  • Unit tests with mocked HTTP responses
  • Integration tests with test Gitea instance (if available)
  • Test all PR operations
  • Test error handling
  • Achieve >90% coverage

Acceptance Criteria

  • All Gitea API operations work correctly
  • Rate limiting handled properly
  • Pagination works for large result sets
  • All tests pass with >90% coverage
  • Error messages are clear and actionable

Dependencies

  • Depends on: #105 (Foundation)

Labels

  • mcp
  • phase-2
  • backend
## Parent Issue Part of #58 (Git Operations MCP Server) ## Summary Implement the Gitea provider for remote Git operations (pull requests, branch management via API). ## Tasks ### GiteaProvider Class (`providers/gitea.py`) - [ ] Create `GiteaProvider` class implementing `GitProvider` protocol - [ ] Implement API client with authentication (token-based) - [ ] Implement `create_pull_request()` method - [ ] Implement `list_pull_requests()` method - [ ] Implement `get_pull_request()` method - [ ] Implement `merge_pull_request()` method (merge, squash, rebase strategies) - [ ] Implement `close_pull_request()` method - [ ] Implement `add_pr_comment()` method - [ ] Implement `add_pr_reviewer()` method - [ ] Implement `get_pr_diff()` method - [ ] Implement `list_branches()` method (remote) - [ ] Implement `create_branch()` method (remote) - [ ] Implement `delete_branch()` method (remote) ### API Handling - [ ] Handle API rate limiting - [ ] Add pagination support for list operations - [ ] Implement retry logic with exponential backoff - [ ] Handle API errors gracefully ### Testing - [ ] Unit tests with mocked HTTP responses - [ ] Integration tests with test Gitea instance (if available) - [ ] Test all PR operations - [ ] Test error handling - [ ] Achieve >90% coverage ## Acceptance Criteria - [ ] All Gitea API operations work correctly - [ ] Rate limiting handled properly - [ ] Pagination works for large result sets - [ ] All tests pass with >90% coverage - [ ] Error messages are clear and actionable ## Dependencies - Depends on: #105 (Foundation) ## Labels - mcp - phase-2 - backend
Sign in to join this conversation.