Microsoft Teams MCP server

Integrates with Microsoft Teams to enable reading messages, creating threads, replying to messages, and mentioning team members through Azure bot credentials.
Back to servers
Provider
Inditex
Release date
Apr 04, 2025
Language
Python
Stats
176 stars

The MCP Teams Server implements the Model Context Protocol (MCP) for Microsoft Teams integration, allowing you to read messages, create messages, reply to messages, and mention team members. This server bridges the gap between LLMs (Large Language Models) and Microsoft Teams channels.

Prerequisites

  • uv package manager
  • Python 3.10
  • Microsoft Teams account with proper Azure setup

Installation

To install the MCP Teams Server:

git clone [repository-url]
cd mcp-teams-server

Create a virtual environment and install dependencies:

uv venv
uv sync --frozen --all-extras --dev

Configuration

Set up the following environment variables in your shell or in an .env file:

Key Description
TEAMS_APP_ID UUID for your MS Entra ID application ID
TEAMS_APP_PASSWORD Client secret
TEAMS_APP_TYPE SingleTenant or MultiTenant
TEAMS_APP_TENANT_ID Tenant uuid in case of SingleTenant
TEAM_ID MS Teams Group Id or Team Id
TEAMS_CHANNEL_ID MS Teams Channel ID with url escaped chars

Starting the Server

To start the MCP Teams Server:

uv run mcp-teams-server

Docker Installation

Build Docker Image

A Docker image is available to run the MCP server:

docker build . -t inditextech/mcp-teams-server

Run Docker Image

Basic run configuration:

docker run -it inditextech/mcp-teams-server

Run with environment variables from .env file:

docker run --env-file .env -it inditextech/mcp-teams-server

Features and Capabilities

The MCP Teams Server supports the following operations:

  • Start thread in channel with title and contents, mentioning users
  • Update existing threads with message replies, mentioning users
  • Read thread replies
  • List channel team members
  • Read channel messages

Integration Testing

If you need to run integration tests, set up the following additional environment variables:

Key Description
TEST_THREAD_ID timestamp of the thread id
TEST_MESSAGE_ID timestamp of the message id
TEST_USER_NAME test user name

Run the integration tests with:

uv run pytest -m integration

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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