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.
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
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 |
To start the MCP Teams Server:
uv run mcp-teams-server
A Docker image is available to run the MCP server:
docker build . -t inditextech/mcp-teams-server
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
The MCP Teams Server supports the following operations:
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
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.
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"
]
}
}
}
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.
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.