Mainstream messaging
Microsoft Teams setup
Install the plugin, register the bot and Teams app, point Teams at a reachable endpoint, and verify the result.
Bundled plugin
Microsoft Teams ships as a bundled plugin in current OpenClaw releases; no separate install is required in the normal packaged build.
On an older build or a custom install that excludes bundled Teams, install the npm package directly:
openclaw plugins install @openclaw/msteamsUse the bare package to follow the current official release tag. Pin an exact version only when you need a reproducible install.
Local checkout (running from a git repo):
openclaw plugins install ./path/to/local/msteams-pluginDetails: Plugins
Quick setup
@microsoft/teams.cli handles bot registration, manifest creation, and credential generation in one command.
1. Install and log in
npm install -g @microsoft/teams.cli@previewteams loginteams status # verify you're logged in and see your tenant info2. Start a tunnel (Teams cannot reach localhost)
Install and authenticate the devtunnel CLI if needed (getting started guide).
# One-time setup (persistent URL across sessions):devtunnel create my-openclaw-bot --allow-anonymousdevtunnel port create my-openclaw-bot -p 3978 --protocol auto # Each dev session:devtunnel host my-openclaw-bot# Your endpoint: https://<tunnel-id>.devtunnels.ms/api/messagesAlternatives: ngrok http 3978 or tailscale funnel 3978 (URLs may change each session).
3. Create the app
teams app create \ --name "OpenClaw" \ --endpoint "https://<your-tunnel-url>/api/messages"This creates an Entra ID (Azure AD) application, generates a client secret, builds and uploads a Teams app manifest (with icons), and registers a Teams-managed bot (no Azure subscription needed). The output includes CLIENT_ID, CLIENT_SECRET, TENANT_ID, and a Teams App ID; it also offers to install the app in Teams directly.
4. Configure OpenClaw using the credentials from the output:
{ channels: { msteams: { enabled: true, appId: "<CLIENT_ID>", appPassword: "<CLIENT_SECRET>", tenantId: "<TENANT_ID>", webhook: { port: 3978, path: "/api/messages" }, }, },}Or use environment variables directly: MSTEAMS_APP_ID, MSTEAMS_APP_PASSWORD, MSTEAMS_TENANT_ID.
5. Install the app in Teams
teams app create prompts you to install the app; select "Install in Teams". To get the install link later:
teams app get <teamsAppId> --install-link6. Verify everything works
teams app doctor <teamsAppId>Runs diagnostics across bot registration, AAD app config, manifest validity, and SSO setup.
For production, consider federated authentication (certificate or managed identity) instead of client secrets.
Goals
- Talk to OpenClaw via Teams DMs, group chats, or channels.
- Keep routing deterministic: replies always go back to the channel they arrived on.
- Default to safe channel behavior (mentions required unless configured otherwise).
Manual setup (without the Teams CLI)
How it works
- Ensure the Microsoft Teams plugin is available (bundled in current releases).
- Create an Azure Bot (App ID + secret + tenant ID).
- Build a Teams app package referencing the bot, including the RSC permissions.
- Upload/install the Teams app into a team (or personal scope for DMs).
- Configure
msteamsin~/.openclaw/openclaw.json(or env vars) and start the gateway. - The gateway listens for Bot Framework webhook traffic on
/api/messagesby default.
Step 1: Create Azure Bot
-
Go to Create Azure Bot
-
Fill in the Basics tab:
Field Value Bot handle Your bot name, e.g., openclaw-msteams(must be unique)Subscription Select your Azure subscription Resource group Create new or use existing Pricing tier Free for dev/testing Type of App Single Tenant (recommended; see note below) Creation type Create new Microsoft App ID
- Click Review + create then Create (~1-2 minutes).
Step 2: Get credentials
- Azure Bot resource → Configuration → copy Microsoft App ID (your
appId). - Manage Password → App Registration → Certificates & secrets → New client secret → copy the Value (your
appPassword). - Overview → copy Directory (tenant) ID (your
tenantId).
Step 3: Configure messaging endpoint
- Azure Bot → Configuration.
- Set Messaging endpoint:
- Production:
https://your-domain.com/api/messages - Local dev: use a tunnel (see Local development)
- Production:
Step 4: Enable Teams channel
- Azure Bot → Channels.
- Click Microsoft Teams → Configure → Save.
- Accept the Terms of Service.
Step 5: Build Teams app manifest
- Include a
botentry withbotId = <App ID>. - Scopes:
personal,team,groupChat. supportsFiles: true(required for personal-scope file handling).- Add RSC permissions (see RSC permissions).
- Create icons:
outline.png(32x32) andcolor.png(192x192). - Zip
manifest.json,outline.png, andcolor.pngtogether.
Step 6: Configure OpenClaw
{ channels: { msteams: { enabled: true, appId: "<APP_ID>", appPassword: "<APP_PASSWORD>", tenantId: "<TENANT_ID>", webhook: { port: 3978, path: "/api/messages" }, }, },}Environment variables: MSTEAMS_APP_ID, MSTEAMS_APP_PASSWORD, MSTEAMS_TENANT_ID.
Step 7: Run the gateway
The Teams channel starts automatically when the plugin is available and msteams config has credentials.
Local development (tunneling)
Teams cannot reach localhost. Use a persistent dev tunnel so the URL stays stable across sessions:
# One-time setup:devtunnel create my-openclaw-bot --allow-anonymousdevtunnel port create my-openclaw-bot -p 3978 --protocol auto # Each dev session:devtunnel host my-openclaw-botAlternatives: ngrok http 3978 or tailscale funnel 3978 (URLs may change each session).
If the tunnel URL changes, update the endpoint:
teams app update <teamsAppId> --endpoint "https://<new-url>/api/messages"Testing the bot
Run diagnostics:
teams app doctor <teamsAppId>Checks bot registration, AAD app, manifest, and SSO configuration in one pass.
Send a test message:
- Install the Teams app (install link from
teams app get <id> --install-link). - Find the bot in Teams and send a DM.
- Check gateway logs for incoming activity.