The MCP Context Engine is a multi-tenant SaaS platform that aggregates developer context from multiple sources (GitHub, Slack, Discord) and provides intelligent context retrieval through MCP-compatible tools.
┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Landing Page │ │ Dashboard │ │ Auth Pages │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ API Gateway Layer │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ HTTP Server (Go) - Authentication & Authorization │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ MCP Tools │ │ Integration │ │ Project │
│ Service │ │ Service │ │ Management │
└──────────────┘ └──────────────┘ └──────────────┘
│ │ │
└───────────────────┼───────────────────┘
▼
┌─────────────────────────────────────────────────────────────┐
│ Business Logic Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Connector │ │ Context │ │ Knowledge │ │
│ │ Manager │ │ Processor │ │ Graph │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ┌──────┴──────┐ │ │ │
│ │ GitHub │ │ │ │
│ │ Slack │ │ │ │
│ │ Discord │ │ │ │
│ └─────────────┘ │ │ │
└────────────────────────────┼──────────────────┼──────────────┘
▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ Data Layer │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ PostgreSQL │ │ Vector │ │ Cache │ │
│ │ Database │ │ Embeddings │ │ (Redis) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Landing Page: Marketing site with product information
- Dashboard: Project management and integration configuration
- Auth Pages: Login, signup, and OAuth flows
- HTTP Server: Go-based REST API
- Authentication: JWT-based auth with OAuth support
- Authorization: Role-based access control (RBAC)
- Rate Limiting: Per-user and per-project limits
Provides 5 MCP-compatible tools:
search_project_knowledgeget_context_for_fileget_decision_historylist_recent_architecture_discussionsexplain_why_code_exists
Manages platform integrations:
- GitHub Integration: OAuth, repository selection, webhook handling
- Slack Integration: OAuth, channel selection, message ingestion
- Discord Integration: Bot token, server/channel selection
Orchestrates data ingestion from platforms:
- Platform Connectors: GitHub, Slack, Discord
- Ingestion Orchestrator: Schedules and manages sync jobs
- Deduplication: Prevents duplicate event processing
- Retry Logic: Handles failures with exponential backoff
AI-powered context extraction:
- Decision Extraction: Identifies architectural decisions
- Discussion Summarization: Summarizes conversations
- Relationship Identification: Links files, features, contributors
- Feature Context: Builds feature development history
Stores and queries project knowledge:
- Entities: Features, Files, Decisions, Discussions, Contributors
- Relationships: relates_to, introduced_by, modified_by, discussed_in
- Vector Search: Semantic search using embeddings
- Graph Traversal: Relationship exploration
- PostgreSQL: Primary data store
- Vector Embeddings: Semantic search (pgvector)
- Cache: Redis for frequently accessed data
External Platform → Connector → Normalization → Context Processor
↓
Knowledge Graph
↓
Database
IDE/Client → MCP Tool → Knowledge Graph → Vector Search
↓
Response Optimization
↓
Formatted Result
- Database Level: All tables include
project_idfor isolation - API Level: All requests scoped to authenticated user's projects
- Data Level: Complete separation of project data
- Authentication: JWT tokens with project claims
- Authorization: RBAC with project-level permissions
- Encryption: AES-256-GCM for sensitive data
- Audit Logging: All operations logged with user context
- Stateless API: Can run multiple instances
- Job Queue: Distributed ingestion processing
- Database Pooling: Connection pool management
- Caching: Redis for hot data
- Batch Processing: Efficient bulk operations
- Incremental Sync: Only fetch new data
- Query Optimization: Indexed queries, materialized views
- Response Streaming: Large results streamed to client
- Language: Go 1.21+
- Framework: Standard library + Chi router
- Database: PostgreSQL 14+ with pgvector
- Cache: Redis (optional)
- HTML/CSS/JavaScript: Vanilla JS for landing page
- Framework: React/Vue (for dashboard - future)
- Containerization: Docker
- Orchestration: Kubernetes
- CI/CD: GitHub Actions
- Monitoring: Prometheus + Grafana
- JWT Tokens: Stateless authentication
- OAuth 2.0: GitHub, Google integration
- Session Management: Secure token storage
- RBAC: Role-based access control
- Project Permissions: Owner, Admin, Member, Viewer
- API Scoping: All endpoints project-scoped
- Encryption at Rest: AES-256-GCM
- Encryption in Transit: TLS 1.3
- Credential Storage: Encrypted in database
- Secrets Management: Environment variables + secret files
Docker Compose → PostgreSQL + App + Redis
Kubernetes Cluster
├── API Pods (3+ replicas)
├── Worker Pods (2+ replicas)
├── PostgreSQL (managed service)
└── Redis (managed service)
- Real-time ingestion via webhooks
- Advanced analytics dashboard
- Custom MCP tool creation
- Plugin system for custom connectors
- GraphQL API
- Mobile app
- Event streaming (Kafka)
- Distributed caching (Redis Cluster)
- Read replicas for queries
- CDN for static assets
- Edge computing for global distribution