feat(mcp): Implement Issues MCP Server #59

Open
opened 2026-01-03 01:25:46 +00:00 by cardosofelipe · 0 comments

Overview

Implement an MCP server that provides unified issue tracking operations across multiple providers (Gitea, GitHub, GitLab). This server enables agents to create, update, query, and manage issues with bi-directional sync capabilities.

Parent Epic

  • Epic #60: [EPIC] Phase 2: MCP Integration

Dependencies

  • #55: MCP Client Infrastructure (MCPClientManager must be operational)

Implementation Sub-Tasks

1. Project Setup & Structure

  • Create backend/src/mcp_servers/issues/ directory
  • Create __init__.py with public exports
  • Create server.py with FastMCP initialization
  • Create pyproject.toml for standalone installation
  • Create Dockerfile for containerized deployment
  • Create .env.example with all configuration options
  • Add to docker-compose.mcp.yml service definition
  • Configure health check endpoint
  • Set up structured logging with correlation IDs

2. Configuration & Settings

  • Create config.py with Pydantic settings class
  • Define provider configuration schema (Gitea, GitHub, GitLab)
  • Configure connection pooling settings per provider
  • Set up rate limiting configuration per provider
  • Define sync interval settings (real-time vs batch)
  • Configure conflict resolution strategy options
  • Set up retry policies with exponential backoff
  • Define webhook endpoint configuration
  • Configure caching TTL settings

3. Provider Abstraction Layer

  • Create providers/base.py with abstract IssueProvider class
  • Define abstract methods: list_issues(), get_issue(), create_issue(), update_issue(), delete_issue()
  • Define abstract methods: list_comments(), add_comment(), update_comment(), delete_comment()
  • Define abstract methods: list_labels(), add_label(), remove_label()
  • Define abstract methods: assign_user(), unassign_user()
  • Define abstract methods: get_milestones(), set_milestone()
  • Define abstract methods: search_issues() with query builder
  • Define abstract methods: get_issue_history(), get_issue_timeline()
  • Create unified error hierarchy for provider errors
  • Create provider factory with registration pattern

4. Gitea Provider Implementation

  • Create providers/gitea.py implementing IssueProvider
  • Implement authentication (token-based, OAuth)
  • Implement list_issues() with pagination support
  • Implement get_issue() with full detail retrieval
  • Implement create_issue() with all fields
  • Implement update_issue() with partial updates
  • Implement delete_issue() (archive behavior)
  • Implement list_comments() with pagination
  • Implement add_comment() with markdown support
  • Implement update_comment() and delete_comment()
  • Implement list_labels() with color parsing
  • Implement add_label() and remove_label()
  • Implement assign_user() and unassign_user()
  • Implement get_milestones() and set_milestone()
  • Implement search_issues() using Gitea's query syntax
  • Implement webhook handler for real-time updates
  • Add rate limiting with Gitea's specific limits
  • Add connection retry logic
  • Write unit tests for all Gitea operations

