How are integrations (email, calendar, chat, docs) implemented?
Which services; API clients vs MCP; OAuth flow; token storage; sync vs on-demand fetch.
Verdict
For email, Inbox Zero is the only project with deep native Gmail and Outlook clients. To reach the assistant from chat apps, OpenClaw and Hermes Agent cover the most platforms.
Native mail, calendar and content clients. Inbox Zero implements one EmailProvider interface for Gmail and Outlook. Pub/Sub or Graph webhooks push new mail, and tokens live in Postgres. MCP servers only add context to drafts. QM stores OAuth tokens in an encrypted keychain for each scope, and the agent mostly uses them from shell commands in its sandbox. The editor confirmed that it also has admin-registered, audited MCP servers and an Inbox loop that rescans Gmail and Slack every 15 minutes. Leon declares Gmail, Notion and TickTick in JSON toolkits, encrypts credentials with AES-256-GCM per profile, and offers a setup_connection tool when a call lacks credentials. Khoj treats Notion (OAuth) and GitHub (token) as content to index, not as services to act on.
Managed catalogues. OpenBot routes Composio, MCP and a Google Drive REST adapter through one listTools/callTool interface. Its credentials are AES-GCM encrypted and cannot be read back. Rakazo stacks Composio, Pipedream Connect, remote MCP and any OpenAPI document. Stdio MCP needs a flag and an allowlist, and tools are discovered when each run starts.
Chat channels first, MCP for the rest. OpenClaw ships about 28 ChannelPlugins with pairing and group policy. Hermes Agent reaches about 20 platforms; most adapters are plugins under plugins/platforms/, a point the editor corrected. Agenvoy supports only Telegram and Discord and has no first-party mail or calendar tools. MCP tools are named mcp__<server>__<tool>, and keys live in the OS keychain. Waku adds Google Calendar OAuth and an MCP OAuth flow on a loopback port. Apple Calendar writes are opt-in.
Pick: Inbox Zero for automated email triage. Pick: OpenBot or Rakazo for broad SaaS access without writing clients. Pick: OpenClaw or Hermes Agent to talk to your agent from existing chat apps.
Per-project answers
openclaw/openclaw
answeredSupported services. OpenClaw connects to 20+ messaging platforms through a channel plugin system. Each platform implements the ChannelPlugin type (src/channels/plugins/types.plugin.ts:48) which exposes adapters for config, auth, outbound messaging, threading, approvals, status, security, pairing, directory resolution, and more. Bundled channel IDs are generated in src/channels/bundled-channel-ids.generated.ts. The plugin registry (src/channels/plugins/registry.ts) manages discovery and loading.
API clients vs MCP. Channels are native plugins with full lifecycle — config setup wizards (src/channels/plugins/setup-wizard.ts), OAuth flows, webhook receivers, outbound message formatting, and streaming. This is separate from MCP, which is managed through the MCP tool bundle system in src/agents/agent-bundle-mcp-*.ts
OAuth flow. Provider OAuth callbacks are handled by src/gateway/provider-browser-auth.ts via the PROVIDER_OAUTH_CALLBACK_PATH route. Channel plugins have their own auth adapters (ChannelAuthAdapter). The Gateway supports browser-based OAuth for model providers and channel-specific auth flows.
Token storage. Secrets and credentials are managed by src/secrets/ — including resolve-store.ts, configure-plan.ts, trusted-plan-path.ts, and per-channel persisted auth state in src/channels/plugins/persisted-auth-state.ts. The Gateway's credential-planner.ts plans credential provisioning. Token material is stored in SQLite via the secrets subsystem with encryption support (src/storage/encryption.ts).
Sync vs on-demand. Channels are event-driven: incoming messages (webhooks, socket events) trigger session creation and agent runs. The auto-reply/ module handles responses and memory flushes. There is also a cron subsystem (src/cron/) for scheduled/sync operations.
NousResearch/hermes-agent
answeredSupported services: Telegram, Discord, Slack, WhatsApp Cloud, Signal, email (IMAP), WeChat Work (yuanbao), QQ Bot, Microsoft Teams, Google Chat, BlueBubbles (Apple Messages), and a generic webhook adapter. Each lives in gateway/platforms/ as a subclass of BasePlatformAdapter (gateway/platforms/base.py:1).
API clients vs MCP: All integrations use direct HTTP API clients (Telegram bot API, Discord gateway, WhatsApp Cloud API, Microsoft Graph API, etc.) — there are no MCP-based chat adapters. The project has a separate tools/mcp_tool*.py system for MCP tool servers (not messaging).
OAuth flow: Calendars and email (Microsoft Graph) route through tools/microsoft_graph_auth.py using OAuth 2.0 device-code or authorization-code flows with token refresh. Microsoft Teams gateway auth (TEAMS_CLIENT_ID/TEAMS_CLIENT_SECRET) is configured via env vars in docker-compose.yml:44-50. Credentials persist to ~/.hermes/.env or the SQLite credential store.
Token storage: API keys and OAuth tokens go to the profile-scoped .env file via credential_persistence.py/secret_scope.py. Gateway platform tokens (Telegram bot tokens, Slack signing secrets, etc.) are read from env vars or ~/.hermes/config.yaml.
Sync vs on-demand fetch: Messaging is push-based — platforms deliver webhooks or long-poll updates to the gateway, which fans them out to per-session agent instances. No periodic polling for new messages; the gateway maintains persistent connections (Telegram getUpdates, Discord gateway, Slack Socket Mode, etc.). The cron scheduler (hermes_cli/cron.py) runs periodic jobs that inject prompts into the agent loop.
plugins/platforms/<name>/ with a plugin.yaml; gateway/platforms/ holds the base adapter, the API server and a handful of built-in adapters such as Signal, BlueBubbles and WhatsApp Cloud.khoj-ai/khoj
answeredKhoj integrates with several external services, each implemented differently:
Notion. OAuth 2.0 flow handled in routers/notion.py. The user is redirected to Notion's authorization page; the callback exchanges the code for an access token (using Basic Auth with NOTION_OAUTH_CLIENT_ID/SECRET), stores it in the NotionConfig model (Django DB), and triggers configure_content() to index Notion pages. No refresh-token logic — the token is stored as-is.
GitHub. processor/content/github/github_to_entries.py uses a Personal Access Token (PAT) stored in GithubConfig to clone repo file trees via the GitHub REST API (e.g., api.github.com/repos/{owner}/{name}/contents/). Supports multiple repos per user. Rate-limit aware: waits on X-RateLimit-Reset headers.
Email. routers/email.py uses Resend (via the resend Python SDK) to send magic-link login emails, welcome emails, and feedback forms. Configured via RESEND_API_KEY env var. Falls back silently if not configured.
Online search and web scraping. processor/tools/online_search.py supports six search/read providers: Google Search API, SerperDev, SearXNG, Exa, Firecrawl, and Olostep. Each is configured via env vars (GOOGLE_SEARCH_API_KEY, SERPER_DEV_API_KEY, KHOJ_SEARXNG_URL, etc.) and the active scraper is a model-priority chain in WebScraper/ServerChatSettings. Direct HTTP fetching is used via aiohttp and BeautifulSoup/markdownify for webpages.
MCP (Model Context Protocol). processor/tools/mcp.py implements a generic MCP client that connects to external servers via stdio (for .py/.js scripts) or SSE (for HTTP URLs). MCP servers are stored in the McpServer Django model. The MCPClient class lists available tools and calls them by name.
Phone (Twilio). Optional phone integration via routers/api_phone.py / routers/twilio.py.
Audio. Text-to-speech via ElevenLabs (processor/speech/text_to_speech.py). Speech-to-text via OpenAI Whisper.
Image generation. Via OpenAI DALL-E, Replicate, or Google Imagen (TextToImageModelConfig).
All integrations are on-demand: triggered by the user query, not synced in the background. Content indexing (Notion, GitHub, local files) is triggered manually or via the APScheduler-based periodic indexer.
leon-ai/leon
answeredLeon integrates external services via the Toolkit + Connection system rather than MCP. Services are declared in JSON toolkit manifests under /tools/ — organized by domain (e.g. communication/gmail, productivity_collaboration/notion, search_web/hosted, calendar_scheduling). Each tool has a tool.json (e.g. tools/communication/gmail/tool.json, lines 1–136) describing its functions, parameters, and connection requirements. Connections support two auth methods: OAuth and API key, both managed through server/src/core/connections/. The OAuth flow goes through oauth-manager.ts (lines 30–88): it generates PKCE challenge/verifier, redirects via browser to the provider's authorization URL, then exchanges the code for tokens at the token URL. Tokens are encrypted at rest in connection-store.ts using AES-256-GCM with a per-profile encryption key (LEON_CONNECTIONS_ENCRYPTION_KEY, line 13). The connection-tool.ts (lines 55–60) exposes a setup_connection tool the agent can call to submit credentials, and connection-catalog.ts retrieves credentials scoped to only declared fields. Each profile gets isolated encrypted connection storage. Lee also discovers Fellows (other AI coding tools like Claude Code, Codex, etc.) via server/src/core/llm-manager/fellows/ to reuse their existing API keys — fellows.json lists their config file locations and key names. Token refresh is handled transparently via refreshTokenIfNeeded using the supports_refresh field in the OAuth config (Gmail example has it enabled, line 33). The Satellite system (server/src/satellite.ts) allows running device-bound tools (e.g. Gmail, file system) from a remote Leon server by proxying tool calls through an encrypted Socket.IO tunnel. This is an on-demand architecture: tools declare their connection needs; the agent loads the toolkit, discovers it needs a connection, presents a setup widget, and only then uses the API.
yc-software/qm
answeredExternal services (email/calendar/chat/docs) are connected via OAuth flows routed through a central connectors/oauth system (src/connectors/oauth.ts). Each OAuth provider (Google, GitHub, Slack, X, etc.) defines a provider config with authUrl, tokenUrl, scopes, clientIdEnv, PKCE support, and custom exchange/refresh adapters. The PROVIDERS map in oauth.ts centralizes all connector definitions. OAuth tokens are stored encrypted per-scope in the keychain (src/credentials/keychain.ts), persisted in Postgres, with encrypted fields (encryptSecret/decryptSecret in connector-client-store.ts). Token refresh uses stored refresh tokens. There is no MCP-based integration layer for external services — direct API clients are used. Slack itself is unique: it's an in-process plugin (src/slack/index.ts) using Bolt for events and the web API client for messaging, started and supervised directly by core. Gmail push notifications use a separate createGmailPushClient (src/wiring.ts:27) for background mail syncing. Gmail sent mail handling is at src/connectors/gmail-sent.ts. The web UI (plugins/web-ui/src/connectors.ts, plugins/web-ui/src/connector-widget.ts) renders the connection management UI. A Composio bridge exists (src/api/routes/composio.ts) for third-party app integrations with on-demand consent flows. Connector status freshness is tracked via src/credentials/connector-status.ts. Sync is on-demand (per-turn keychain manifest injection) — there is no general background sync engine for connectors, though Gmail push and crons provide some background access.
<serverId>_<toolName> tools. Background sync also exists: the Inbox loop (src/loops/inbox-loop.ts) rescans Gmail and Slack every 15 minutes by default.elie222/inbox-zero
answeredSupported services. The app integrates with Google/Gmail (Gmail API, Google People API, Google Calendar) and Microsoft Outlook (Microsoft Graph API for both mail and calendar). It also connects to Slack and Discord as messaging channels via MessagingChannel (apps/web/prisma/schema.prisma:1700), and Google Drive/OneDrive via DriveConnection (apps/web/prisma/schema.prisma:1800). There is no MCP integration for external services in the chat assistant — it's all native API clients.
API clients vs MCP. The app uses the official Google and Microsoft SDKs directly. GmailProvider (apps/web/utils/email/google.ts:131) wraps @googleapis/gmail with OAuth token refresh. OutlookProvider (apps/web/utils/email/microsoft.ts:141) wraps the Microsoft Graph API. Calendar integrations use GoogleCalendarEventProvider and MicrosoftCalendarEventProvider (apps/web/utils/calendar/providers/). There is also MCP server support (an MCP server that exposes Inbox Zero data to external AI clients) and MCP connections the assistant can configure, but the assistant's own tools do not use MCP.
OAuth flow. OAuth tokens are obtained through NextAuth.js-based flows. For Google, the getGmailClientWithRefresh function (apps/web/utils/gmail/client.ts:52) creates an OAuth2 client, sets credentials from stored tokens, and automatically refreshes the access token when it expires (10-minute buffer). Tokens are saved to the Account model (next-auth tables) via saveTokens (apps/web/utils/auth/save-tokens).
Token storage. OAuth access and refresh tokens are stored in the Account Prisma model under fields access_token, refresh_token, expires_at (apps/web/prisma/schema.prisma:22-26). Calendar connections store their own tokens in CalendarConnection.accessToken/refreshToken/expiresAt (apps/web/prisma/schema.prisma:1416-1434). Drive connections similarly in DriveConnection. All token storage uses the database.
Sync vs on-demand. The email client fetches on-demand via the Gmail/Outlook API — searchInbox, readEmail tools call the live API. The app also supports webhook-based push notifications (Google PubSub, Microsoft webhooks) and the watchEmailsExpirationDate field tracks subscription expiry. Background sync runs via worker jobs and cron.
CopilotKit/OpenBot
answeredSupported services. Integrations are accessed through three mechanisms: (1) Composio (server/src/plugins/composio.ts) — a broker for 200+ SaaS apps (Gmail, Slack, GitHub, Notion, etc.). Each action is exposed as a tool the agent can call; the deployment holds one Composio API key and connections are per-person. (2) MCP (server/src/plugins/mcp.ts:1-7) — the Model Context Protocol for connecting arbitrary external servers. Each MCP server is a catalogue entry with a URL, optional token, and tool list. (3) Built-in routines (server/src/plugins/builtin-routines.ts) — server-side scheduled tasks like daily summaries. A dedicated Google Drive REST adapter (server/src/plugins/google-drive-rest.ts) exists because Google's Drive MCP server is gated behind a developer preview — it implements the same listTools/callTool interface as MCP, making transports swappable per catalogue entry.
OAuth flow. The OAuth module (server/src/plugins/oauth.ts) implements the PKCE authorization code flow. A sealed, encrypted state token carries the connect origin ("settings" or "admin"), PKCE verifier, and target user; the callback is the single path /api/plugins/oauth/callback. The state is encrypted (not just signed) so proxy logs holding the callback URL cannot redeem the code. Dynamic MCP client registration is handled; the state expires after 10 minutes.
Token storage. Credentials are encrypted at rest using AES-GCM (server/src/credentials.ts:7-13) with a keyEncryptionKey from deployment config. Stored in the credentials table with kind, provider, keyId, metadata, and encryptedValue. Keys are write-only — there is no way to read a stored credential back.
Sync vs on-demand. Tool listing is on-demand: the system calls the vendor to list available tools at grant time via refreshTools. Composio actions are paginated with a limit of 1000 per page and followed to the end via cursor. MCP servers get a 15-second listing timeout. When a Bot calls a tool, it goes through the approval gate, the transport (MCP/Composio/Drive/built-in), and the result (capped at 20,000 characters) is returned to the model.
elie222/rakazo
answeredIntegration services and API clients. Rakazo supports four integration tool sources, all accessed through a unified ConnectorProvider interface (packages/adapter-kit/src/interfaces.ts). The connector stack is built in apps/worker/src/index.ts line 145: InstalledConnectorProvider (user-installed connectors), Composio, Pipedream Connect, and MCP servers. Each resolves to a ConnectorTool with a name, description, and inputSchema.
Composio (packages/adapters/src/composio-connector.ts): wraps the Composio SDK to provide 200+ SaaS integrations (Google Calendar, Gmail, Slack, GitHub, etc.). It maps Composio tool definitions to the connector interface. Enabled via COMPOSIO_API_KEY env var. Tools are fetched from Composio's catalog and cached.
Pipedream Connect (packages/adapters/src): triggered via PIPEDREAM_CLIENT_ID/CLIENT_SECRET/PROJECT_ID env vars. Runs user-configured Pipedream workflows as tool invocations. Connector credentials are encrypted server-side using EncryptedSecretStore (packages/adapters/src/secrets.ts).
MCP (packages/core/src/mcp.ts and packages/adapters/src): supports both stdio-based and remote HTTPS MCP servers. Users add MCP servers through the Integrations settings UI. Stdio MCP is opt-in via MCP_STDIO_ENABLED=true with an allowlist of commands (MCP_STDIO_ALLOWED_COMMANDS). Remote MCP can target private endpoints when MCP_ALLOW_PRIVATE_ENDPOINT=true. OAuth for MCP goes through McpOAuthBroker.
OpenAPI integration: users can point at any OpenAPI JSON document to expose those endpoints as tools.
OAuth flow. Model providers use OAuth tokens stored in ModelCredential rows via encrypted ciphertext fields. packages/adapters/src/pi-oauth.ts handles OAuth device-code flows for ChatGPT Plus/Pro (openai-codex), GitHub Copilot, and xAI SuperGrok, plus auth-url flow for Claude Pro/Max (anthropic). Refresh tokens are cycled automatically; failed refreshes retire the credential.
Sync vs on-demand. Connector tools are discovered at run start via connector.discoverTools(). Composio connections are synced lazily on first use; Pipedream and MCP tools are fetched per run. There is no background sync — tools are resolved when a run begins.
ShenSeanChen/waku-agent
answeredIntegrations are declared in waku/integrations.py as a tuple of Integration dataclasses grouped into Channels (Telegram, Discord, WhatsApp), Calendar and Productivity (Google Calendar, Apple Calendar, Apple Tools), Memory and Storage (Notion, Mem0, Zep, LangMem, Supabase, TypeSafe Jev), and Search and Observability (Tavily, treg, OpenTelemetry). Each declares env fields and optionally a probe that validates connectivity on save. OAuth runs through waku/connect.py with google, treg, and waku-memory opening a browser window and caching the token. Google uses googleapiclient OAuth; treg and waku-memory use MCP OAuth via waku/tools/mcp_oauth.py (discover auth server, DCR, open browser, catch redirect on loopback port 41765, store via FileTokenStorage as JSON). Tools are used synchronously on-demand, no background sync. Calendar tools create events in Apple Calendar and Google Calendar as opt-in write targets. The search tool calls Tavily on demand.
agenvoy/Agenvoy
answeredAgenvoy does not have dedicated API clients for email, calendar, or docs. Instead, external services are accessed through MCP servers — the built-in MCP client connects to arbitrary MCP servers over stdio or HTTP (internal/runtime/mcp/config.go). The MCP Client interface (internal/runtime/mcp/client.go) wraps the go-sdk to call ListTools and CallTool. Tools from connected MCP servers are registered at runtime under the mcp__<server>__<tool> prefix via toolRegister.Regist(). OAuth for HTTP MCP servers is handled by internal/runtime/mcp/oauth.go. Chatbot integrations (Telegram and Discord) are first-class: the daemon connects outbound to these platforms using bot tokens stored in the OS keychain (internal/runtime/chatbot/telegram/ and discord/), with full message loop, file attachment handling, and session management via session IDs prefixed tg- and dc-. There is no background sync daemon — data is fetched on demand when the LLM calls a tool. Sync vs on-demand: all external data flows through tool calls the LLM makes during a run — no polling or webhook ingestion exists beyond the Telegram/Discord long-poll loops. LLM providers themselves are integrated via go-llm-router which supports 14+ providers (internal/agents/keychain/keychain.go): API-key-based (OpenAI, Claude, Gemini, Grok, DeepSeek, Mistral, NVIDIA, OpenRouter, Cloudflare, Ollama Cloud), OAuth-based (GitHub Copilot, OpenAI Codex, Grok-OAuth), Claude Code as a subprocess, and a generic compat provider for any OpenAI-compatible endpoint. API keys are stored in the OS keychain. OAuth tokens are loaded and refreshed by go-llm-router's oauth helpers.
← How is the assistant architected? · How is memory and user context stored and retrieved? →