> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Microsoft Teams Microsoft Teams channel を使用すると、Mastra Agent は Teams のメンションと会話イベントを受信できます。Mastra は Agent の接続と Webhook ルートを処理します。Teams アプリの設定、認証、権限については、Chat SDK の Teams アダプターのドキュメントを参照してください。 ## アダプターのインストール Chat SDK から Teams アダプターをインストールします。 **npm**: ```bash npm install @chat-adapter/teams ``` **pnpm**: ```bash pnpm add @chat-adapter/teams ``` **Yarn**: ```bash yarn add @chat-adapter/teams ``` **Bun**: ```bash bun add @chat-adapter/teams ``` ## Agent の設定 Agent の `channels.adapters` オブジェクトに `createTeamsAdapter()` を追加します。 ```typescript import { Agent } from '@mastra/core/agent' import { createTeamsAdapter } from '@chat-adapter/teams' export const teamsAgent = new Agent({ id: 'teams-agent', name: 'Teams Agent', instructions: 'Answer questions and help with tasks in Microsoft Teams.', model: 'openai/gpt-5.6-sol', channels: { adapters: { teams: createTeamsAdapter({ appType: 'SingleTenant', }), }, }, }) ``` Mastra インスタンスに Agent を登録します。 ```typescript import { Mastra } from '@mastra/core' import { teamsAgent } from './agents/teams-agent' export const mastra = new Mastra({ agents: { teamsAgent }, }) ``` ## アダプターの設定 Azure Bot の登録、Teams CLI の使用方法、認証オプション、必要な権限など、Teams 固有の設定については、[Chat SDK Teams アダプターのドキュメント](https://chat-sdk.dev/adapters/official/teams)に従ってください。 アダプターは、次のような環境変数から Teams の認証情報を読み取ります。 ```bash TEAMS_APP_ID=your-azure-bot-app-id TEAMS_APP_PASSWORD=your-azure-bot-app-password TEAMS_APP_TENANT_ID=your-azure-tenant-id ``` ## Webhook URL Mastra は、Agent ID とアダプターキーから Teams の Webhook ルートを生成します。 ```text /api/agents/teams-agent/channels/teams/webhook ``` 公開されている Mastra サーバーの URL をベース URL として使用します。 ```text https://your-app.example.com/api/agents/teams-agent/channels/teams/webhook ``` Teams アダプターのドキュメントで Bot エンドポイントまたは Webhook URL が求められる箇所には、この URL を使用します。ローカル開発では、トンネルで Mastra 開発サーバーを公開し、そのトンネル URL をベース URL として使用してください。 ## 関連情報 - [Channels の概要](https://mastra.zisheng.pro/ja/docs/capabilities/channels/overview) - [その他](https://mastra.zisheng.pro/ja/docs/capabilities/channels/other-adapters)