Skip to main content
Glama
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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pbulbule13/mcpwithgoogle'

If you have feedback or need assistance with the MCP directory API, please join our Discord server