by floriscornel
MCP server providing comprehensive Microsoft Teams and Graph API access for AI assistants including messaging, search, and user management.
# Add to your Claude Code skills
git clone https://github.com/floriscornel/teams-mcpA 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.
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"]
}
}
}
AUTH_TOKEN support for pre-issued Microsoft Graph access tokensNo comments yet. Be the first to share your thoughts!
Teams Management
Channel Operations
normal, high, urgent)Team Members
@mentions@odata.nextLink paginationHosted Content
File Upload
The following tools support rich message formatting in Teams channels and chats:
send_channel_messagesend_chat_messagereply_to_channel_messageupdate_channel_messageupdate_chat_messagesend_file_to_channelsend_file_to_chatYou can specify the format parameter to control the message formatting:
text (default): Plain textmarkdown: Markdown formatting (bold, italic, lists, links, code, etc.) converted to sanitized HTMLWhen 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.
{
"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"
}
**text**), italic (_text_), strikethrough (~~text~~)[text](url)- item) and numbered (1. item)`code` and fenced code blocks# H1 through ###### H6> quoted textMessages 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_messagesget_channel_message_repliessearch_messagesget_my_mentionsUse 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| 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](url) |
| <ul><li>item</li></ul> | - item |
| <table>...</table> | GFM Markdown table |
| <attachment id="..."> | {attachment:id} |
| <systemEventMessage/> | (removed) |
| <hr> | --- |
| , &, etc. | Decoded to plain characters |
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.
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "markdown"
}
To get the original HTML:
{
"chatId": "19:meeting_...",
"limit": 10,
"contentFormat": "raw"
}
# Install dependencies
npm install
# Build the project
npm run build
# Set up authentication
npm run auth
Full mode (default):
User.Read - Read user profileUser.ReadBasic.All - Read basic user infoTeam.ReadBasic.All - Read team informationChannel.ReadBasic.All - Read channel informationChannelMessage.Read.All - Read channel messagesChannelMessage.Send - Send channel messages and repliesChannelMessage.ReadWrite - Edit and delete channel messagesChat.Read - Read chat messages (included via read-only scopes)Chat.ReadWrite - Create and manage chats, send/edit/delete chat messages (supersedes Chat.Read)TeamMember.Read.All - Read team membersFiles.ReadWrite.All - Required for file uploads to channels and chatsRead-only mode (TEAMS_MCP_READ_ONLY=true) — only these scopes are requested:
User.ReadUser.ReadBasic.AllTeam.ReadBasic.AllChannel.ReadBasic.AllChannelMessage.Read.AllTeamMember.Read.AllChat.ReadFull access:
npx @floriscornel/teams-mcp@latest authenticate
**Read-only a