MCP GitHub Project Manager follows Clean Architecture principles with clear separation of concerns.
┌─────────────────────────────────────────────────────────────┐
│ MCP Layer │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Tool Defs │ │ Resources │ │ Request Handling │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Service Layer │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ ProjectMgmt │ │ AI Services │ │ Planning │ │
│ │ Service │ │ (PRD, Tasks) │ │ Services │ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ GitHub API │ │ Caching │ │ Resilience │ │
│ │ Repositories│ │ & Events │ │ (Circuit Breaker) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Domain Layer │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Entities │ │ Interfaces │ │ Zod Schemas │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Core business entities and type definitions:
| File | Purpose |
|---|---|
types.ts |
Core project, issue, milestone types |
ai-types.ts |
AI task generation and PRD types |
resource-schemas.ts |
Zod schemas for validation |
errors.ts |
Domain-specific error types |
External integrations and technical concerns:
| Directory | Purpose |
|---|---|
github/ |
GitHub REST/GraphQL API integration |
tools/ |
MCP tool definitions (116 tools) |
cache/ |
In-memory caching with TTL |
resilience/ |
Circuit breaker, retry policies |
events/ |
Webhook handling, event store |
health/ |
Health check endpoints |
Business logic coordination (17 services):
| Service | Responsibility |
|---|---|
ProjectManagementService |
Central orchestrator for project operations |
PRDGenerationService |
AI-powered PRD generation |
TaskGenerationService |
Task breakdown and estimation |
SprintPlanningService |
Sprint planning and capacity |
RoadmapPlanningService |
Milestone and roadmap planning |
SubIssueService |
Hierarchical issue management |
ProjectTemplateService |
Template management |
IssueTriagingService |
AI-powered issue triage |
Model Context Protocol integration:
- Tool registration and execution
- Resource exposure
- Request/response handling
- Error formatting
Uses tsyringe for IoC:
// src/container.ts
container.register("ProjectManagementService", {
useFactory: (c) => new ProjectManagementService(
c.resolve("GitHubProjectRepository"),
c.resolve("GitHubIssueRepository"),
// ...
)
});Abstracts data access:
// Domain interface
interface IProjectRepository {
findById(id: string): Promise<Project>;
save(project: Project): Promise<void>;
}
// Infrastructure implementation
class GitHubProjectRepository implements IProjectRepository {
// GitHub API calls
}Resilience for external APIs:
// Wraps GitHub API calls
const result = await circuitBreaker.execute(() =>
this.octokit.projects.get({ project_id })
);MCP Client Request
│
▼
┌─────────────────┐
│ Tool Handler │ ← Validates input with Zod
└────────┬────────┘
│
▼
┌─────────────────┐
│ Service │ ← Business logic
└────────┬────────┘
│
▼
┌─────────────────┐
│ Repository │ ← Data access abstraction
└────────┬────────┘
│
▼
┌─────────────────┐
│ GitHub API │ ← REST/GraphQL calls
└─────────────────┘
Multi-provider AI support:
┌─────────────────────────────────────┐
│ AIServiceFactory │
├─────────────────────────────────────┤
│ ┌─────────┐ ┌─────────┐ ┌───────┐ │
│ │Anthropic│ │ OpenAI │ │Google │ │
│ └─────────┘ └─────────┘ └───────┘ │
└─────────────────────────────────────┘
Used for:
- PRD generation and enhancement
- Task complexity analysis
- Issue enrichment and triage
- Label suggestions
- Duplicate detection
Environment-based configuration:
| Variable | Purpose |
|---|---|
GITHUB_TOKEN |
GitHub API authentication |
GITHUB_OWNER |
Repository owner |
GITHUB_REPO |
Repository name |
ANTHROPIC_API_KEY |
Claude AI (optional) |
OPENAI_API_KEY |
OpenAI (optional) |
GOOGLE_AI_API_KEY |
Google AI (optional) |
See CONFIGURATION.md for full details.