Microsoft Teams MCP server

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.
Back to servers
Setup instructions
Provider
Floris Cornel
Release date
Jun 06, 2025
Stats
14 stars

Teams MCP is a Model Context Protocol server enabling AI assistants to interact with Microsoft Teams, users, and organizational data through Microsoft Graph APIs. It provides comprehensive access to Teams channels, chats, users, and search functionality with proper authentication.

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"]
    }
  }
}

For manual installation:

# Install dependencies
npm install

# Build the project
npm run build

# Set up authentication
npm run auth

Authentication

First, authenticate with Microsoft Graph:

npx @floriscornel/teams-mcp@latest authenticate

Check your authentication status:

npx @floriscornel/teams-mcp@latest check

Logout if needed:

npx @floriscornel/teams-mcp@latest logout

Configuration

Prerequisites

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

Required Microsoft Graph Permissions

  • 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
  • Chat.Read - Read chat messages
  • Chat.ReadWrite - Create and manage chats
  • Mail.Read - Required for Microsoft Search API
  • Calendars.Read - Required for Microsoft Search API
  • Files.Read.All - Required for Microsoft Search API
  • Sites.Read.All - Required for Microsoft Search API

Starting the Server

# Development mode with hot reload
npm run dev

# Production mode
npm run build && node dist/index.js

Available MCP Tools

Authentication Tools

  • authenticate - Initiate OAuth authentication flow
  • logout - Clear authentication tokens
  • get_current_user - Get authenticated user information

User Operations

  • 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 pagination and filtering
  • send_channel_message - Send a message to a team channel
  • list_team_members - List members of a specific team

Chat Operations

  • list_chats - List user's chats (1:1 and group)
  • get_chat_messages - Retrieve messages from a specific chat with pagination and filtering
  • send_chat_message - Send a message to a chat
  • create_chat - Create a new 1:1 or group chat

Search Operations

  • search_messages - Search across all Teams messages using KQL syntax
  • get_recent_messages - Get recent messages with advanced filtering options
  • get_my_mentions - Find messages mentioning the current user

Rich Message Formatting

The following tools support rich message formatting in Teams channels and chats:

  • send_channel_message
  • send_chat_message
  • reply_to_channel_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

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"
}

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

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "teams-mcp" '{"command":"npx","args":["-y","@floriscornel/teams-mcp@latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later