Teams Mcp
About
MCP server providing comprehensive Microsoft Teams and Graph API access for AI assistants including messaging, search, and user management.
Details
- Author
- floriscornel
- GitHub stars
- 120
- Downloads
- 684
- Categories
- Communication, Other
Jump to
- OAuth 2.0 device code authentication with Microsoft Graph
- User management: search, profile, directory access
- Teams and channel operations: list, send, edit, delete messages
- Chat and messaging: 1:1/group chats, send, edit, delete
- File upload and hosted content download
- Advanced message search with KQL and filtering
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Teams McpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install via npx -y @floriscornel/teams-mcp@latest, authenticate using the authenticate CLI command, then start the MCP server. Configuration with AUTH_TOKEN environment variable is also supported.
auth_status
Check the authentication status of the Microsoft Graph connection. Returns whether the user is authenticated and shows their basic profile information.
get_current_user
Get the current authenticated user's profile information including display name, email, job title, and department.
search_users
Search for users in the organization by name or email address. Returns matching users with their basic profile information.
get_user
Get detailed information about a specific user by their ID or email address. Returns profile information including name, email, job title, and department.
list_teams
List all Microsoft Teams that the current user is a member of. Returns team names, descriptions, and IDs.
list_channels
List all channels in a specific Microsoft Team. Returns channel names, descriptions, types, and IDs for the specified team.
get_channel_messages
Retrieve recent messages from a specific channel in a Microsoft Team. Returns message content, sender information, and timestamps.
send_channel_message
Send a message to a specific channel in a Microsoft Team. Supports text and markdown formatting, mentions, and importance levels.
get_channel_message_replies
Get all replies to a specific message in a channel. Returns reply content, sender information, and timestamps.
reply_to_channel_message
Reply to a specific message in a channel. Supports text and markdown formatting, mentions, and importance levels.
list_team_members
List all members of a specific Microsoft Team. Returns member names, email addresses, roles, and IDs.
search_users_for_mentions
Search for users to mention in messages. Returns users with their display names, email addresses, and mention IDs.
download_message_hosted_content
Download hosted content (such as images) from a Teams channel message. Returns the content as base64 encoded data along with metadata. Use this to retrieve images or other inline content embedded in messages.
delete_channel_message
Soft delete a message in a channel. Only the message sender can delete their own messages. The message will be marked as deleted.
update_channel_message
Update (edit) a message in a channel that was previously sent. Only the message sender can update their own messages.
set_channel_message_reaction
Add a reaction to a message in a Teams channel. Supports Unicode emoji characters and named reactions (like, angry, sad, laugh, heart, surprised). Can also react to replies.
unset_channel_message_reaction
Remove a reaction from a message in a Teams channel. Can also remove reactions from replies.
send_file_to_channel
Upload a local file and send it as a message to a Teams channel. Supports any file type (PDF, DOCX, ZIP, images, etc.). The file is uploaded to the channel's SharePoint folder and sent as a reference attachment. If messageId is provided, the file is sent as a reply to that message (thread).
list_chats
List all recent chats (1:1 conversations and group chats) that the current user participates in. Returns chat topics, types, and participant information.
get_chat_messages
Retrieve recent messages from a specific chat conversation. Returns message content, sender information, and timestamps.
download_chat_hosted_content
Download hosted content (such as images) from a chat message. Returns the content as base64 encoded data along with metadata. Use this to retrieve images or other inline content embedded in chat messages.
send_chat_message
Send a message to a specific chat conversation. Supports text and markdown formatting, mentions, and importance levels.
create_chat
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.
update_chat_message
Update (edit) a chat message that was previously sent. Only the message sender can update their own messages. Supports updating content with text or Markdown formatting, mentions, and importance levels.
delete_chat_message
Soft delete a chat message that was previously sent. Only the message sender can delete their own messages. The message will be marked as deleted but can still be seen as '[This message has been deleted]'.
set_chat_message_reaction
Add a reaction to a message in a chat conversation. Supports Unicode emoji characters and named reactions (like, angry, sad, laugh, heart, surprised).
unset_chat_message_reaction
Remove a reaction from a message in a chat conversation.
send_file_to_chat
Upload a local file and send it as a message to a Teams chat. Supports any file type (PDF, DOCX, ZIP, images, etc.). The file is uploaded to OneDrive and sent as a reference attachment.
search_messages
Search for messages across all Microsoft Teams channels and chats using the Microsoft Search API. The query string supports KQL (Keyword Query Language) syntax for advanced filtering: from:<name> — messages sent by a person (e.g. from:bob) to:<name> — messages sent to a person mentions:<userId> — messages that mention a specific user ID (without dashes) IsMentioned:true — messages that mention the current user hasAttachment:true|false — filter by attachment presence IsRead:true|false — filter by read status sent>=YYYY-MM-DD — messages sent on or after a date sent<=YYYY-MM-DD — messages sent on or before a date Examples: "quarterly report" from:alice sent>=2025-01-01 hasAttachment:true from:bob project update sent>=2025-02-01 Use get_chat_messages or get_channel_messages for browsing a specific conversation.
get_my_mentions
Find recent messages where the current user was @mentioned across all Teams channels and chats.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"teams mcp": {
"teams-mcp": {
"command": "npx",
"args": [
"-y",
"@floriscornel/teams-mcp@latest"
]
}
}
}
}
McpServers
{
"teams-mcp": {
"command": "npx",
"args": [
"-y",
"@floriscornel/teams-mcp@latest"
]
}
}
Teams MCP
A Model Context Protocol (MCP) server that provides seamless integration with Microsoft Graph APIs, enabling AI assistants to interact with Microsoft Teams, users, chats, files, and organizational data.
<a href="https://glama.ai/mcp/servers/@floriscornel/teams-mcp">
</a>
📦 Installation
To use this MCP server in Cursor/Claude/VS Code, add the following configuration:
{
"mcpServers": {
"teams-mcp": {
"command": "npx",
"args": ["-y", "@floriscornel/teams-mcp@latest"]
}
}
}
🚀 Features
🔐 Authentication
- OAuth 2.0 device code authentication flow with Microsoft Graph - Secure token management, cache persistence, and refresh token renewal - Authentication status checking and logout support - Read-only mode with reduced scopes - DirectAUTH_TOKEN support for pre-issued Microsoft Graph access tokens
👥 User Management
- Get current user information - Search users by name or email - Retrieve detailed user profiles - Access organizational directory data🏢 Microsoft Teams Integration
- Teams Management - List user's joined teams - Access team details and metadata- Channel Operations
- List channels within teams
- Retrieve channel messages and replies
- Send messages to team channels
- Reply to existing channel threads
- Edit and soft delete channel messages and replies
- Support for message importance levels (normal, high, urgent)
- Support for inline image attachments via URL or base64 data
- Team Members
- List team members and their roles
- Access member information
- Search users for @mentions
💬 Chat & Messaging
- 1:1 and Group Chats - List user's chats - Create new 1:1 or group conversations - Retrieve chat message history with filtering, ordering, and pagination - Fetch all available messages via@odata.nextLink pagination
- Send messages to existing chats
- Edit previously sent chat messages
- Soft delete chat messages
✏️ Message Management
- Edit & Delete - Update (edit) sent messages in chats and channels - Soft delete messages in chats and channels (marks as deleted without permanent removal) - Only message senders can update/delete their own messages - Support for Markdown formatting, mentions, and importance levels on edits📎 Media & Attachments
- Hosted Content - Download hosted content (images, files) from chat and channel messages - Access inline images and attachments shared in conversations - Optionally save hosted content directly to disk- File Upload
- Upload and send any file type (PDF, DOCX, XLSX, ZIP, images, etc.) to channels and chats
- Large file support (>4 MB) via resumable upload sessions
- Channel uploads go to SharePoint and chat uploads go to OneDrive
- Optional message text, custom filename, formatting, and importance levels
🔍 Advanced Search & Discovery
- Message Search - Search across all Teams channels and chats using Microsoft Search API - Support for KQL (Keyword Query Language) syntax - Filter by sender, mentions, attachments, read state, and date ranges - Get recent messages with advanced filtering options - Find messages mentioning the current userRich Message Formatting Support
The following tools support rich message formatting in Teams channels and chats:
- send_channel_message
- send_chat_message
- reply_to_channel_message
- update_channel_message
- update_chat_message
- send_file_to_channel
- send_file_to_chat
Format Options
You can specify the format parameter to control the message formatting:
- text (default): Plain text
- markdown: Markdown formatting (bold, italic, lists, links, code, etc.) converted to sanitized HTML
When format is set to markdown, the message content is converted to HTML using a secure markdown parser and sanitized to remove potentially dangerous content before being sent to Teams.
If format is not specified, the message will be sent as plain text.
Example Usage
{
"teamId": "...",
"channelId": "...",
"message": "Bold text and _italic text_\n\n- List item 1\n- List item 2\n\nLink",
"format": "markdown",
"importance": "high"
}
{
"chatId": "...",
"message": "Simple plain text message",
"format": "text"
}
Security Features
- HTML Sanitization: All markdown content is converted to HTML and sanitized to remove potentially dangerous elements (scripts, event handlers, etc.)
- Allowed Tags: Only safe HTML tags are permitted (p, strong, em, a, ul, ol, li, h1-h6, code, pre, etc.)
- Safe Attributes: Only safe attributes are allowed
- XSS Prevention: Content is automatically sanitized to prevent cross-site scripting attacks
Supported Markdown Features
- Text formatting: Bold (text), italic (_text_), strikethrough (~~text~~)
- Links: text
- Lists: Bulleted (- item) and numbered (1. item)
- Code: Inline ` code and fenced code blocks# H1
- Headings: through ###### H6> quoted text
- Blockquotes:
- Tables: GitHub-flavored markdown tables
LLM-Friendly Content Format
Messages retrieved from the Microsoft Graph API are returned as raw HTML containing Teams-specific tags. To make this content more consumable by AI assistants, the following tools support automatic HTML-to-Markdown conversion:
- get_chat_messagesget_channel_messages
- get_channel_message_replies
- search_messages
- get_my_mentions
-
Content Format Options
Use the contentFormat parameter to control how message content is returned:markdown
- (default): Converts Teams HTML to clean Markdown, optimized for LLM consumptionraw
- : Returns the original HTML from the Microsoft Graph API
What Gets Converted
| HTML Element | Markdown Output |
| -------------------------------------- | --------------------------------------------------------- |
| <at id="0">Name</at> (Teams mention) | @Name (multi-word names merged using mentions metadata) |<strong>text</strong>
| | text |<em>text</em>
| | text |<code>text</code>
| | text |<a href="url">text</a>
| | text |<ul><li>item</li></ul>
| | - item |<table>...</table>
| | GFM Markdown table |<attachment id="...">
| | {attachment:id} |<systemEventMessage/>
| | (removed) |<hr>
| | --- |
| , &, etc. | Decoded to plain characters |
Attachment Metadata
Messages that contain file attachments or inline images include an attachments array in the response with metadata for each attachment (id, name, contentType, contentUrl, thumbnailUrl). The inline {attachment:id} markers in the markdown content correlate with entries in this array, allowing consumers to identify and download attachments via download_message_hosted_content or download_chat_hosted_content.
Example Usage
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "markdown"
}
To get the original HTML:
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "raw"
}
📦 Installation
``bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




