Teams MCP
Teams MCP
Microsoft Graph APIとのシームレスな統合を提供するModel Context Protocol (MCP) サーバーです。AIアシスタントがMicrosoft Teams、ユーザー、チャット、ファイル、および組織データとやり取りできるようになります。
📦 インストール
Cursor/Claude/VS CodeでこのMCPサーバーを使用するには、以下の設定を追加してください:
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"]
}
}
}Related MCP server: Microsoft Graph MCP Server
🚀 機能
🔐 認証
Microsoft Graphを使用したOAuth 2.0デバイスコード認証フロー
安全なトークン管理、キャッシュの永続化、およびリフレッシュトークンの更新
認証状態の確認とログアウトのサポート
権限を制限した読み取り専用モード
事前に発行されたMicrosoft Graphアクセストークン用の直接的な
AUTH_TOKENサポート
👥 ユーザー管理
現在のユーザー情報の取得
名前またはメールアドレスによるユーザー検索
詳細なユーザープロファイルの取得
組織ディレクトリデータへのアクセス
🏢 Microsoft Teams統合
チーム管理
ユーザーが参加しているチームの一覧表示
チームの詳細とメタデータへのアクセス
チャネル操作
チーム内のチャネル一覧表示
チャネルメッセージと返信の取得
チームチャネルへのメッセージ送信
既存のチャネルスレッドへの返信
チャネルメッセージと返信の編集および論理削除
メッセージの重要度レベルのサポート (
normal,high,urgent)URLまたはbase64データによるインライン画像添付のサポート
チームメンバー
チームメンバーとその役割の一覧表示
メンバー情報へのアクセス
@mentions用のユーザー検索
💬 チャットとメッセージング
1対1およびグループチャット
ユーザーのチャット一覧表示
新しい1対1またはグループ会話の作成
フィルタリング、順序付け、ページネーションを備えたチャットメッセージ履歴の取得
@odata.nextLinkページネーションによるすべての利用可能なメッセージの取得既存のチャットへのメッセージ送信
送信済みチャットメッセージの編集
チャットメッセージの論理削除
✏️ メッセージ管理
編集と削除
チャットおよびチャネル内の送信済みメッセージの更新(編集)
チャットおよびチャネル内のメッセージの論理削除(完全に削除せず削除済みとしてマーク)
メッセージ送信者のみが自身のメッセージを更新/削除可能
編集時のMarkdownフォーマット、メンション、重要度レベルのサポート
📎 メディアと添付ファイル
ホストされたコンテンツ
チャットおよびチャネルメッセージからのホストされたコンテンツ(画像、ファイル)のダウンロード
会話内で共有されたインライン画像および添付ファイルへのアクセス
ホストされたコンテンツをディスクに直接保存するオプション
ファイルアップロード
あらゆるファイルタイプ(PDF、DOCX、XLSX、ZIP、画像など)をチャネルやチャットにアップロードして送信
再開可能なアップロードセッションによる大容量ファイル(4MB超)のサポート
チャネルへのアップロードはSharePointへ、チャットへのアップロードはOneDriveへ保存
メッセージテキスト、カスタムファイル名、フォーマット、重要度レベルのオプション
🔍 高度な検索と発見
メッセージ検索
Microsoft Search APIを使用してすべてのTeamsチャネルとチャットを横断検索
KQL(キーワードクエリ言語)構文のサポート
送信者、メンション、添付ファイル、既読状態、日付範囲によるフィルタリング
高度なフィルタリングオプションを備えた最近のメッセージの取得
現在のユーザーに言及しているメッセージの検索
リッチメッセージフォーマットのサポート
以下のツールは、Teamsチャネルおよびチャットでのリッチメッセージフォーマットをサポートしています:
send_channel_messagesend_chat_messagereply_to_channel_messageupdate_channel_messageupdate_chat_messagesend_file_to_channelsend_file_to_chat
フォーマットオプション
format パラメータを指定してメッセージのフォーマットを制御できます:
text(デフォルト): プレーンテキストmarkdown: Markdownフォーマット(太字、斜体、リスト、リンク、コードなど)をサニタイズされたHTMLに変換
format が markdown に設定されている場合、メッセージ内容は安全なMarkdownパーサーを使用してHTMLに変換され、Teamsに送信される前に潜在的に危険なコンテンツを除去するためにサニタイズされます。
format が指定されていない場合、メッセージはプレーンテキストとして送信されます。
使用例
{
"teamId": "...",
"channelId": "...",
"message": "**Bold text** and _italic text_\n\n- List item 1\n- List item 2\n\n[Link](https://example.com)",
"format": "markdown",
"importance": "high"
}{
"chatId": "...",
"message": "Simple plain text message",
"format": "text"
}セキュリティ機能
HTMLサニタイズ: すべてのMarkdownコンテンツはHTMLに変換され、潜在的に危険な要素(スクリプト、イベントハンドラなど)を除去するためにサニタイズされます
許可されたタグ: 安全なHTMLタグのみが許可されます (p, strong, em, a, ul, ol, li, h1-h6, code, pre など)
安全な属性: 安全な属性のみが許可されます
XSS防止: クロスサイトスクリプティング攻撃を防ぐためにコンテンツは自動的にサニタイズされます
サポートされているMarkdown機能
テキストフォーマット: 太字 (
**text**), 斜体 (_text_), 取り消し線 (~~text~~)リンク:
[text](url)リスト: 箇条書き (
- item) および番号付き (1. item)コード: インライン
`code`およびコードブロック見出し:
# H1から###### H6引用:
> quoted textテーブル: GitHub形式のMarkdownテーブル
LLMフレンドリーなコンテンツフォーマット
Microsoft Graph APIから取得されたメッセージは、Teams固有のタグを含む生のHTMLとして返されます。このコンテンツをAIアシスタントが扱いやすくするために、以下のツールは自動的なHTMLからMarkdownへの変換をサポートしています:
get_chat_messagesget_channel_messagesget_channel_message_repliessearch_messagesget_my_mentions
コンテンツフォーマットオプション
contentFormat パラメータを使用して、メッセージコンテンツの返却方法を制御します:
markdown(デフォルト): TeamsのHTMLをLLMでの利用に最適化されたクリーンなMarkdownに変換しますraw: Microsoft Graph APIからの元のHTMLを返します
変換内容
HTML要素 | Markdown出力 |
|
|
|
|
|
|
|
|
|
|
|
|
| GFM Markdownテーブル |
|
|
| (削除) |
|
|
| プレーン文字にデコード |
添付ファイルのメタデータ
ファイル添付やインライン画像を含むメッセージには、各添付ファイルのメタデータ(id, name, contentType, contentUrl, thumbnailUrl)を含む attachments 配列がレスポンスに含まれます。Markdownコンテンツ内のインライン {attachment:id} マーカーはこの配列内のエントリと関連付けられており、利用者は download_message_hosted_content または download_chat_hosted_content を通じて添付ファイルを特定しダウンロードできます。
使用例
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "markdown"
}元のHTMLを取得する場合:
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "raw"
}📦 インストール
# Install dependencies
npm install
# Build the project
npm run build
# Set up authentication
npm run auth🔧 設定
前提条件
Node.js 18以上
適切な権限を持つMicrosoft 365アカウント
以下のスコープに対するMicrosoft Graph委任権限
必要なMicrosoft Graph権限
フルモード(デフォルト):
User.Read- ユーザープロファイルの読み取りUser.ReadBasic.All- 基本ユーザー情報の読み取りTeam.ReadBasic.All- チーム情報の読み取りChannel.ReadBasic.All- チャネル情報の読み取りChannelMessage.Read.All- チャネルメッセージの読み取りChannelMessage.Send- チャネルメッセージと返信の送信ChannelMessage.ReadWrite- チャネルメッセージの編集と削除Chat.Read- チャットメッセージの読み取り(読み取り専用スコープに含まれる)Chat.ReadWrite- チャットの作成と管理、チャットメッセージの送信/編集/削除 (Chat.Readを上書き)TeamMember.Read.All- チームメンバーの読み取りFiles.ReadWrite.All- チャネルおよびチャットへのファイルアップロードに必要
読み取り専用モード (TEAMS_MCP_READ_ONLY=true) — 以下のスコープのみが要求されます:
User.ReadUser.ReadBasic.AllTeam.ReadBasic.AllChannel.ReadBasic.AllChannelMessage.Read.AllTeamMember.Read.AllChat.Read
認証モード
フルアクセス:
npx @floriscornel/teams-mcp@latest authenticate読み取り専用アクセス:
npx @floriscornel/teams-mcp@latest authenticate --read-only既存のMicrosoft Graph JWTを使用した直接トークン注入:
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"],
"env": {
"AUTH_TOKEN": "<jwt-for-https://graph.microsoft.com>"
}
}
}
}トークンストレージ
認証メタデータはローカルの
~/.msgraph-mcp-auth.jsonに保存されますトークンキャッシュはローカルの
~/.teams-mcp-token-cache.jsonに保存されます
🛠️ 使用方法
サーバーの起動
# Development mode with hot reload
npm run dev
# Production mode
npm run build && node dist/index.js
# Start in read-only mode (disables all write tools)
TEAMS_MCP_READ_ONLY=true node dist/index.jsCLIコマンド
npx @floriscornel/teams-mcp@latest authenticate # Authenticate with full scopes
npx @floriscornel/teams-mcp@latest authenticate --read-only # Authenticate with read-only scopes
npx @floriscornel/teams-mcp@latest check # Check authentication status
npx @floriscornel/teams-mcp@latest logout # Clear authentication
npx @floriscornel/teams-mcp@latest auth # Alias for authenticate
npx @floriscornel/teams-mcp@latest # Start MCP server (default)環境変数
TEAMS_MCP_READ_ONLY=true- MCPサーバーを読み取り専用モードで起動AUTH_TOKEN=<jwt>- MSALログインの代わりに既存のMicrosoft Graphアクセストークンを使用
読み取り専用モード
サーバーは、すべての書き込み操作(メッセージ送信、チャット作成、ファイルアップロード、メッセージの編集/削除)を無効にし、Microsoft Graphから読み取り権限スコープのみを要求する読み取り専用モードをサポートしています。
読み取り専用モードを有効にする方法:
環境変数:
TEAMS_MCP_READ_ONLY=trueCLIフラグ:
--read-only
制限されたスコープで認証:
npx @floriscornel/teams-mcp@latest authenticate --read-onlyMCPサーバー設定(読み取り専用):
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"],
"env": {
"TEAMS_MCP_READ_ONLY": "true"
}
}
}
}モードの切り替え: 読み取り専用からフルモードに切り替える際、サーバーはスコープの不一致を検出し、再認証を促す警告を表示します:
npx @floriscornel/teams-mcp@latest authenticate読み取り専用ツール (16):
auth_status, get_current_user, search_users, get_user, list_teams, list_channels, get_channel_messages, get_channel_message_replies, list_team_members, search_users_for_mentions, download_message_hosted_content, list_chats, get_chat_messages, download_chat_hosted_content, search_messages, get_my_mentions
読み取り専用モードで無効化される書き込みツール (10):
send_channel_message, reply_to_channel_message, update_channel_message, delete_channel_message, send_file_to_channel, send_chat_message, create_chat, update_chat_message, delete_chat_message, send_file_to_chat
利用可能なMCPツール
認証
auth_status- 現在の認証状態を確認
ユーザー操作
get_current_user- 認証済みユーザー情報を取得search_users- 名前またはメールアドレスでユーザーを検索get_user- IDまたはメールアドレスで詳細なユーザー情報を取得
チーム操作
list_teams- ユーザーが参加しているチームを一覧表示list_channels- 特定のチーム内のチャネルを一覧表示get_channel_messages- 添付ファイルの概要とコンテンツフォーマット選択を備えたチームチャネルからのメッセージを取得get_channel_message_replies- 特定のチャネルメッセージへの返信を取得send_channel_message- メンション、重要度、画像添付オプションを備えたチームチャネルへのメッセージ送信reply_to_channel_message- 既存のチャネルメッセージへの返信update_channel_message- 送信済みのチャネルメッセージまたは返信を編集delete_channel_message- チャネルメッセージまたは返信を論理削除list_team_members- 特定のチームのメンバーを一覧表示search_users_for_mentions- メッセージで@メンションするためのチームメンバーを検索send_file_to_channel- ローカルファイルをアップロードし、チャネルへのメッセージとして送信
チャット操作
list_chats- ユーザーのチャット(1対1およびグループ)を一覧表示get_chat_messages- ページネーション、フィルタ、順序付け、fetchAllを備えた特定のチャットからのメッセージを取得send_chat_message- チャットへのメッセージ送信create_chat- 新しい1対1またはグループチャットを作成update_chat_message- 送信済みのチャットメッセージを編集
Available Tools
19 toolsauth_statusA
Check the authentication status of the Microsoft Graph connection. Returns whether the user is authenticated and shows their basic profile information.
Inputs: no named parameters.
create_chatC
Create a new chat conversation. Can be a 1:1 chat (with one other user) or a group chat (with multiple users). Group chats can optionally have a topic.
Inputs: userEmails (required), topic.
get_channel_message_repliesC
Get all replies to a specific message in a channel. Returns reply content, sender information, and timestamps.
Inputs: teamId (required), channelId (required), messageId (required), limit.
get_channel_messagesC
Retrieve recent messages from a specific channel in a Microsoft Team. Returns message content, sender information, and timestamps.
Inputs: teamId (required), channelId (required), limit.
get_chat_messagesB
Retrieve recent messages from a specific chat conversation. Returns message content, sender information, and timestamps.
Inputs: chatId (required), limit, since, until, +3 more.
get_current_userA
Get the current authenticated user's profile information including display name, email, job title, and department.
Inputs: no named parameters.
get_my_mentionsA
Find all recent messages where the current user was mentioned (@mentioned) across Teams channels and chats.
Inputs: hours, limit, scope.
get_recent_messagesC
Get recent messages from across Teams with advanced filtering options. Can filter by time range, scope (channels vs chats), teams, channels, and users.
Inputs: hours, limit, mentionsUser, fromUser, +6 more.
get_userC
Get detailed information about a specific user by their ID or email address. Returns profile information including name, email, job title, and department.
Inputs: userId (required).
list_channelsB
List all channels in a specific Microsoft Team. Returns channel names, descriptions, types, and IDs for the specified team.
Inputs: teamId (required).
list_chatsB
List all recent chats (1:1 conversations and group chats) that the current user participates in. Returns chat topics, types, and participant information.
Inputs: no named parameters.
list_team_membersB
List all members of a specific Microsoft Team. Returns member names, email addresses, roles, and IDs.
Inputs: teamId (required).
list_teamsA
List all Microsoft Teams that the current user is a member of. Returns team names, descriptions, and IDs.
Inputs: no named parameters.
reply_to_channel_messageB
Reply to a specific message in a channel. Supports text and markdown formatting, mentions, and importance levels.
Inputs: teamId (required), channelId (required), messageId (required), message (required), +7 more.
search_messagesA
Search for messages across all Microsoft Teams channels and chats using Microsoft Search API. Supports advanced KQL syntax for filtering by sender, mentions, attachments, and more.
Inputs: query (required), scope, limit, enableTopResults.
search_usersA
Search for users in the organization by name or email address. Returns matching users with their basic profile information.
Inputs: query (required).
search_users_for_mentionsA
Search for users to mention in messages. Returns users with their display names, email addresses, and mention IDs.
Inputs: query (required), limit.
send_channel_messageC
Send a message to a specific channel in a Microsoft Team. Supports text and markdown formatting, mentions, and importance levels.
Inputs: teamId (required), channelId (required), message (required), importance, +6 more.
send_chat_messageC
Send a message to a specific chat conversation. Supports text and markdown formatting, mentions, and importance levels.
Inputs: chatId (required), message (required), importance, format, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools have distinct purposes targeting specific resources like channels, chats, users, or messages, but there is some overlap: get_recent_messages and search_messages both retrieve messages with filtering, which could cause confusion. However, descriptions clarify that get_recent_messages focuses on recent messages with time/scope filters, while search_messages uses advanced KQL syntax, helping to differentiate them.
Tool names follow a highly consistent verb_noun pattern throughout, such as list_teams, get_channel_messages, send_chat_message, and search_users. All tools use snake_case with clear verbs like get, list, create, send, reply, and search, making the set predictable and easy to understand.
With 19 tools, the count is slightly high but reasonable for a comprehensive Teams integration covering authentication, chats, channels, messages, users, and search. It provides broad functionality without being overwhelming, though it could be streamlined by merging some overlapping tools like get_recent_messages and search_messages.
The toolset offers complete coverage for Microsoft Teams interactions, including CRUD operations for messages (send, reply, get), resource listing (teams, channels, chats, members), user management (get, search), and authentication. There are no obvious gaps; agents can perform core workflows like messaging, searching, and team management effectively.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Telnyx MCP server is an official implementation of the Model Context Protocol that enables AI clients (like Claude Desktop, Cursor, and OpenAI Agents) to interact with Telnyx's telephony, messaging, and AI assistant APIs. It provides comprehensive capabilities including making and managing phone calls, sending SMS/MMS messages, purchasing and configuring phone numbers, creating AI assistants with custom instructions, managing cloud storage buckets, scraping and embedding website content, and handling integration secrets. The server exists as both a local implementation and a remotely hosted version, allowing developers to integrate real-world communication infrastructure directly into AI applications.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- AlicenseBqualityAmaintenanceA Model Context Protocol server that enables interaction with Microsoft 365 services (Excel, Calendar, Mail, OneDrive, Teams, etc.) through the Graph API, allowing AI assistants to manage Microsoft 365 resources via natural language.203104,785 npm1,150MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive server that enables AI applications to interact with Microsoft 365 and Azure AD services through standardized Model Context Protocol interfaces.3MIT
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol servers for Microsoft 365, enabling AI assistants to interact with Calendar, Contacts, OneDrive, Outlook, and SharePoint via the Microsoft Graph API.MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server enabling AI assistants to interact with Microsoft Teams, users, chats, and organizational data via Microsoft Graph APIs.MIT