Bring the full power of your OpenClaw agent into Outlook β with all your tools, skills, and automations. Read emails, ask questions, create calendar events, query databases, draft replies, or trigger any workflow your agent can do β all from a sidebar without leaving your inbox.
- π§ Email Context β Automatically reads subject, sender, recipients, date, and body of the selected email
- π¬ Chat Interface β Ask questions about the email, get summaries, translations, or any AI assistance
- βοΈ Draft Reply β One-click reply drafting based on the email context
- π€ Send Reply β Opens Outlook's native reply compose with the drafted text pre-filled
- π Light/Dark Mode β Auto-detects Outlook theme (Office.js + prefers-color-scheme)
- π Pinned Sidebar β Stays open when switching between emails (VersionOverrides v1.1)
- πΎ Per-Email Chat History β Each email gets its own session; switching back restores the conversation
- π Smart Context β Email body sent only with the first message per email (saves tokens)
- π Auto-Reconnect β WebSocket reconnects automatically with exponential backoff
- π Token-based Auth β Gateway token stored in browser localStorage, never in code
- Node.js 18+
- OpenClaw Gateway running locally
- Outlook Desktop (Windows, Classic) or Outlook Web (OWA)
- Microsoft 365 account with sideloading enabled
npm installnpx office-addin-dev-certs installnpm run devStarts webpack-dev-server at https://localhost:3000 with:
- HTTPS (required by Office.js)
- Hot reload
- WebSocket proxy to OpenClaw Gateway (
/gateway-wsβws://127.0.0.1:18789)
Via OWA (recommended β syncs to Desktop automatically):
- Open https://aka.ms/olksideload
- Click My add-ins β Add a custom add-in β Add from file
- Upload
manifest.xmlfrom this project
Note: Sideloading in OWA requires your Microsoft 365 admin to allow custom add-ins. Sync to Outlook Desktop can take up to 24 hours.
When you first open the add-in sidebar, it will ask for your OpenClaw Gateway token:
- Find your token in
~/.openclaw/openclaw.jsonβgateway.auth.token - Paste it into the token input field in the sidebar
- Click Save & Connect
The token is stored in browser localStorage and never leaves your machine.
Add https://localhost:3000 to your Gateway's allowed origins:
{
"gateway": {
"controlUi": {
"allowedOrigins": ["https://localhost:3000"]
}
}
}Or via OpenClaw CLI:
openclaw config patch '{"gateway":{"controlUi":{"allowedOrigins":["https://localhost:3000"]}}}'- Open any email in Outlook
- Click the OpenClaw AI button in the ribbon (or find it via ... β More actions)
- The sidebar shows the email context and a chat interface
- Type a question or click Draft Reply
To keep the dev server running permanently, create a Windows Scheduled Task:
$action = New-ScheduledTaskAction -Execute "node.exe" `
-Argument "node_modules\webpack-cli\bin\cli.js serve --mode development" `
-WorkingDirectory "C:\path\to\openclaw-outlook-addin"
$trigger = New-ScheduledTaskTrigger -AtLogOn
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries `
-DontStopIfGoingOnBatteries -RestartCount 999 -RestartInterval (New-TimeSpan -Minutes 1)
Register-ScheduledTask -TaskName "OpenClaw Outlook Add-in" `
-Action $action -Trigger $trigger -Settings $settings -Forcenpm run buildOutput goes to dist/. For production deployment, host the built files on any HTTPS server and update the URLs in manifest.xml.
Browser (Outlook WebView) Local Machine
βββββββββββββββββββββββ ββββββββββββββββββββββββ
β Outlook Add-in β wss:// β Webpack Dev Server β
β (taskpane.html) βββββββββββΊβ :3000 (HTTPS) β
β β β β β
β - Office.js β β β proxy /gateway-wsβ
β - Chat UI β β βΌ β
β - Theme detection β β OpenClaw Gateway β
β β β :18789 (WS) β
βββββββββββββββββββββββ ββββββββββββββββββββββββ
The add-in uses OpenClaw's native Gateway RPC protocol:
- Client connects to
wss://localhost:3000/gateway-ws(proxied to Gateway) - Gateway sends
connect.challengeevent - Client sends
connectRPC with auth token - Gateway responds with session info
{
"type": "req",
"id": "1",
"method": "chat.send",
"params": {
"sessionKey": "agent:main:main",
"message": "Summarize this email",
"deliver": false
}
}- Streaming:
agent.delta/chat.deltaevents with incremental text - Complete:
agent.message/chat.messageevents with full response - Tool calls:
agent.tool_call/agent.tool_resultevents
βββ manifest.xml # Office Add-in manifest (XML)
βββ package.json
βββ webpack.config.js # Dev server + WS proxy config
βββ generate-icons.js # Icon generator (uses sharp + OpenClaw SVG)
βββ src/
β βββ taskpane/
β β βββ taskpane.html # Sidebar UI
β β βββ taskpane.js # Office.js + Gateway RPC + chat logic
β β βββ taskpane.css # Light/dark theme styles
β βββ commands/
β βββ commands.html
β βββ commands.js # Ribbon command handlers
βββ assets/
βββ openclaw-logo.svg # Source logo (from Gateway favicon)
βββ icon-*.png # Generated icons (16-128px)
| Problem | Solution |
|---|---|
| "Add-in installation failed" | Validate manifest: npx office-addin-manifest validate manifest.xml |
| "Disconnected" in sidebar | Check if dev server is running (npm run dev) |
| "Connecting..." stays | Verify Gateway is running and token is correct |
| No button in Outlook ribbon | Restart Outlook, or wait for OWAβDesktop sync |
| Icons not showing | Remove add-in in OWA, re-sideload manifest.xml |
| Mixed content errors | The WSS proxy should handle this β check webpack proxy config |
| Need to debug the sidebar | Open https://localhost:3000/taskpane.html directly in a browser tab |
| Duplicate responses | Check version tag (top-right of connection bar); kill old node processes on port 3000 |
| Token prompt on every open | localStorage may be cleared; re-enter token from ~/.openclaw/openclaw.json |
| Icons not showing in OWA | Icons are served from GitHub raw URLs; ensure repo is public |
- Gateway token is stored in browser localStorage only β never committed to Git
- The add-in has ReadItem permission (read-only access to current email)
displayReplyForm()opens Outlook's native compose β user always reviews before sending- WebSocket connection is local only (
localhost:3000βlocalhost:18789)
- Data processing agreement (DPA/AVV): If you process personal data from emails, ensure your AI provider has an appropriate data processing agreement in place.
- Zero data retention (ZDR): Use an AI provider plan that does not retain or train on your data (e.g., Anthropic API, OpenAI API with ZDR, Google Gemini API β not free-tier consumer products).
- Local processing: All data flows through your local OpenClaw Gateway (
localhost). No data is sent to third-party servers other than the configured AI model provider. - No cloud storage: The add-in does not store emails, conversations, or tokens on any external server. The Gateway token is stored in browser localStorage on your machine only.
- Employee consent: If processing employee or customer emails, ensure appropriate legal basis under GDPR Art. 6 (e.g., legitimate interest, consent, or contractual necessity).
- Data minimization: The add-in sends only the currently selected email's content β not your entire mailbox.
Recommendation: For business use, pair this add-in with an enterprise AI plan that provides contractual guarantees for data privacy, such as:
- Anthropic Claude (API / Max for Business) β zero retention by default
- OpenAI API (with Zero Data Retention) β opt-in via API settings
- Self-hosted models (Ollama, vLLM) β data never leaves your infrastructure
This add-in is a tool β compliance with data protection regulations is the responsibility of the deploying organization.
The OpenClaw name and lobster logo are trademarks of their respective owners. This project is an independent community integration and is not officially endorsed by or affiliated with the OpenClaw project. The logo is used under the MIT license terms of the OpenClaw distribution.
MIT