5. GitHub Provider Implementation

  • Create providers/github.py implementing IssueProvider
  • Implement authentication (GitHub App, PAT, OAuth)
  • Implement list_issues() with GitHub pagination (Link headers)
  • Implement get_issue() with timeline data
  • Implement create_issue() with templates support
  • Implement update_issue() with partial updates
  • Implement delete_issue() (close behavior - GitHub doesn't delete)
  • Implement list_comments() with reactions
  • Implement add_comment() with GitHub-flavored markdown
  • Implement update_comment() and delete_comment()
  • Implement label operations with GitHub's label API
  • Implement assignee operations (multiple assignees)
  • Implement milestone operations
  • Implement search_issues() using GitHub's search syntax
  • Implement GraphQL queries for complex data fetching
  • Implement webhook handler for GitHub events
  • Handle GitHub rate limiting (primary, secondary, search)
  • Add connection retry with abuse detection
  • Write unit tests for all GitHub operations

6. GitLab Provider Implementation

  • Create providers/gitlab.py implementing IssueProvider
  • Implement authentication (Project/Group tokens, OAuth)
  • Implement list_issues() with GitLab pagination
  • Implement get_issue() with related merge requests
  • Implement create_issue() with confidential issues support
  • Implement update_issue() with weight/time tracking
  • Implement delete_issue() (close behavior)
  • Implement list_comments() (notes in GitLab)
  • Implement add_comment() and note operations
  • Implement update_comment() and delete_comment()
  • Implement label operations (project-level, group-level)
  • Implement assignee operations
  • Implement milestone operations (project/group milestones)
  • Implement search_issues() using GitLab's search API
  • Implement webhook handler for GitLab events
  • Handle GitLab rate limiting per endpoint
  • Add connection retry logic
  • Write unit tests for all GitLab operations

7. Unified Issue Model

  • Create models/issue.py with Pydantic models
  • Define UnifiedIssue model with common fields
  • Define UnifiedComment model
  • Define UnifiedLabel model with color normalization
  • Define UnifiedMilestone model
  • Define UnifiedUser model for assignees/authors
  • Define IssueState enum (open, closed, merged for MRs)
  • Define IssuePriority enum with provider mapping
  • Define IssueType enum (issue, bug, feature, task)
  • Create mappers from each provider to unified model
  • Create mappers from unified model to each provider
  • Handle provider-specific fields via metadata dict
  • Define IssueSearchQuery model with filter options
  • Add validation for required fields per provider

8. Sync Service Implementation

  • Create sync/service.py with IssueSyncService class
  • Implement initial full sync on startup
  • Implement incremental sync based on timestamps
  • Implement real-time sync via webhooks
  • Create sync status tracking with metrics
  • Implement sync queue for batched operations
  • Handle sync errors with retry and dead-letter queue
  • Implement sync conflict detection
  • Create sync audit log for debugging
  • Add sync progress reporting
  • Implement selective sync (by project, by label, etc.)
  • Add sync pause/resume functionality
  • Write integration tests for sync scenarios

9. Conflict Resolution

  • Create sync/conflicts.py with conflict handling
  • Define conflict types: field-level, state-level, delete-update
  • Implement "last-write-wins" strategy
  • Implement "source-of-truth" strategy (prefer one provider)
  • Implement "manual-resolution" strategy with queue
  • Create conflict notification system
  • Store conflict history for audit
  • Implement merge strategy for non-conflicting changes
  • Add conflict resolution UI hints in metadata
  • Write unit tests for each conflict scenario

10. Database Schema & Repository

  • Create issues_sync_state table for sync tracking
  • Create issue_mappings table (local_id ↔ provider_id mapping)
  • Create sync_conflicts table for unresolved conflicts
  • Create sync_audit_log table for debugging
  • Create webhook_events table for event deduplication
  • Create Alembic migrations for all tables
  • Implement IssueMappingRepository with CRUD operations
  • Implement SyncStateRepository for tracking
  • Implement ConflictRepository for conflict management
  • Add indexes for performance (provider+external_id, sync_status)

11. MCP Tools Definition

  • Create list_issues tool with filtering parameters
    • Filter by status (open, closed, all)
    • Filter by assignee
    • Filter by labels (include/exclude)
    • Filter by milestone
    • Filter by date range (created, updated)
    • Pagination support (page, per_page)
    • Sorting options (created, updated, priority)
  • Create get_issue tool with full details
    • Include comments option
    • Include timeline option
    • Include related issues option
  • Create create_issue tool
    • Title and description (markdown)
    • Labels assignment
    • Milestone assignment
    • Assignee(s) assignment
    • Priority setting
    • Due date setting
  • Create update_issue tool
    • Partial updates support
    • State transitions (open/close/reopen)
    • All field updates
  • Create add_comment tool
    • Markdown support
    • Mention detection
  • Create search_issues tool with advanced query
    • Full-text search in title/description
    • Boolean operators (AND, OR, NOT)
    • Field-specific search
  • Create bulk_update_issues tool for batch operations
  • Create get_issue_stats tool for analytics
  • Create link_issues tool for issue relationships
  • Document all tools with JSON Schema

12. Caching Layer

  • Create cache/issue_cache.py with Redis integration
  • Implement issue list caching with TTL
  • Implement individual issue caching
  • Implement label/milestone caching (longer TTL)
  • Implement cache invalidation on updates
  • Implement cache invalidation on webhook events
  • Add cache warming on startup
  • Add cache hit/miss metrics
  • Write tests for cache behavior

13. Webhook Handler

  • Create webhooks/handler.py for incoming webhooks
  • Implement Gitea webhook signature verification
  • Implement GitHub webhook signature verification
  • Implement GitLab webhook token verification
  • Handle issue.opened event
  • Handle issue.edited event
  • Handle issue.closed event
  • Handle issue.reopened event
  • Handle comment.created event
  • Handle comment.edited event
  • Handle comment.deleted event
  • Handle label events (added/removed)
  • Handle assignee events
  • Implement event deduplication
  • Add webhook event logging
  • Write integration tests for webhook handling

14. Error Handling & Resilience

  • Define custom exceptions in exceptions.py
  • Create ProviderConnectionError for network issues
  • Create RateLimitExceededError with retry-after
  • Create AuthenticationError for auth failures
  • Create IssueNotFoundError for 404 responses
  • Create ConflictError for sync conflicts
  • Implement circuit breaker for each provider
  • Implement retry with exponential backoff
  • Add graceful degradation (serve from cache on failure)
  • Add health check per provider
  • Write tests for error scenarios

15. Metrics & Observability

  • Add Prometheus metrics for operations
  • Track issues_synced_total counter
  • Track sync_latency_seconds histogram
  • Track provider_errors_total by provider and type
  • Track cache_hit_ratio gauge
  • Track active_sync_jobs gauge
  • Add structured logging for all operations
  • Add trace ID propagation for debugging
  • Create Grafana dashboard template
  • Add alerting rules for sync failures

16. Testing

  • Write unit tests for each provider (mocked HTTP)
  • Write unit tests for unified model mappers
  • Write unit tests for sync service logic
  • Write unit tests for conflict resolution
  • Write integration tests with real providers (optional, CI flag)
  • Write integration tests for MCP tools
  • Write integration tests for webhooks
  • Add load tests for concurrent operations
  • Achieve >90% code coverage
  • Add contract tests for provider API compatibility

17. Docker & Deployment

  • Create optimized Dockerfile with multi-stage build
  • Configure environment variables for all settings
  • Add health check endpoint
  • Add readiness probe endpoint
  • Configure resource limits (CPU, memory)
  • Add to docker-compose.mcp.yml
  • Configure volume mounts for persistent data
  • Add log rotation configuration
  • Document Kubernetes deployment (optional)

18. Documentation

  • Write README.md with overview and quick start
  • Document provider setup (Gitea, GitHub, GitLab)
  • Document authentication requirements per provider
  • Document all MCP tools with examples
  • Document sync behavior and conflict resolution
  • Document webhook configuration per provider
  • Document environment variables
  • Document troubleshooting guide
  • Add architecture diagram
  • Add sequence diagrams for sync flows

Technical Specifications

Provider API References

Sync Strategy

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   Gitea API     │◄───►│  Issues MCP      │◄───►│   PostgreSQL    │
├─────────────────┤     │  Server          │     │   (mappings)    │
│   GitHub API    │◄───►│                  │     └─────────────────┘
├─────────────────┤     │  - Sync Service  │
│   GitLab API    │◄───►│  - Webhooks      │     ┌─────────────────┐
└─────────────────┘     │  - Cache (Redis) │◄───►│   Redis         │
                        └──────────────────┘     │   (cache)       │
                                                 └─────────────────┘

Conflict Resolution Priority

  1. Provider-specific metadata preserved
  2. Last-modified timestamp wins for field conflicts
  3. State changes (open/close) require explicit resolution
  4. Comments never deleted (soft-delete with sync flag)

Acceptance Criteria

  • All three providers (Gitea, GitHub, GitLab) fully implemented
  • Bi-directional sync working with <1 minute latency
  • Conflict resolution strategy configurable and working
  • All MCP tools operational and documented
  • Webhook handlers verified with real events
  • >90% test coverage
  • Performance: <500ms for single issue operations
  • Documentation complete with examples

Labels

phase-2, mcp, backend, issues, sync

Milestone

Phase 2: MCP Integration

## Overview Implement an MCP server that provides unified issue tracking operations across multiple providers (Gitea, GitHub, GitLab). This server enables agents to create, update, query, and manage issues with bi-directional sync capabilities. ## Parent Epic - Epic #60: [EPIC] Phase 2: MCP Integration ## Dependencies - #55: MCP Client Infrastructure (MCPClientManager must be operational) --- ## Implementation Sub-Tasks ### 1. Project Setup & Structure - [ ] Create `backend/src/mcp_servers/issues/` directory - [ ] Create `__init__.py` with public exports - [ ] Create `server.py` with FastMCP initialization - [ ] Create `pyproject.toml` for standalone installation - [ ] Create `Dockerfile` for containerized deployment - [ ] Create `.env.example` with all configuration options - [ ] Add to `docker-compose.mcp.yml` service definition - [ ] Configure health check endpoint - [ ] Set up structured logging with correlation IDs ### 2. Configuration & Settings - [ ] Create `config.py` with Pydantic settings class - [ ] Define provider configuration schema (Gitea, GitHub, GitLab) - [ ] Configure connection pooling settings per provider - [ ] Set up rate limiting configuration per provider - [ ] Define sync interval settings (real-time vs batch) - [ ] Configure conflict resolution strategy options - [ ] Set up retry policies with exponential backoff - [ ] Define webhook endpoint configuration - [ ] Configure caching TTL settings ### 3. Provider Abstraction Layer - [ ] Create `providers/base.py` with abstract `IssueProvider` class - [ ] Define abstract methods: `list_issues()`, `get_issue()`, `create_issue()`, `update_issue()`, `delete_issue()` - [ ] Define abstract methods: `list_comments()`, `add_comment()`, `update_comment()`, `delete_comment()` - [ ] Define abstract methods: `list_labels()`, `add_label()`, `remove_label()` - [ ] Define abstract methods: `assign_user()`, `unassign_user()` - [ ] Define abstract methods: `get_milestones()`, `set_milestone()` - [ ] Define abstract methods: `search_issues()` with query builder - [ ] Define abstract methods: `get_issue_history()`, `get_issue_timeline()` - [ ] Create unified error hierarchy for provider errors - [ ] Create provider factory with registration pattern ### 4. Gitea Provider Implementation - [ ] Create `providers/gitea.py` implementing `IssueProvider` - [ ] Implement authentication (token-based, OAuth) - [ ] Implement `list_issues()` with pagination support - [ ] Implement `get_issue()` with full detail retrieval - [ ] Implement `create_issue()` with all fields - [ ] Implement `update_issue()` with partial updates - [ ] Implement `delete_issue()` (archive behavior) - [ ] Implement `list_comments()` with pagination - [ ] Implement `add_comment()` with markdown support - [ ] Implement `update_comment()` and `delete_comment()` - [ ] Implement `list_labels()` with color parsing - [ ] Implement `add_label()` and `remove_label()` - [ ] Implement `assign_user()` and `unassign_user()` - [ ] Implement `get_milestones()` and `set_milestone()` - [ ] Implement `search_issues()` using Gitea's query syntax - [ ] Implement webhook handler for real-time updates - [ ] Add rate limiting with Gitea's specific limits - [ ] Add connection retry logic - [ ] Write unit tests for all Gitea operations ### 5. GitHub Provider Implementation - [ ] Create `providers/github.py` implementing `IssueProvider` - [ ] Implement authentication (GitHub App, PAT, OAuth) - [ ] Implement `list_issues()` with GitHub pagination (Link headers) - [ ] Implement `get_issue()` with timeline data - [ ] Implement `create_issue()` with templates support - [ ] Implement `update_issue()` with partial updates - [ ] Implement `delete_issue()` (close behavior - GitHub doesn't delete) - [ ] Implement `list_comments()` with reactions - [ ] Implement `add_comment()` with GitHub-flavored markdown - [ ] Implement `update_comment()` and `delete_comment()` - [ ] Implement label operations with GitHub's label API - [ ] Implement assignee operations (multiple assignees) - [ ] Implement milestone operations - [ ] Implement `search_issues()` using GitHub's search syntax - [ ] Implement GraphQL queries for complex data fetching - [ ] Implement webhook handler for GitHub events - [ ] Handle GitHub rate limiting (primary, secondary, search) - [ ] Add connection retry with abuse detection - [ ] Write unit tests for all GitHub operations ### 6. GitLab Provider Implementation - [ ] Create `providers/gitlab.py` implementing `IssueProvider` - [ ] Implement authentication (Project/Group tokens, OAuth) - [ ] Implement `list_issues()` with GitLab pagination - [ ] Implement `get_issue()` with related merge requests - [ ] Implement `create_issue()` with confidential issues support - [ ] Implement `update_issue()` with weight/time tracking - [ ] Implement `delete_issue()` (close behavior) - [ ] Implement `list_comments()` (notes in GitLab) - [ ] Implement `add_comment()` and note operations - [ ] Implement `update_comment()` and `delete_comment()` - [ ] Implement label operations (project-level, group-level) - [ ] Implement assignee operations - [ ] Implement milestone operations (project/group milestones) - [ ] Implement `search_issues()` using GitLab's search API - [ ] Implement webhook handler for GitLab events - [ ] Handle GitLab rate limiting per endpoint - [ ] Add connection retry logic - [ ] Write unit tests for all GitLab operations ### 7. Unified Issue Model - [ ] Create `models/issue.py` with Pydantic models - [ ] Define `UnifiedIssue` model with common fields - [ ] Define `UnifiedComment` model - [ ] Define `UnifiedLabel` model with color normalization - [ ] Define `UnifiedMilestone` model - [ ] Define `UnifiedUser` model for assignees/authors - [ ] Define `IssueState` enum (open, closed, merged for MRs) - [ ] Define `IssuePriority` enum with provider mapping - [ ] Define `IssueType` enum (issue, bug, feature, task) - [ ] Create mappers from each provider to unified model - [ ] Create mappers from unified model to each provider - [ ] Handle provider-specific fields via metadata dict - [ ] Define `IssueSearchQuery` model with filter options - [ ] Add validation for required fields per provider ### 8. Sync Service Implementation - [ ] Create `sync/service.py` with `IssueSyncService` class - [ ] Implement initial full sync on startup - [ ] Implement incremental sync based on timestamps - [ ] Implement real-time sync via webhooks - [ ] Create sync status tracking with metrics - [ ] Implement sync queue for batched operations - [ ] Handle sync errors with retry and dead-letter queue - [ ] Implement sync conflict detection - [ ] Create sync audit log for debugging - [ ] Add sync progress reporting - [ ] Implement selective sync (by project, by label, etc.) - [ ] Add sync pause/resume functionality - [ ] Write integration tests for sync scenarios ### 9. Conflict Resolution - [ ] Create `sync/conflicts.py` with conflict handling - [ ] Define conflict types: field-level, state-level, delete-update - [ ] Implement "last-write-wins" strategy - [ ] Implement "source-of-truth" strategy (prefer one provider) - [ ] Implement "manual-resolution" strategy with queue - [ ] Create conflict notification system - [ ] Store conflict history for audit - [ ] Implement merge strategy for non-conflicting changes - [ ] Add conflict resolution UI hints in metadata - [ ] Write unit tests for each conflict scenario ### 10. Database Schema & Repository - [ ] Create `issues_sync_state` table for sync tracking - [ ] Create `issue_mappings` table (local_id ↔ provider_id mapping) - [ ] Create `sync_conflicts` table for unresolved conflicts - [ ] Create `sync_audit_log` table for debugging - [ ] Create `webhook_events` table for event deduplication - [ ] Create Alembic migrations for all tables - [ ] Implement `IssueMappingRepository` with CRUD operations - [ ] Implement `SyncStateRepository` for tracking - [ ] Implement `ConflictRepository` for conflict management - [ ] Add indexes for performance (provider+external_id, sync_status) ### 11. MCP Tools Definition - [ ] Create `list_issues` tool with filtering parameters - [ ] Filter by status (open, closed, all) - [ ] Filter by assignee - [ ] Filter by labels (include/exclude) - [ ] Filter by milestone - [ ] Filter by date range (created, updated) - [ ] Pagination support (page, per_page) - [ ] Sorting options (created, updated, priority) - [ ] Create `get_issue` tool with full details - [ ] Include comments option - [ ] Include timeline option - [ ] Include related issues option - [ ] Create `create_issue` tool - [ ] Title and description (markdown) - [ ] Labels assignment - [ ] Milestone assignment - [ ] Assignee(s) assignment - [ ] Priority setting - [ ] Due date setting - [ ] Create `update_issue` tool - [ ] Partial updates support - [ ] State transitions (open/close/reopen) - [ ] All field updates - [ ] Create `add_comment` tool - [ ] Markdown support - [ ] Mention detection - [ ] Create `search_issues` tool with advanced query - [ ] Full-text search in title/description - [ ] Boolean operators (AND, OR, NOT) - [ ] Field-specific search - [ ] Create `bulk_update_issues` tool for batch operations - [ ] Create `get_issue_stats` tool for analytics - [ ] Create `link_issues` tool for issue relationships - [ ] Document all tools with JSON Schema ### 12. Caching Layer - [ ] Create `cache/issue_cache.py` with Redis integration - [ ] Implement issue list caching with TTL - [ ] Implement individual issue caching - [ ] Implement label/milestone caching (longer TTL) - [ ] Implement cache invalidation on updates - [ ] Implement cache invalidation on webhook events - [ ] Add cache warming on startup - [ ] Add cache hit/miss metrics - [ ] Write tests for cache behavior ### 13. Webhook Handler - [ ] Create `webhooks/handler.py` for incoming webhooks - [ ] Implement Gitea webhook signature verification - [ ] Implement GitHub webhook signature verification - [ ] Implement GitLab webhook token verification - [ ] Handle issue.opened event - [ ] Handle issue.edited event - [ ] Handle issue.closed event - [ ] Handle issue.reopened event - [ ] Handle comment.created event - [ ] Handle comment.edited event - [ ] Handle comment.deleted event - [ ] Handle label events (added/removed) - [ ] Handle assignee events - [ ] Implement event deduplication - [ ] Add webhook event logging - [ ] Write integration tests for webhook handling ### 14. Error Handling & Resilience - [ ] Define custom exceptions in `exceptions.py` - [ ] Create `ProviderConnectionError` for network issues - [ ] Create `RateLimitExceededError` with retry-after - [ ] Create `AuthenticationError` for auth failures - [ ] Create `IssueNotFoundError` for 404 responses - [ ] Create `ConflictError` for sync conflicts - [ ] Implement circuit breaker for each provider - [ ] Implement retry with exponential backoff - [ ] Add graceful degradation (serve from cache on failure) - [ ] Add health check per provider - [ ] Write tests for error scenarios ### 15. Metrics & Observability - [ ] Add Prometheus metrics for operations - [ ] Track `issues_synced_total` counter - [ ] Track `sync_latency_seconds` histogram - [ ] Track `provider_errors_total` by provider and type - [ ] Track `cache_hit_ratio` gauge - [ ] Track `active_sync_jobs` gauge - [ ] Add structured logging for all operations - [ ] Add trace ID propagation for debugging - [ ] Create Grafana dashboard template - [ ] Add alerting rules for sync failures ### 16. Testing - [ ] Write unit tests for each provider (mocked HTTP) - [ ] Write unit tests for unified model mappers - [ ] Write unit tests for sync service logic - [ ] Write unit tests for conflict resolution - [ ] Write integration tests with real providers (optional, CI flag) - [ ] Write integration tests for MCP tools - [ ] Write integration tests for webhooks - [ ] Add load tests for concurrent operations - [ ] Achieve >90% code coverage - [ ] Add contract tests for provider API compatibility ### 17. Docker & Deployment - [ ] Create optimized Dockerfile with multi-stage build - [ ] Configure environment variables for all settings - [ ] Add health check endpoint - [ ] Add readiness probe endpoint - [ ] Configure resource limits (CPU, memory) - [ ] Add to docker-compose.mcp.yml - [ ] Configure volume mounts for persistent data - [ ] Add log rotation configuration - [ ] Document Kubernetes deployment (optional) ### 18. Documentation - [ ] Write README.md with overview and quick start - [ ] Document provider setup (Gitea, GitHub, GitLab) - [ ] Document authentication requirements per provider - [ ] Document all MCP tools with examples - [ ] Document sync behavior and conflict resolution - [ ] Document webhook configuration per provider - [ ] Document environment variables - [ ] Document troubleshooting guide - [ ] Add architecture diagram - [ ] Add sequence diagrams for sync flows --- ## Technical Specifications ### Provider API References - **Gitea**: https://gitea.com/api/swagger - **GitHub**: https://docs.github.com/en/rest/issues - **GitLab**: https://docs.gitlab.com/ee/api/issues.html ### Sync Strategy ``` ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │ Gitea API │◄───►│ Issues MCP │◄───►│ PostgreSQL │ ├─────────────────┤ │ Server │ │ (mappings) │ │ GitHub API │◄───►│ │ └─────────────────┘ ├─────────────────┤ │ - Sync Service │ │ GitLab API │◄───►│ - Webhooks │ ┌─────────────────┐ └─────────────────┘ │ - Cache (Redis) │◄───►│ Redis │ └──────────────────┘ │ (cache) │ └─────────────────┘ ``` ### Conflict Resolution Priority 1. Provider-specific metadata preserved 2. Last-modified timestamp wins for field conflicts 3. State changes (open/close) require explicit resolution 4. Comments never deleted (soft-delete with sync flag) --- ## Acceptance Criteria - [ ] All three providers (Gitea, GitHub, GitLab) fully implemented - [ ] Bi-directional sync working with <1 minute latency - [ ] Conflict resolution strategy configurable and working - [ ] All MCP tools operational and documented - [ ] Webhook handlers verified with real events - [ ] >90% test coverage - [ ] Performance: <500ms for single issue operations - [ ] Documentation complete with examples --- ## Labels `phase-2`, `mcp`, `backend`, `issues`, `sync` ## Milestone Phase 2: MCP Integration
cardosofelipe added the mcpphase-2 labels 2026-01-03 01:26:16 +00:00
Sign in to join this conversation.