Microsoft Teams
Enable MCintelligentplus chat from Microsoft Teams personal chats
Microsoft Teams Messaging Channel
The Teams messaging channel lets users chat with the MCintelligentplus agent from a Microsoft Teams personal chat. MCintelligentplus runs a single system-level Teams bot — there is no per-organization bot or default-workspace setting anymore (that configuration was removed in #916).
This is separate from the Microsoft Teams connector, which is deprecated. The messaging channel handles bot conversations; the connector gave the agent Teams search/read tools.
Step 1: Register an Azure Bot
- Go to portal.azure.com → Create a resource → Azure Bot.
- Choose a bot handle and select Multi Tenant or Single Tenant based on your needs.
- Under Microsoft App ID, choose Create new to auto-generate an App Registration.
Step 2: Get the App ID and Password
- The Bot App ID is the Application (client) ID from the App Registration.
- The Tenant ID is the Directory (tenant) ID — leave it blank for multi-tenant bots.
- For the Bot App Password, open the App Registration → Certificates & secrets → New client secret, and copy the secret value — Azure shows it only once.
Step 3: Set the Messaging Endpoint
- In the Azure Bot resource → Configuration → Messaging endpoint.
- Set it to:
https://<your-domain>/api/v1/gateway/webhooks/teams/system- Enable the Microsoft Teams channel under Channels.
The endpoint must be reachable over public HTTPS.
Step 4: Configure the Bot in MCintelligentplus
System bot settings live in the admin portal at Admin → Message → Teams
(/admin/message/teams):
| Setting | Config key | Env fallback | Notes |
|---|---|---|---|
| Gateway Enabled | teams.GATEWAY_TEAMS_ENABLED | GATEWAY_TEAMS_ENABLED | Must be true for the bot to accept messages |
| Bot App ID | teams.SYSTEM_TEAMS_BOT_APP_ID | SYSTEM_TEAMS_BOT_APP_ID | Azure Bot Service App ID |
| Bot App Password | teams.SYSTEM_TEAMS_BOT_APP_PASSWORD | SYSTEM_TEAMS_BOT_APP_PASSWORD | Sensitive; leave blank to keep the stored secret |
| Tenant ID | teams.SYSTEM_TEAMS_BOT_TENANT_ID | SYSTEM_TEAMS_BOT_TENANT_ID | Leave empty for multi-tenant |
The values are DB-first: the admin portal value wins, then the environment
variable, then the default. Changes take effect without a restart, and the
master switch GATEWAY_ENABLED=TRUE must also be set for the messaging gateway
to run.
The TEAMS_REDIRECT_URI variable in .env.example belongs to the retired
Microsoft Teams connector, not this messaging channel. The bot uses the four
settings above.
Pairing Flow
- The user opens User Settings > Messaging Channels and clicks Pair Teams.
- MCintelligentplus shows a pairing command:
/start <CODE>. - The user opens Microsoft Teams, finds the MCintelligentplus bot in their chats, and sends that command.
Teams has no deep link, so the code must be sent manually. Pairing codes expire; if yours expires before you send it, generate a new one.
Users with the same email in Teams and MCintelligentplus are matched automatically: on the first message, MCintelligentplus reads the user's email through the Bot Framework roster API and binds the chat to the user's first workspace membership, so no pairing code is needed. If no match is found, the bot sends onboarding instructions pointing back to the pairing flow.
Runtime Behavior
- Teams sends the bot activity to
POST /api/v1/gateway/webhooks/teams/system. - MCintelligentplus validates the Bot Framework JWT, applies a 256 KB body cap, and accepts only personal conversations.
- The activity is persisted to the gateway inbox, deduplicated by activity ID.
- The worker resolves the Teams user to a MCintelligentplus user and workspace
(existing binding, roster API email match, or a
/startpairing). - The agent runs with that user's permissions and the reply is posted back in the same Teams chat.
In the bot chat, /workspace switches the bound workspace, /new starts a new
conversation, and /start <CODE> completes a pairing.
Access Control
- Members of an organization need the Teams channel enabled for them. Org
admins toggle this per member on the org portal's Members page
(
teams_enabled). Users with no organization membership are allowed. - Changes to the bot configuration are recorded in the audit log.
See Messaging Channels Troubleshooting if the bot does not reply.