On this page
On this page
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:
Use 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):
Details: Plugins
Quick setup
@microsoft/teams.cli handles bot registration, manifest creation, and credential generation in one command.
1. Install and log in
2. Start a tunnel (Teams cannot reach localhost)
Install and authenticate the devtunnel CLI if needed (getting started guide).
Alternatives: ngrok http 18789 or tailscale funnel 18789 (URLs may change each session). Use your configured Gateway port if it differs. When configuring a reverse proxy, expose only the required webhook path.
New installations use only the Gateway port. Doctor preserves port 3978 on
existing installations with a one-shot channels.msteams.legacyWebhook pin.
After moving the callback and verifying delivery through the Gateway port,
remove that pin to close the old port.
3. Create the app
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:
This account-based shape works for one bot or many. Environment variables
(MSTEAMS_APP_ID, MSTEAMS_APP_PASSWORD, MSTEAMS_TENANT_ID) apply only to
the default account. Each named account has its own bot credentials and
webhook path on the same Gateway port. See Multiple bot accounts for endpoint examples.
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:
6. Verify everything works
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 serves Bot Framework webhook traffic on
/api/messagesatgateway.port(default18789), with Teams SDK JWT authentication.
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
Environment variables configure only the default account. See Multiple bot accounts for additional bot registrations and routing.
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:
Alternatives: ngrok http 18789 or tailscale funnel 18789 (URLs may change each session). Use your configured Gateway port if it differs. When configuring a reverse proxy, expose only the required webhook path.
If the tunnel URL changes, update the endpoint:
Testing the bot
Run diagnostics:
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.