Teams (floriscornel)

Messaging and email

MCP server providing comprehensive Microsoft Teams and Graph API access for AI assistants including messaging, search, and user management.

Your AI app calls the Teams (floriscornel) MCP server, which does the work through tools like auth_status, get_current_user, search_users and get_user and sends the result back to the chat.

About Teams (floriscornel)

Teams (floriscornel) is a community MCP server from floriscornel, filed in our directory under messaging and email. MCP server providing comprehensive Microsoft Teams and Graph API access for AI assistants including messaging, search, and user management.

Teams (floriscornel) runs on your own machine: your AI app starts it with the command npx -y @floriscornel/teams-mcp and talks to it over standard input and output.

The README for Teams (floriscornel) lists tools such as auth_status, get_current_user, search_users and get_user, which your AI app can call once the server is connected.

At a glance

Publisher
floriscornel (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @floriscornel/teams-mcp
Written in
TypeScript
License
MIT
GitHub stars
153

Tools Teams (floriscornel) gives your AI app

  • auth_statusCheck current authentication status.
  • get_current_userGet authenticated user information.
  • search_usersSearch for users by name or email.
  • get_userGet detailed user information by ID or email.
  • list_teamsList user's joined teams.
  • list_channelsList channels in a specific team.
  • get_channel_messagesRetrieve messages from a team channel with attachment summaries and content format selection.
  • get_channel_message_repliesGet replies to a specific channel message.
  • send_channel_messageSend a message to a team channel with optional mentions, importance, and image attachments.
  • reply_to_channel_messageReply to an existing channel message.
  • update_channel_messageEdit a previously sent channel message or reply.
  • delete_channel_messageSoft delete a channel message or reply.
  • set_channel_message_reactionAdd a reaction to a channel message.
  • unset_channel_message_reactionRemove a reaction from a channel message.
  • list_team_membersList members of a specific team.
  • search_users_for_mentionsSearch for team members to @mention in messages.
  • send_file_to_channelUpload a local file and send it as a message to a channel.
  • list_chatsList user's chats (1:1 and group).
  • get_chat_messagesRetrieve messages from a specific chat with pagination, filters, ordering, and fetchAll.
  • send_chat_messageSend a message to a chat.
  • create_chatCreate a new 1:1 or group chat.
  • add_chat_memberAdd one or more members to an existing group chat.
  • update_chat_messageEdit a previously sent chat message.
  • delete_chat_messageSoft delete a chat message.

Tool names as the Teams (floriscornel) README lists them. Your AI app shows the live list once Teams (floriscornel) is connected.

How to set up Teams (floriscornel)

  1. Install Node.js on the machine that runs your AI app, because Teams (floriscornel) starts with npx and downloads its package on first run.
  2. Check the Teams (floriscornel) README for keys or settings; the registry lists none that Teams (floriscornel) requires.
  3. Add Teams (floriscornel) to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Teams (floriscornel) tools to confirm the connection.
  5. Run one read-only task with Teams (floriscornel) first, such as a call to auth_status, before you allow anything that writes or sends.

Teams (floriscornel) compared with similar servers

  • halfsize by YKLovePython has fewer GitHub stars than Teams (floriscornel) (151 against 153); both are community servers, and both run locally.
  • Wechat Decrypt by 328336690 has more GitHub stars than Teams (floriscornel) (155 against 153); both are community servers, and both run locally.
  • Claude Telegram Supercharged by k1p1l0 has fewer GitHub stars than Teams (floriscornel) (147 against 153); both are community servers, and both run locally.

Before you connect Teams (floriscornel)

  • Give Teams (floriscornel) its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Teams (floriscornel) tool call until you trust what it does with them.
  • Treat text that Teams (floriscornel) fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Teams (floriscornel) on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Teams (floriscornel)

How marketing and sales teams put Teams (floriscornel) to work, by company size. Pick the size closest to yours and start Teams (floriscornel) on one use case.

Small business

  • A small team can have Teams (floriscornel) summarize the inbox or channel each morning, so nothing from a customer waits until the afternoon.
  • Owners can draft replies and follow-ups with Teams (floriscornel) and send them only after a read, keeping the personal tone customers expect.
  • Teams (floriscornel) runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Teams (floriscornel) to turn long launch threads into decisions, owners and dates that land in the project tracker.
  • Sales and success teams can connect Teams (floriscornel) so an agent drafts follow-ups after every customer call, ready to edit and send.
  • Start with auth_status and get_current_user, the tools Teams (floriscornel) lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can deploy Teams (floriscornel) with retention and data loss rules intact, so agents summarize conversations without moving data outside policy.
  • Internal comms teams can use Teams (floriscornel) to find what employees ask most across channels and answer it once, in the right place.
  • Teams (floriscornel) is a community server, so have security review the code and pin a version before Teams (floriscornel) touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Teams (floriscornel) README

From floriscornel/teams-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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.

📦 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
  • Direct AUTH_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 user

Rich 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\n[Link](https://example.com)",
  "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](url)
  • Lists: Bulleted (- item) and numbered (1. item)
  • Code: Inline `code` and fenced code blocks
  • Headings: # H1 through ###### H6
  • 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 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> ---
&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:

{
  "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
  • Microsoft Graph delegated permissions for the scopes below
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
Authentication Modes

Full access:

npx @floriscornel/teams-mcp@latest authenticate

Read-only access:

npx @floriscornel/teams-mcp@latest authenticate --read-only

Direct token injection with an existing Microsoft Graph JWT:

{
  "mcpServers": {
    "teams-mcp": {
      "command": "npx",
      "args": ["-y", "@floriscornel/teams-mcp@latest"],
      "env": {
        "AUTH_TOKEN": "<jwt-for-https://graph.microsoft.com>"
      }
    }
  }
}
Token Storage
  • Auth metadata is stored locally at ~/.msgraph-mcp-auth.json
  • Token cache is stored locally at ~/.teams-mcp-token-cache.json

🛠️ 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
CLI Commands
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)
Environment Variables
  • TEAMS_MCP_READ_ONLY=true - Start the MCP server in read-only mode
  • AUTH_TOKEN=<jwt> - Use a pre-existing Microsoft Graph access token instead of MSAL login
  • TEAMS_MCP_CLIENT_ID=<guid> - Authenticate with your own Azure AD app registration instead of the default Microsoft Graph CLI app
  • TEAMS_MCP_TENANT_ID=<guid-or-domain> - Pin the authority to a specific tenant (e.g. contoso.onmicrosoft.com); required for single-tenant app registrations
  • TEAMS_MCP_SCOPES="User.Read Chat.ReadWrite" - Override the permission scopes requested during authentication (comma or space separated)
Using Your Own Azure AD App Registration

By default the server authenticates through Microsoft's public Graph CLI app. To use your own app registration (for example, when your tenant requires it):

  1. In App registrations, set Authentication → Allow public client flows → Yes
  2. Add the required Delegated Microsoft Graph permissions (see the list above)
  3. Authenticate with your app pinned to your tenant:
TEAMS_MCP_CLIENT_ID=<your-app-id> \
TEAMS_MCP_TENANT_ID=<your-tenant-id> \
npx @floriscornel/teams-mcp@latest authenticate

Set the same environment variables on the MCP server process so it can renew tokens with the same app identity.

Admin Consent Troubleshooting

Most Teams permissions (Team.ReadBasic.All, ChannelMessage.*, Chat.ReadWrite, Files.ReadWrite.All) require admin consent. If sign-in shows "Need admin approval", an admin must grant consent for the app once, via Enterprise applications → Permissions → Grant admin consent, or by opening:

https://login.microsoftonline.com/<tenant-id>/v2.0/adminconsent?client_id=<app-id>&scope=<space-separated scopes>&redirect_uri=<registered-redirect-uri>

After admin consent is granted, authenticate completes without prompts. Requesting scopes that are not configured on the app registration will always trigger the admin-approval wall, verify the app's API permissions list covers every requested scope.

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:

npx @floriscornel/teams-mcp@latest authenticate --read-only

MCP server configuration (read-only):

{
  "mcpServers": {
    "teams-mcp": {
      "command": "npx",
      "args": ["-y", "@floriscornel/teams-mcp@latest"],
      "env": {
        "TEAMS_MCP_READ_ONLY": "true"
      }
    }
  }
}

Switching modes: When switching from read-only to full mode, the server detects the scope mismatch and warns you to re-authenticate:

npx @floriscornel/teams-mcp@latest authenticate

Read-only tools (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

Write tools disabled in read-only mode (15): send_channel_message, reply_to_channel_message, update_channel_message, delete_channel_message, send_file_to_channel, send_chat_message, create_chat, add_chat_member, update_chat_message, delete_chat_message, send_file_to_chat, set_channel_message_reaction, set_chat_message_reaction, unset_channel_message_reaction, unset_chat_message_reaction

Available MCP Tools
Authentication
  • auth_status - Check current authentication status
User Operations
  • get_current_user - Get authenticated user information
  • search_users - Search for users by name or email
  • get_user - Get detailed user information by ID or email
Teams Operations
  • list_teams - List user's joined teams
  • list_channels - List channels in a specific team
  • get_channel_messages - Retrieve messages from a team channel with attachment summaries and content format selection
  • get_channel_message_replies - Get replies to a specific channel message
  • send_channel_message - Send a message to a team channel with optional mentions, importance, and image attachments
  • reply_to_channel_message - Reply to an existing channel message
  • update_channel_message - Edit a previously sent channel message or reply
  • delete_channel_message - Soft delete a channel message or reply
  • set_channel_message_reaction - Add a reaction to a channel message
  • unset_channel_message_reaction - Remove a reaction from a channel message
  • list_team_members - List members of a specific team
  • search_users_for_mentions - Search for team members to @mention in messages
  • send_file_to_channel - Upload a local file and send it as a message to a channel
Chat Operations
  • list_chats - List user's chats (1:1 and group)
  • get_chat_messages - Retrieve messages from a specific chat with pagination, filters, ordering, and fetchAll
  • send_chat_message - Send a message to a chat
  • create_chat - Create a new 1:1 or group chat
  • add_chat_member - Add one or more members to an existing group chat
  • update_chat_message - Edit a previously sent chat message
  • delete_chat_message - Soft delete a chat message
  • set_chat_message_reaction - Add a reaction to a chat message
  • unset_chat_message_reaction - Remove a reaction from a chat message
  • send_file_to_chat - Upload a local file and send it as a message to a chat
Media Operations
  • download_message_hosted_content - Download hosted content (images, files) from channel messages
  • download_chat_hosted_content - Download hosted content (images, files) from chat messages
Search Operations
  • search_messages - Search across all Teams messages using KQL syntax
  • get_my_mentions - Find recent messages mentioning the current user

📋 Examples

Authentication

First, authenticate with Microsoft Graph:

# Full access (default)
npx @floriscornel/teams-mcp@latest authenticate

# Read-only (reduced permission scopes)
npx @floriscornel/teams-mcp@latest authenticate --read-only

Check your authentication status:

npx @floriscornel/teams-mcp@latest check

Logout if needed:

npx @floriscornel/teams-mcp@latest logout
Chat Pagination Example
{
  "chatId": "19:meeting_...",
  "limit": 100,
  "fetchAll": true,
  "orderBy": "createdDateTime",
  "descending": true,
  "contentFormat": "markdown"
}
Channel Message with Mentions and Image
{
  "teamId": "team-id",
  "channelId": "channel-id",
  "message": "Please review **today's update**",
  "format": "markdown",
  "importance": "high",
  "mentions": [
    {
      "mention": "alex.chen",
      "userId": "00000000-0000-0000-0000-000000000000"
    }
  ],
  "imageUrl": "https://example.com/status.png"
}
File Upload Example
{
  "chatId": "19:meeting_...",
  "filePath": "/absolute/path/to/report.pdf",
  "message": "Please review the attached report",
  "format": "markdown"
}
Integrating with Cursor/Claude

This MCP server is designed to work with AI assistants like Claude/Cursor/VS Code through the Model Context Protocol.

{
  "mcpServers": {
    "teams-mcp": {
      "command": "npx",
      "args": ["-y", "@floriscornel/teams-mcp@latest"]
    }
  }
}

🔒 Security

  • All authentication is handled through Microsoft's OAuth 2.0 flow or a caller-provided Microsoft Graph token
  • Refresh token support: Access tokens are automatically renewed using cached refresh tokens, so you don't need to re-authenticate every hour
  • Token cache is stored locally at ~/.teams-mcp-token-cache.json
  • Auth metadata is stored locally at ~/.msgraph-mcp-auth.json
  • Markdown content is sanitized before sending HTML to Teams
  • AUTH_TOKEN is validated to ensure it targets https://graph.microsoft.com
  • No sensitive data is logged or exposed
  • Follows Microsoft Graph API security best practices

📝 License

MIT License - see LICENSE file for details

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run build, linting, and tests
  5. Submit a pull request

📞 Support

For issues and questions:

  • Check the existing GitHub issues
  • Review Microsoft Graph API documentation
  • Ensure proper authentication and permissions are configured

Questions about Teams (floriscornel)

What is the Teams (floriscornel) MCP server?

MCP server providing comprehensive Microsoft Teams and Graph API access for AI assistants including messaging, search, and user management. Teams (floriscornel) is maintained by floriscornel on GitHub at floriscornel/teams-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Teams (floriscornel) MCP server?

Add Teams (floriscornel) to your AI app's MCP config with the command npx -y @floriscornel/teams-mcp. In Claude Code, run claude mcp add --transport stdio teams -- npx -y @floriscornel/teams-mcp. To run Teams (floriscornel) this way you need Node.js installed.

Does Teams (floriscornel) need an API key?

The registry lists no required keys for Teams (floriscornel). Check the Teams (floriscornel) README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Teams (floriscornel) an official MCP server?

No. Teams (floriscornel) is a community server maintained by floriscornel. Community servers can be excellent; read the code and the open issues before you give Teams (floriscornel) access to company data.

What license is Teams (floriscornel) under?

Teams (floriscornel) is released under the MIT license, according to its GitHub repository. The license covers the code of Teams (floriscornel); the service it connects to has its own terms.