$git clone https://github.com/InditexTech/mcp-teams-serverAn MCP (Model Context Protocol) server implementation for Microsoft Teams integration, providing capabilities to read messages, create messages, reply to mess
| 1 | [](https://sonarcloud.io/summary/new_code?id=InditexTech_mcp-teams-server) |
| 2 | [](https://sonarcloud.io/summary/new_code?id=InditexTech_mcp-teams-server) |
| 3 | [](https://sonarcloud.io/summary/new_code?id=InditexTech_mcp-teams-server) |
| 4 |  |
| 5 |  |
| 6 | [](https://scorecard.dev/viewer/?uri=github.com/InditexTech/mcp-teams-server) |
| 7 | <!-- [](https://www.bestpractices.dev/projects/10400) --> |
| 8 | |
| 9 | |
| 10 | # MCP Teams Server |
| 11 | |
| 12 | An MCP ([Model Context Protocol](https://modelcontextprotocol.io/introduction)) server implementation for |
| 13 | [Microsoft Teams](https://www.microsoft.com/en-us/microsoft-teams/group-chat-software/) integration, providing capabilities to |
| 14 | read messages, create messages, reply to messages, mention members. |
| 15 | |
| 16 | ## Features |
| 17 | |
| 18 | https://github.com/user-attachments/assets/548a9768-1119-4a2d-bd5c-6b41069fc522 |
| 19 | |
| 20 | - Start thread in channel with title and contents, mentioning users |
| 21 | - Update existing threads with message replies, mentioning users |
| 22 | - Read thread replies |
| 23 | - List channel team members |
| 24 | - Read channel messages |
| 25 | |
| 26 | ## Prerequisites |
| 27 | |
| 28 | - [uv](https://github.com/astral-sh/uv) package manager |
| 29 | - [Python 3.10](https://www.python.org/) |
| 30 | - Microsoft Teams account with [proper set-up](./doc/MS-Teams-setup.md) |
| 31 | |
| 32 | ## Installation |
| 33 | |
| 34 | 1. Clone the repository: |
| 35 | |
| 36 | ```bash |
| 37 | git clone [repository-url] |
| 38 | cd mcp-teams-server |
| 39 | ``` |
| 40 | |
| 41 | 2. Create a virtual environment and install dependencies: |
| 42 | |
| 43 | ```bash |
| 44 | uv venv |
| 45 | uv sync --frozen --all-extras --dev |
| 46 | ``` |
| 47 | |
| 48 | ## Teams configuration |
| 49 | |
| 50 | Please read [this document](./doc/MS-Teams-setup.md) to help you to configure Microsoft Teams and required |
| 51 | Azure resources. It is not a step-by-step guide but can help you figure out what you will need. |
| 52 | |
| 53 | ## Usage |
| 54 | |
| 55 | Set up the following environment variables in your shell or in an .env file. You can use [sample file](./sample.env) |
| 56 | as a template: |
| 57 | |
| 58 | | Key | Description | |
| 59 | |-------------------------|--------------------------------------------| |
| 60 | | **TEAMS_APP_ID** | UUID for your MS Entra ID application ID | |
| 61 | | **TEAMS_APP_PASSWORD** | Client secret | |
| 62 | | **TEAMS_APP_TYPE** | SingleTenant or MultiTenant | |
| 63 | | **TEAMS_APP_TENANT_ID** | Tenant uuid in case of SingleTenant | |
| 64 | | **TEAM_ID** | MS Teams Group Id or Team Id | |
| 65 | | **TEAMS_CHANNEL_ID** | MS Teams Channel ID with url escaped chars | |
| 66 | |
| 67 | Start the server: |
| 68 | |
| 69 | ```bash |
| 70 | uv run mcp-teams-server |
| 71 | ``` |
| 72 | |
| 73 | ## Development |
| 74 | |
| 75 | Integration tests require the set-up the following environment variables: |
| 76 | |
| 77 | | Key | Description | |
| 78 | |------------------------|--------------------------------| |
| 79 | | **TEST_THREAD_ID** | timestamp of the thread id | |
| 80 | | **TEST_MESSAGE_ID** | timestamp of the message id | |
| 81 | | **TEST_USER_NAME** | test user name | |
| 82 | |
| 83 | |
| 84 | ```bash |
| 85 | uv run pytest -m integration |
| 86 | ``` |
| 87 | |
| 88 | ### Pre-built docker image |
| 89 | |
| 90 | There is a [pre-built image](https://github.com/InditexTech/mcp-teams-server/pkgs/container/mcp-teams-server) hosted in ghcr.io. |
| 91 | You can install this image by running the following command |
| 92 | |
| 93 | ```commandline |
| 94 | docker pull ghcr.io/inditextech/mcp-teams-server:latest |
| 95 | ``` |
| 96 | |
| 97 | ### Build docker image |
| 98 | |
| 99 | A docker image is available to run MCP server. You can build it with the following command: |
| 100 | |
| 101 | ```bash |
| 102 | docker build . -t inditexte |