📚 Documentation has been reorganized! This document now provides a high-level overview. For detailed information, see the comprehensive documentation in the
/docsfolder.
An MCP (Model Context Protocol) server that provides a unified read and query interface for multiple email and calendar accounts across Microsoft 365 (multiple tenants), Outlook.com, and Google Workspace. This enables AI assistants (Claude Desktop, ChatGPT, GitHub Copilot, etc.) to access all your accounts simultaneously for tasks like summarizing emails across all inboxes, viewing consolidated calendar schedules, and finding available meeting times across all calendars.
Professionals working with multiple organizations often manage:
- Multiple M365 tenants (different work accounts)
- Personal Outlook.com accounts
- Google Workspace accounts
- Need unified AI-powered management across all accounts
Currently, no AI assistant (Claude, ChatGPT, Copilot) can access all these services simultaneously in a multi-tenant scenario.
Detailed documentation is organized by topic in the /docs folder:
- Architecture - High-level system design, components, and data flow
- MCP Tools - MCP tool definitions, workflows, and multi-account aggregation
- Routing - Smart router design, LLM backends, and account selection logic
- Authentication - Complete auth flows, token management, and per-account isolation
- Providers - Provider service implementations (M365, Google, Outlook.com)
- Security - Security considerations, credential storage, and best practices
- Configuration - All configuration examples (accounts, router, telemetry)
- Onboarding - CLI tool usage and account setup workflow
- Local Models - Recommended models for local routing with Ollama
- Telemetry - OpenTelemetry setup, logging, tracing, and metrics
- Implementation Plan - Development phases, next steps, and success metrics
- Prerequisites: Create app registrations - see Onboarding Prerequisites
- Install CLI:
dotnet tool install -g calendar-mcp-setup - Add Accounts:
calendar-mcp-setup add-account- see Onboarding Guide - Configure Router: Edit
appsettings.json- see Configuration Examples - Test:
calendar-mcp-setup test-account <account-id>
graph TD
A[AI Assistants<br/>Claude, ChatGPT, Copilot]
B[Calendar-Email MCP Server<br/>ModelContextProtocol]
C[Smart Router<br/>Configurable LLM Backend]
D[M365 Provider Service<br/>Microsoft.Graph SDK]
E[Google Provider Service<br/>Google.Apis SDK]
F[Outlook.com Provider Service<br/>Graph API]
G[Account Registry<br/>Configuration]
H[Credential Manager<br/>Per-Account Token Storage]
I[OpenTelemetry<br/>Logging, Tracing & Metrics]
A -->|MCP Protocol| B
B --> C
C --> D
C --> E
C --> F
B --> G
D --> H
E --> H
F --> H
B -.-> I
C -.-> I
D -.-> I
E -.-> I
F -.-> I
Key Principles:
- Provider ≠ Account: One provider service manages multiple accounts with isolated credentials
- Per-Account Isolation: Every account has its own authentication context and token storage
- Configurable AI: Users choose their routing backend (local vs cloud)
- Security First: Encrypted token storage, minimal privilege scopes, privacy-first telemetry
📖 See Architecture for complete component descriptions, technical stack, and design principles.
- Multi-account authentication and management
- Read-only email queries (unread, search, details)
- Read-only calendar queries (events, availability)
- Unified view aggregation across all accounts
- OpenTelemetry instrumentation for observability
- Send email from appropriate account (with smart routing)
- Create calendar events in appropriate calendar (with smart routing)
- Email threading and conversation tracking
- Advanced search with filters and date ranges
- Intelligent meeting time suggestions across calendars
- Automated meeting coordination via email
- Conflict detection and resolution
- Meeting preparation summaries
📖 See Implementation Plan for complete development roadmap, milestones, and timeline (~17 weeks / 4 months).
list_accounts- Get all configured accounts
get_emails- Get emails for specific account or all accountssearch_emails- Search emails by criteriaget_email_details- Get full email contentsend_email- Send email from appropriate account
list_calendars- List all calendarsget_calendar_events- Get events from calendarsfind_available_times- Find free time slots across all calendarscreate_event- Create calendar eventupdate_event/delete_event- Manage events
get_contacts- Get contacts from specific or all accountssearch_contacts- Search contacts by name, email, companyget_contact_details- Get full contact informationcreate_contact- Create new contactupdate_contact- Update existing contactdelete_contact- Delete contact
📖 See MCP Tools for complete tool definitions, parameters, and workflow examples.
- Language: C# / .NET 9+
- MCP Framework: ModelContextProtocol NuGet package (official .NET implementation)
- Provider SDKs: Microsoft.Graph, Google.Apis.Gmail/Calendar/PeopleService
- AI Routing: Configurable (Ollama, OpenAI, Anthropic, Azure OpenAI, custom)
- Authentication: OAuth 2.0 with MSAL (Microsoft) and GoogleWebAuthorizationBroker
- Observability: OpenTelemetry with multiple exporters
📖 See Architecture for complete dependency list and implementation strategy.
{
"accounts": [
{
"id": "work-account",
"displayName": "Work Account",
"provider": "microsoft365",
"domains": ["company.com"],
"configuration": {
"tenantId": "...",
"clientId": "...",
"scopes": ["Mail.Read", "Mail.Send", "Calendars.ReadWrite", "Contacts.ReadWrite"]
}
}
],
"router": {
"backend": "ollama",
"model": "phi3.5:3.8b",
"endpoint": "http://localhost:11434"
},
"telemetry": {
"enabled": true,
"redaction": {
"redactEmailContent": true,
"redactTokens": true,
"redactPii": true
}
}
}📖 See Configuration for complete examples including all providers, router backends, and telemetry settings.
Microsoft Accounts (M365 + Outlook.com):
- Encrypted token cache:
%LOCALAPPDATA%/CalendarMcp/msal_cache_{accountId}.bin - DPAPI encryption (Windows), Keychain (macOS)
Google Accounts:
- FileDataStore:
~/.credentials/calendar-mcp/{accountId}/ - Per-account directory isolation
Key Security Features:
- ✅ Separate token cache per account
- ✅ OS-level encryption (Microsoft)
- ✅ File permissions restricted to current user
- ✅ Cross-account contamination prevention
- ✅ Automatic token refresh per account
📖 See Authentication for complete auth flows and token lifecycle.
📖 See Security for comprehensive security best practices.
- Local: Ollama (Phi-3.5-mini, Qwen2-7B, Qwen2-1.5B)
- Cloud: OpenAI, Anthropic, Azure OpenAI
- Custom: Any OpenAI-compatible endpoint
- Explicit Account ID (highest priority)
- Domain Pattern Matching (e.g., @company.com → work account)
- LLM Classification (intelligent account selection)
- Default Account (fallback)
📖 See Routing for routing logic and examples.
📖 See Local Models for Ollama model recommendations.
- Structured Logging: Consistent context across all components
- Distributed Tracing: End-to-end request tracking
- Metrics Collection: Performance and usage analytics
- Multiple Exporters: Console, OTLP, Jaeger, Prometheus, Azure Monitor
- Privacy-First: Built-in redaction of sensitive data
Key Telemetry:
- Router decision latency and accuracy
- Provider service response times
- Authentication success/failure rates
- Token cache hit/miss rates
- API call volumes per account
📖 See Telemetry for configuration, instrumentation patterns, and metrics.
All three provider integrations have been validated through working spike projects:
- M365DirectAccess - Multi-tenant M365 support validated
- GoogleWorkspace - Gmail + Calendar APIs validated
- OutlookComPersonal - Personal MSA accounts validated
MIT or Apache 2.0 - permissive to encourage adoption
- Consultants managing multiple client accounts
- Contractors with multiple work engagements
- Professionals with separate work/personal accounts
- Anyone in multi-tenant scenarios
- No existing solution handles multi-tenant M365 + Google Workspace
- Configurable AI backend allows users to choose privacy/cost tradeoff
- Leverages proven MCP implementations
- Open source enables community contributions and customization
📖 See Implementation Plan for success metrics, risk management, and community strategy.
Current Status: ✅ Spike projects completed, ✅ Documentation organized
Immediate Next Steps:
- Set up main project structure with ModelContextProtocol package
- Define unified data models (EmailMessage, CalendarEvent, Account)
- Implement provider services (M365, Google, Outlook.com)
- Build MCP server with core tools
- Implement smart router with configurable backends
📖 See Implementation Plan for complete 8-phase development plan and ~17-week timeline.
This project will be open sourced under MIT or Apache 2.0 license. Contributions welcome!
Areas for Contribution:
- Additional provider implementations (iCloud, Exchange)
- Router accuracy improvements
- Performance optimizations
- Documentation and examples
- Testing and bug fixes
- Repository: (Will be public on GitHub)
- Issues: GitHub Issues (post-release)
- Discussions: GitHub Discussions (post-release)
- Documentation:
/docsfolder in repository