Autocomplete for office work.
SWE + IDE Office Worker + This Agent
───────────────────────────────── ─────────────────────────────────
Type code → suggestions appear Meeting ends → minutes drafted
Commit → CI runs tests Email arrives → response drafted
PR opened → linter checks Calendar event → briefing prepared
Review & approve Review & approve
The human reviews instead of drafts from scratch.
Microsoft 365 Event → Webhook → Claude Agent → Completed Work
(trigger) (catch) (execute) (review)
- Something happens in Microsoft 365 (meeting ends, email arrives, event approaches)
- Webhook fires to this agent
- Claude executes your custom workflow (slash command)
- You review the output
Workflows are slash commands in your Claude Code project:
your-claude-project/
├── .mcp.json # MCP servers (office-mcp, etc.)
├── CLAUDE.md # System context
└── .claude/commands/
├── meetingminutes.md # Meeting transcript workflow
├── email_responder.md # Email workflow
└── brief.md # Calendar prep workflow
Edit a slash command → changes apply on next webhook. No code deployment.
This agent is the webhook receiver and router. The workflows live in your Claude Code project.
| Trigger | Slash Command | Output |
|---|---|---|
| Teams transcript ready | /meetingminutes |
Email to attendees + Planner tasks |
| Email received | /email_responder |
Draft response (not sent) |
| Calendar event approaching | /brief |
Briefing with context |
Add more by creating slash commands and webhook subscriptions.
- Python 3.11+
- Claude Max subscription with Claude Code CLI authenticated
- Microsoft 365 account
- Azure AD App Registration with Graph API permissions
- office-mcp for Microsoft 365 integration
- Cloudflare Tunnel (or similar) for public webhook URL
git clone https://github.com/your-username/office-webhook-agent.git
cd office-webhook-agent
python3 -m venv venv
source venv/bin/activate
pip install -e .cp .env.example .env
# Edit .env with your settingsKey settings:
CLAUDE_PROJECT_DIR— Your Claude Code project with MCP servers and slash commandsWEBHOOK_URL— Public URL for Microsoft Graph notificationsGRAPH_CLIENT_ID/GRAPH_CLIENT_SECRET— Azure AD app credentialsUSER_ID— Your Microsoft 365 user ID
export TUNNEL_DOMAIN=your-domain.com
export TUNNEL_SUBDOMAIN=webhook
./scripts/setup_tunnel.sh# Terminal 1: Webhook server
./start.sh
# Terminal 2: Tunnel
cloudflared tunnel run office-webhook
# Terminal 3: Create subscription
python scripts/create_subscription.pySchedule a Teams meeting with transcription. When it ends, the agent:
- Receives the transcript webhook
- Executes
/meetingminutes - Sends minutes to attendees
- Creates Planner tasks for action items
sudo cp office-webhook-agent.service.example /etc/systemd/system/office-webhook-agent.service
sudo nano /etc/systemd/system/office-webhook-agent.service # Edit paths
sudo systemctl daemon-reload
sudo systemctl enable office-webhook-agent
sudo systemctl start office-webhook-agentThe agent renews Microsoft Graph subscriptions before expiry.
- Create slash command in your Claude Code project
- Add subscription in
src/subscriptions/manager.py - Add handler in
src/webhook/handler.py - Restart
office-webhook-agent/
├── src/
│ ├── main.py # FastAPI application
│ ├── config/settings.py # Configuration
│ ├── webhook/handler.py # Webhook routing
│ ├── agent/
│ │ ├── meeting_minutes.py # Claude Code SDK executor
│ │ └── system_prompt.py # Webhook → slash command routing
│ ├── subscriptions/ # Graph API subscription management
│ └── graph/ # Authentication
├── scripts/
│ ├── setup_tunnel.sh
│ └── create_subscription.py
├── .env.example
└── office-webhook-agent.service.example
- Agent runs with
bypassPermissionsfor autonomous execution - Implement
clientStatevalidation for production webhooks - Graph API tokens stored locally; set appropriate file permissions
Webhook not receiving:
- Verify tunnel:
curl https://your-webhook-url/health - Check subscription:
curl http://localhost:8000/status - Logs:
journalctl -u office-webhook-agent -f
Authentication errors:
- Re-authenticate office-mcp
- Verify token file at
GRAPH_TOKEN_PATH - Check Azure AD app permissions
Slash command not found:
- Verify
CLAUDE_PROJECT_DIR - Check command exists in
.claude/commands/ - Test in Claude Code CLI
MIT