How hstern/activesync-mcp works
activesync-mcp is an MCP server that lets MCP clients read and manage Exchange ActiveSync mailbox data. The main runtime path starts in the CLI, loads account configuration, opens persistent state, builds the EAS manager and MCP server, then serves tool calls over stdio. Tool surfaces cover email, calendar, contacts, tasks, notes, directory search, settings, folders, and administration; optional push notifications report server-side changes. Setup, diagnostics, authentication, and durable sync state support that workflow. Several tool modules are indexed but not excerpted, so their internal call details are not inferred.
Main entry points: main.go CLI dispatch · server.go MCP server · config.go Account config · manager.go EAS manager
Components 20
CLI and setup
- CLI dispatch
cmd/activesync-mcp/main.go - Setup TUI
cmd/activesync-mcp/setup_tui.go - Config writer
cmd/activesync-mcp/setup_save.go - Account diagnostics
cmd/activesync-mcp/doctor.go
MCP runtime
- MCP server
lib/server/server.go - EAS manager
lib/server/manager.go
Mailbox tools
- Email reading
lib/server/tools_email.go - Email mutations
lib/server/tools_email_write.go - Calendar tools
lib/server/tools_calendar.go - Contacts tasks notes
lib/server/tools_pim.go - Folders and extras
lib/server/tools_extras.go
Configuration and auth
- Account config
lib/config/config.go - Write access policy
lib/config/access.go - TLS configuration
lib/config/tls.go - Kerberos auth
lib/server/kerberos.go - NTLM auth
lib/server/ntlm.go
State and notifications
- Persistent state
lib/store/bbolt.go - Push notifications
lib/server/push.go
Other components
- MCP client
- EAS mailbox
Connections 23
- MCP client → MCP server: sends tool calls
README.md - CLI dispatch → Account config: loads config
cmd/activesync-mcp/main.go - CLI dispatch → Persistent state: opens database
cmd/activesync-mcp/main.go - CLI dispatch → EAS manager: builds manager
cmd/activesync-mcp/main.go - CLI dispatch → MCP server: runs stdio server
cmd/activesync-mcp/main.go - CLI dispatch → Push notifications: starts controller
cmd/activesync-mcp/main.go - Setup TUI → Config writer: saves settings
- CLI dispatch → Setup TUI: dispatches setup
README.md - CLI dispatch → Account diagnostics: dispatches doctor
README.md - MCP server → Email reading: registers tools
lib/server/server.go - MCP server → Email mutations: registers tools
lib/server/server.go - MCP server → Calendar tools: registers tools
lib/server/server.go - MCP server → Contacts tasks notes: registers tools
lib/server/server.go - MCP server → Folders and extras: registers tools
lib/server/server.go - Email reading → EAS manager: gets client
lib/server/tools_email.go - Contacts tasks notes → EAS manager: gets client
lib/server/tools_pim.go - EAS manager → EAS mailbox: accesses mailbox
README.md - EAS manager → Persistent state: uses account state
- Account config → Write access policy: defines permissions
lib/config/access.go - Account config → TLS configuration: holds TLS settings
- Account config → Kerberos auth: configures auth
- Account config → NTLM auth: selects auth
- Push notifications → MCP client: emits updates
README.md