Microsoft Teams

Microsoft Teams

floriscornel

Integrates with Microsoft Teams through Graph API to read and send messages, search users, browse teams and channels. Uses secure OAuth authentication to access your organization's Teams data.

Integrates with Microsoft Teams through Graph API to search messages, manage chats and channels, send messages, create group chats, and handle user/team operations with device code authentication for secure access.

591,051 views30Local (stdio)

What it does

  • Send messages to Teams channels
  • Search teams messages and conversations
  • Browse teams and channels
  • Search users in your organization
  • Reply to channel messages
  • Retrieve channel message histories

Best for

Teams administrators managing communicationsAutomating team notifications and updatesSearching across team conversationsBuilding Teams workflow integrations
OAuth 2.0 authenticationFull Microsoft Graph API accessMessage formatting support

About Microsoft Teams

Microsoft Teams is a community-built MCP server published by floriscornel that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate Microsoft Teams with Microsoft Graph API to manage chats, messages, and users securely using device code authe It is categorized under productivity, communication. This server exposes 19 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install Microsoft Teams in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Microsoft Teams is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (19)

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.

Teams MCP

npm version npm downloads codecov License: MIT GitHub stars

A Model Context Protocol (MCP) server that provides seamless integration with Microsoft Graph APIs, enabling AI assistants to interact with Microsoft Teams, users, and organizational data.

Teams MCP server

📦 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 authentication flow with Microsoft Graph
  • Secure token management and refresh
  • Authentication status checking

👥 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
    • Send messages to team channels
    • Support for message importance levels (normal, high, urgent)
  • Team Members

    • List team members and their roles
    • Access member information

💬 Chat & Messaging

  • 1:1 and Group Chats
    • List user's chats
    • Create new 1:1 or group conversations
    • Retrieve chat message history with filtering and 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
  • 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
    • 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, importance, and date ranges
    • Get recent messages with advanced filtering options
    • Find messages mentioning specific users

Rich Message Formatting Support

The following tools now 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

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\n[Link](https://example.com)",
  "format": "markdown"
}
{
  "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 (href, target, src, alt, title, width, height)
  • 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](url)
  • Lists: Bulleted (- item) and numbered (1. item)
  • Code: Inline `code` and blocks code
  • Headings: # H1 through ###### H6
  • Line breaks: Automatic conversion of newlines to <br> tags
  • Blockquotes: > quoted text
  • 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_messages
  • get_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 consumption
  • raw: Returns the original HTML from the Microsoft Graph API

What Gets Converted

HTML ElementMarkdown 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>---
&nbsp;, &amp;, 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 (previous default behavior):

{
  "chatId": "19:meeting_...",
  "limit": 10,
  "contentFormat": "raw"
}

📦 Installation

# Install dependencies
npm install

# Build the project
npm run build

# Set up authentication
npm run auth

🔧 Configuration

Prerequisites

  • Node.js 18+
  • Microsoft 365 account with appropriate permissions
  • Azure App Registration with Microsoft Graph permissions

Required Microsoft Graph Permissions

Full mode (default):

  • User.Read - Read user profile
  • User.ReadBasic.All - Read basic user info
  • Team.ReadBasic.All - Read team information
  • Channel.ReadBasic.All - Read channel information
  • ChannelMessage.Read.All - Read channel messages
  • ChannelMessage.Send - Send channel messages and replies
  • ChannelMessage.ReadWrite - Edit and delete channel messages
  • Chat.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 members
  • Files.ReadWrite.All - Required for file uploads to channels and chats

Read-only mode (TEAMS_MCP_READ_ONLY=true) — only these scopes are requested:

  • User.Read
  • User.ReadBasic.All
  • Team.ReadBasic.All
  • Channel.ReadBasic.All
  • ChannelMessage.Read.All
  • TeamMember.Read.All
  • Chat.Read

🛠️ Usage

Starting the Server

# 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.js

Read-Only Mode

The server supports a read-only mode that disables all write operations (sending messages, creating chats, uploading files, editing/deleting messages) and requests only read-permission scopes from Microsoft Graph.

Enable read-only mode using either:

  • Environment variable: TEAMS_MCP_READ_ONLY=true
  • CLI flag: --read-only

Authenticate with reduced scopes: `


README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
microsoft-teams-automation

Automate Microsoft Teams tasks via Rube MCP (Composio): send messages, manage channels, create meetings, handle chats, and search messages. Always search tools first for current schemas.

13
teams-channel-post-writer

Creates educational Teams channel posts for internal knowledge sharing about Claude Code features, tools, and best practices. Applies when writing posts, announcements, or documentation to teach colleagues effective Claude Code usage, announce new features, share productivity tips, or document lessons learned. Provides templates, writing guidelines, and structured approaches emphasizing concrete examples, underlying principles, and connections to best practices like context engineering. Activates for content involving Teams posts, channel announcements, feature documentation, or tip sharing.

4
ms365-tenant-manager

Microsoft 365 tenant administration for Global Administrators. Automate M365 tenant setup, Office 365 admin tasks, Azure AD user management, Exchange Online configuration, Teams administration, and security policies. Generate PowerShell scripts for bulk operations, Conditional Access policies, license management, and compliance reporting. Use for M365 tenant manager, Office 365 admin, Azure AD users, Global Administrator, tenant configuration, or Microsoft 365 automation.

3
teams-anthropic-integration

Use @youdotcom-oss/teams-anthropic to add Anthropic Claude models (Opus, Sonnet, Haiku) to Microsoft Teams.ai applications. Optionally integrate You.com MCP server for web search and content extraction.

1
workiq-copilot

Guides the Copilot CLI on how to use the WorkIQ CLI/MCP server to query Microsoft 365 Copilot data (emails, meetings, docs, Teams, people) for live context, summaries, and recommendations.

1
strategic-alignment

Cascades strategy from boardroom to individual contributor. Detects and fixes misalignment between company goals and team execution. Covers strategy articulation, cascade mapping, orphan goal detection, silo identification, communication gap analysis, and realignment protocols. Use when teams are pulling in different directions, OKRs don't connect, departments optimize locally at company expense, or when user mentions alignment, strategy cascade, silo, conflicting OKRs, or strategy communication.

1