How doublebash/outlook-mcp works
Outlook MCP Server exposes Microsoft 365 operations as MCP tools: a client invokes a named tool, the Worker dispatches it to a domain handler, and handlers use Microsoft Graph to read or mutate mailbox data. Authentication stores encrypted Microsoft tokens in Cloudflare KV and supplies access tokens to Graph requests. The graph preserves the documented mail, calendar, contacts, tasks, files, Teams meeting, and settings capabilities. Several domain handlers were not excerpted, so their internal behavior is not expanded beyond documented capabilities and indexed imports.
Main entry points: graph.ts Graph client · tools/index.ts Tool dispatch · calendar.ts Calendar tools · src/index.ts Worker entry
Components 21
MCP runtime
- Worker entry
src/index.ts - Tool dispatch
src/tools/index.ts - Shared tool utilities
src/tools/_shared.ts - Graph data sanitizers
src/sanitize.ts
Identity and Graph
- OAuth token store
src/auth.ts - Graph client
src/graph.ts
- Email tools
src/tools/email.ts - Email attachments
src/tools/attachments.ts - Email composition helpers
src/email-helpers.ts - Signature handling
src/signature.ts
Outlook data
- Calendar tools
src/tools/calendar.ts - Calendar helpers
src/calendar-helpers.ts - Contact tools
src/tools/contacts.ts - Task tools
src/tools/tasks.ts - Mailbox settings
src/tools/mailbox.ts
Files and meetings
- OneDrive tools
src/tools/files.ts - Teams meeting tools
src/tools/meetings.ts - Transcript helpers
src/transcript-helpers.ts
Other components
- MCP client
- Microsoft Graph
- Cloudflare KV
Connections 35
- MCP client → Worker entry: calls MCP
README.md - Worker entry → Tool dispatch: dispatches tools
src/index.ts - Tool dispatch → Email tools: routes calls
src/tools/index.ts - Tool dispatch → Email attachments: routes calls
src/tools/index.ts - Tool dispatch → Calendar tools: routes calls
src/tools/index.ts - Tool dispatch → Contact tools: routes calls
src/tools/index.ts - Tool dispatch → Task tools: routes calls
src/tools/index.ts - Tool dispatch → Mailbox settings: routes calls
src/tools/index.ts - Tool dispatch → OneDrive tools: routes calls
src/tools/index.ts - Tool dispatch → Teams meeting tools: routes calls
src/tools/index.ts - Worker entry → OAuth token store: uses OAuth
src/index.ts - Worker entry → Graph client: uses Graph client
src/index.ts - OAuth token store → Cloudflare KV: stores tokens
src/auth.ts - Graph client → OAuth token store: gets access token
src/graph.ts - Graph client → Microsoft Graph: sends Graph requests
src/graph.ts - Email tools → Graph client: reads and writes
src/tools/email.ts - Email attachments → Graph client: reads and writes
src/tools/attachments.ts - Calendar tools → Graph client: reads and writes
src/tools/calendar.ts - Contact tools → Graph client: reads and writes
src/tools/contacts.ts - Task tools → Graph client: reads and writes
src/tools/tasks.ts - Mailbox settings → Graph client: reads and writes
src/tools/mailbox.ts - OneDrive tools → Graph client: reads and writes
src/tools/files.ts - Teams meeting tools → Graph client: reads and writes
src/tools/meetings.ts - Email tools → Email composition helpers: builds messages
src/tools/email.ts - Email tools → Signature handling: adds signatures
src/tools/email.ts - Calendar tools → Calendar helpers: builds recurrence
src/tools/calendar.ts - Calendar tools → Signature handling: adds signatures
src/tools/calendar.ts - Email composition helpers → Graph client: fetches OneDrive bytes
src/email-helpers.ts - Signature handling → Email composition helpers: sanitizes HTML
src/signature.ts - Teams meeting tools → Transcript helpers: uses transcript helpers
src/tools/meetings.ts - Task tools → Graph data sanitizers: formats task lists
src/tools/tasks.ts - OneDrive tools → Graph data sanitizers: formats file lists
src/tools/files.ts - Contact tools → Graph data sanitizers: formats contacts
src/tools/contacts.ts - Calendar tools → Graph data sanitizers: formats events
src/tools/calendar.ts - Tool dispatch → Shared tool utilities: uses shared schemas