Integrate AI with Microsoft Teams Communications
Microsoft Teams MCP Server reads, posts, and replies to Teams channel messages, mentioning members, via Azure app auth.
Why it matters
Enable AI assistants to seamlessly interact with Microsoft Teams, allowing them to read messages, create and reply to threads, mention users, and manage team communications.
Outcomes
What it gets done
Create and update threads with mentions
Read channel messages and replies
List team members within a channel
Manage communication secrets securely
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-microsoft-teams | bash Capabilities
Tools your agent gets
Create a new thread in a channel with title, content, and mention users.
Update an existing thread with replies and mention users.
Read all replies in a thread.
List all team members in a channel.
Read messages from a channel.
Overview
Microsoft Teams MCP Server
Microsoft Teams MCP Server gives an AI assistant the ability to read, post, and reply to Teams channel messages with member mentions, authenticated via Azure Entra ID. Use it when an AI assistant needs to post updates, reply to threads, or read messages in a specific Microsoft Teams channel.
What it does
Microsoft Teams MCP Server is an MCP server for Microsoft Teams integration, giving an AI assistant the ability to read messages, start new threads, reply to existing threads, and mention members directly in a Teams channel.
When to use - and when NOT to
Use it when you want an AI assistant to post updates to a Teams channel, reply to an existing conversation thread, read channel messages or thread replies, or list a channel's team members, all with the ability to at-mention specific people. It requires a Microsoft Teams account set up with an MS Entra ID application, TEAMS_APP_ID, TEAMS_APP_PASSWORD, and tenant configuration, plus a specific Team ID and Channel ID, so it depends on Azure/Entra app registration work being done first; the project's own setup document is explicitly not a step-by-step guide but a pointer to what you'll need. It is scoped to a single configured Team and Channel per running instance, not a general cross-tenant Teams browsing tool.
Capabilities
Thread and message tools cover starting a new thread in a channel with a title and content, mentioning users as needed; updating an existing thread with reply messages, again with mentions; and reading thread replies. Channel-level tools list the members of a team and read channel messages directly. Authentication runs through an MS Entra ID app registration, configured via TEAMS_APP_ID, TEAMS_APP_PASSWORD, TEAMS_APP_TYPE, SingleTenant or MultiTenant, and TEAMS_APP_TENANT_ID for single-tenant setups, alongside TEAM_ID and TEAMS_CHANNEL_ID identifying the specific Team and Channel to operate on.
How to install
Requires uv and Python 3.10, plus a properly configured Microsoft Teams account and Azure app registration. Clone and set up dependencies:
git clone [repository-url]
cd mcp-teams-server
uv venv
uv sync --frozen --all-extras --dev
Set the required environment variables, or use the provided sample.env as a template, then start it with uv run mcp-teams-server. A pre-built Docker image is also available from ghcr.io, docker pull ghcr.io/inditextech/mcp-teams-server:latest, or build your own with docker build . -t inditextech/mcp-teams-server and run it with docker run --env-file .env -it inditextech/mcp-teams-server.
Integration testing has its own environment variables, TEST_THREAD_ID, TEST_MESSAGE_ID, and TEST_USER_NAME, and can be run with uv run pytest -m integration.
Who it's for
Teams within organizations using Microsoft Teams who want an AI assistant to post updates, reply to threads, and read channel activity directly in a specific Teams channel, instead of switching to the Teams app for every message. It is released under the Apache-2.0 License.
Source README
MCP Teams Server
An MCP (Model Context Protocol) server implementation for
Microsoft Teams integration, providing capabilities to
read messages, create messages, reply to messages, mention members.
Features
https://github.com/user-attachments/assets/548a9768-1119-4a2d-bd5c-6b41069fc522
- 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
Prerequisites
- uv package manager
- Python 3.10
- Microsoft Teams account with proper set-up
Installation
- Clone the repository:
git clone [repository-url]
cd mcp-teams-server
- Create a virtual environment and install dependencies:
uv venv
uv sync --frozen --all-extras --dev
Teams configuration
Please read this document to help you to configure Microsoft Teams and required
Azure resources. It is not a step-by-step guide but can help you figure out what you will need.
Usage
Set up the following environment variables in your shell or in an .env file. You can use sample file
as a template:
| 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 |
Start the server:
uv run mcp-teams-server
Development
Integration tests require the set-up the following 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 |
uv run pytest -m integration
Pre-built docker image
There is a pre-built image hosted in ghcr.io.
You can install this image by running the following command
docker pull ghcr.io/inditextech/mcp-teams-server:latest
Build docker image
A docker image is available to run MCP server. You can build it with the following command:
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
Setup LLM to use MCP Teams Server
Please follow instructions on the following document
Security
For security concerns, please see our Security Policy.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.