PROJECT_STRUCTURE.mdโข14.6 kB
# Enhanced MCP Server - Complete Project Structure
## ๐ Complete Directory Structure
```
enhanced-mcp-server/
โ
โโโ ๐ requirements.txt โ
Created - Python dependencies
โโโ ๐ .env.example โ
Created - Environment variables template
โโโ ๐ .gitignore โณ To create
โโโ ๐ README.md โณ To create
โโโ ๐ SETUP.md โณ To create
โโโ ๐ PROJECT_STRUCTURE.md โ
Created - This file
โ
โโโ ๐ config/
โ โโโ ๐ config.yaml โ
Created - Main configuration
โ โโโ ๐ config.example.yaml โณ To create
โ
โโโ ๐ src/
โ โโโ ๐ __init__.py โณ To create
โ โโโ ๐ mcp_server.py โณ To create - Main MCP server
โ โโโ ๐ setup.py โณ To create - Setup script
โ โ
โ โโโ ๐ models/ - Pydantic models
โ โ โโโ ๐ __init__.py โณ To create
โ โ โโโ ๐ llm_models.py โ
Created
โ โ โโโ ๐ email_models.py โ
Created
โ โ โโโ ๐ calendar_models.py โ
Created
โ โ โโโ ๐ job_tracking_models.py โ
Created
โ โ โโโ ๐ notification_models.py โณ To create
โ โ โโโ ๐ drive_models.py โณ To create
โ โ
โ โโโ ๐ adapters/ - Google API adapters
โ โ โโโ ๐ __init__.py โณ To create
โ โ โโโ ๐ gmail_adapter.py โณ To create
โ โ โโโ ๐ calendar_adapter.py โณ To create
โ โ โโโ ๐ drive_adapter.py โณ To create
โ โ โโโ ๐ sheets_adapter.py โณ To create
โ โ โโโ ๐ keep_adapter.py โณ To create
โ โ
โ โโโ ๐ workflows/ - LangGraph workflows
โ โ โโโ ๐ __init__.py โณ To create
โ โ โโโ ๐ email_processing.py โณ To create
โ โ โโโ ๐ calendar_management.py โณ To create
โ โ โโโ ๐ job_tracking.py โณ To create
โ โ โโโ ๐ notification_workflow.py โณ To create
โ โ
โ โโโ ๐ schedulers/ - Task schedulers
โ โ โโโ ๐ __init__.py โณ To create
โ โ โโโ ๐ email_scheduler.py โณ To create
โ โ โโโ ๐ calendar_scheduler.py โณ To create
โ โ โโโ ๐ notification_scheduler.py โณ To create
โ โ
โ โโโ ๐ utils/ - Utilities
โ โ โโโ ๐ __init__.py โณ To create
โ โ โโโ ๐ llm_manager.py โ
Created - LLM fallback system
โ โ โโโ ๐ circuit_breaker.py โ
Created - Circuit breaker pattern
โ โ โโโ ๐ rate_limiter.py โ
Created - Rate limiting
โ โ โโโ ๐ google_auth.py โ
Created - Google OAuth
โ โ โโโ ๐ config_loader.py โ
Created - Configuration loader
โ โ โโโ ๐ logger.py โณ To create
โ โ โโโ ๐ database.py โณ To create
โ โ โโโ ๐ helpers.py โณ To create
โ โ
โ โโโ ๐ tools/ - MCP tools (organized by domain)
โ โโโ ๐ __init__.py โณ To create
โ โโโ ๐ email_tools.py โณ To create
โ โโโ ๐ calendar_tools.py โณ To create
โ โโโ ๐ job_tracking_tools.py โณ To create
โ โโโ ๐ drive_tools.py โณ To create
โ โโโ ๐ sheets_tools.py โณ To create
โ โโโ ๐ keep_tools.py โณ To create
โ
โโโ ๐ data/ - Database and persistent data
โ โโโ ๐ .gitkeep โณ To create
โ โโโ ๐ enhanced_mcp.db (Auto-generated)
โ
โโโ ๐ logs/ - Application logs
โ โโโ ๐ .gitkeep โณ To create
โ
โโโ ๐ docs/ - Documentation
โ โโโ ๐ index.html โณ To create - Main docs page
โ โโโ ๐ architecture.md โณ To create - Architecture overview
โ โโโ ๐ api_reference.md โณ To create - API documentation
โ โโโ ๐ workflows.md โณ To create - Workflow diagrams
โ โโโ ๐ deployment.md โณ To create - Deployment guide
โ โโโ ๐ llm_fallback.md โณ To create - LLM system docs
โ โโโ ๐ diagrams/ - Mermaid diagrams
โ โโโ ๐ system_architecture.md โณ To create
โ โโโ ๐ llm_fallback_flow.md โณ To create
โ โโโ ๐ email_workflow.md โณ To create
โ โโโ ๐ calendar_workflow.md โณ To create
โ
โโโ ๐ tests/ - Test suite
โ โโโ ๐ __init__.py โณ To create
โ โโโ ๐ test_llm_manager.py โณ To create
โ โโโ ๐ test_adapters.py โณ To create
โ โโโ ๐ test_workflows.py โณ To create
โ
โโโ ๐ scripts/ - Utility scripts
โโโ ๐ setup.sh โณ To create
โโโ ๐ test_llm_fallback.py โณ To create
โโโ ๐ verify_installation.py โณ To create
```
## โ
Files Created So Far
### Core Configuration (4 files)
1. **requirements.txt** - All Python dependencies
2. **.env.example** - Environment variables template
3. **config/config.yaml** - Complete application configuration
4. **PROJECT_STRUCTURE.md** - This file
### LLM System (3 files)
5. **src/utils/llm_manager.py** - Multi-provider LLM manager with fallback
6. **src/utils/circuit_breaker.py** - Circuit breaker pattern implementation
7. **src/utils/rate_limiter.py** - Token bucket rate limiter
### Pydantic Models (4 files)
8. **src/models/llm_models.py** - LLM request/response models
9. **src/models/email_models.py** - Email data models
10. **src/models/calendar_models.py** - Calendar event models
11. **src/models/job_tracking_models.py** - Job application models
### Authentication & Config (2 files)
12. **src/utils/google_auth.py** - Enhanced Google OAuth 2.0
13. **src/utils/config_loader.py** - Configuration management
## ๐ Total Files Status
- โ
**Created**: 13 files
- โณ **To Create**: ~40 files
- **Total**: ~53 files
## ๐ฏ Priority Files to Create Next
### Phase 1: Core Adapters (High Priority)
1. **src/adapters/gmail_adapter.py** - Enhanced Gmail operations
2. **src/adapters/calendar_adapter.py** - Enhanced Calendar operations
3. **src/adapters/drive_adapter.py** - Google Drive integration
4. **src/adapters/sheets_adapter.py** - Enhanced Sheets operations
5. **src/adapters/keep_adapter.py** - Google Keep integration
### Phase 2: MCP Tools (High Priority)
6. **src/tools/email_tools.py** - Email MCP tool definitions
7. **src/tools/calendar_tools.py** - Calendar MCP tool definitions
8. **src/tools/job_tracking_tools.py** - Job tracking tool definitions
### Phase 3: Main Server (Critical)
9. **src/mcp_server.py** - Main MCP server with all tools registered
10. **src/setup.py** - Interactive setup script
### Phase 4: Workflows (Medium Priority)
11. **src/workflows/email_processing.py** - LangGraph email workflow
12. **src/workflows/job_tracking.py** - Job tracking workflow
13. **src/workflows/calendar_management.py** - Calendar workflow
### Phase 5: Schedulers (Medium Priority)
14. **src/schedulers/email_scheduler.py** - Email summary scheduler
15. **src/schedulers/notification_scheduler.py** - Notification scheduler
### Phase 6: Documentation (High Priority)
16. **README.md** - Main project README
17. **SETUP.md** - Setup guide
18. **docs/index.html** - Documentation portal
19. **docs/architecture.md** - Architecture with Mermaid diagrams
20. **docs/llm_fallback.md** - LLM fallback documentation
## ๐๏ธ Architecture Overview
### System Components
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Claude Desktop โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ JSON-RPC (stdio)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Server (mcp_server.py) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Tool Registry: 30+ Tools โ โ
โ โ - Email Tools (10+) โ โ
โ โ - Calendar Tools (8+) โ โ
โ โ - Job Tracking Tools (6+) โ โ
โ โ - Drive Tools (4+) โ โ
โ โ - Sheets Tools (4+) โ โ
โ โ - Keep Tools (3+) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ LLM Manager โ โ Google Adapters โ โ Schedulers โ
โ (Fallback) โ โ - Gmail โ โ - Email โ
โ โ โ - Calendar โ โ - Calendar โ
โ โข Euri โ โ - Drive โ โ - Notif. โ
โ โข Deepseek โ โ - Sheets โ โโโโโโโโโโโโโโ
โ โข Gemini โ โ - Keep โ
โ โข Claude โ โโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโดโโโโโโโโโโโ
โ Circuit Breaker โ
โ Rate Limiter โ
โ Health Checks โ
โโโโโโโโโโโโโโโโโโโโ
```
### LLM Fallback Flow
```
Request โ Euri โโโโโโ Deepseek โโโโโโ Gemini โโโโโโ Claude โโโโโโ Error
โ โ โ โ
โ โ โ โ
Success Success Success Success
```
### Data Flow
```
User Request (Claude Desktop)
โ
MCP Tool Called
โ
Adapter Processes Request
โ
Google API Called
โ
LLM Processing (if needed)
โ
Response Formatted
โ
Returned to Claude Desktop
โ
Scheduler Triggers (if applicable)
โ
Background Tasks Execute
```
## ๐ Key Features Implemented
### โ
Completed
- [x] Multi-provider LLM fallback system (Euri โ Deepseek โ Gemini โ Claude)
- [x] Circuit breaker pattern for failure prevention
- [x] Token bucket rate limiting
- [x] Production-grade Google OAuth 2.0
- [x] Environment-based configuration with YAML support
- [x] Comprehensive Pydantic models for type safety
- [x] Structured logging foundation
### โณ To Implement
- [ ] Gmail integration (search, categorize, summarize, send)
- [ ] Calendar integration (events, reminders, conflicts)
- [ ] Job application tracking system
- [ ] Google Drive integration
- [ ] Google Sheets enhanced features
- [ ] Google Keep integration
- [ ] Email auto-summarization (every 4 hours)
- [ ] Calendar reminders (15 min, 1 hr, 1 day before)
- [ ] LangGraph workflows
- [ ] APScheduler for scheduled tasks
- [ ] Database persistence (SQLite)
- [ ] Health checks and monitoring
- [ ] Comprehensive documentation
## ๐ Quick Start (After Completion)
```bash
# 1. Install dependencies
pip install -r requirements.txt
# 2. Copy environment file
cp .env.example .env
# 3. Edit .env with your API keys
# Add Google, Euri, Deepseek, Gemini, Claude keys
# 4. Run setup
python src/setup.py
# 5. Configure Claude Desktop
# Edit claude_desktop_config.json
# 6. Restart Claude Desktop
# Tools will appear automatically
```
## ๐ Statistics
- **Total Lines of Code Created**: ~3,000+ lines
- **API Integrations**: 6 (Gmail, Calendar, Drive, Sheets, Keep, LLM providers)
- **LLM Providers Supported**: 4
- **MCP Tools**: 30+ planned
- **Scheduled Tasks**: 5+ types
- **Production Features**: Circuit breakers, rate limiting, health checks, monitoring
## ๐ฏ Next Steps
1. **Create remaining adapters** - Gmail, Calendar, Drive, Sheets, Keep
2. **Create MCP tools** - Tool definitions for all features
3. **Create main MCP server** - Integrate everything
4. **Create workflows** - LangGraph orchestration
5. **Create schedulers** - APScheduler for automated tasks
6. **Create documentation** - Comprehensive guides with Mermaid diagrams
7. **Testing** - Unit and integration tests
8. **Deployment** - Docker, scripts, guides
---
**Status**: ๐ง In Progress - Core foundation complete, building features