> ## Documentation Index
> Fetch the complete documentation index at: https://www.klavis.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Teams

> Connect AI agents to Microsoft Teams for team collaboration and communication automation

> [!NOTE]
>
> **Prerequisites**
> Before you begin, [create an account](https://www.klavis.ai/home/api-keys) and get your API Key.

## Getting started

Connect to Microsoft Teams to manage teams, channels, messages, and automate collaboration workflows through AI agents.

> [tab] API
>
> **1. Install the SDKs (optional)**
>
> ```bash pip theme={null}
> pip install klavis
> ```
>
> ```bash npm theme={null}
> npm install klavis
> ```
>
> **2. Create a server instance**
>
> ```python Python theme={null}
> from klavis import Klavis
> from klavis.types import McpServerName
>
> klavis_client = Klavis(api_key="YOUR_API_KEY")
>
> # Create a Microsoft Teams MCP server instance
> teams_server = klavis_client.mcp_server.create_server_instance(
>     server_name=McpServerName.MICROSOFT_TEAMS,
>     user_id="user123"
> )
> ```
>
> ```typescript TypeScript theme={null}
> import { KlavisClient, Klavis } from 'klavis';
>
> const klavis = new KlavisClient({ apiKey: process.env.KLAVIS_API_KEY! });
>
> // Create a Microsoft Teams MCP server instance
> const teamsServer = await klavis.mcpServer.createServerInstance({
>     serverName: Klavis.McpServerName.MicrosoftTeams,
>     userId: "user123"
> });
> ```
>
> ```bash cURL theme={null}
> curl -X POST "https://api.klavis.ai/mcp-server/instance/create" \
>   -H "Authorization: Bearer YOUR_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "serverName": "Microsoft Teams",
>     "userId": "user123"
>   }'
> ```
>
> > [!TIP]
> >
> > `userId` specifies whose connected accounts and data you are accessing in Klavis. It should be a unique id for yourself, your team, or your organization.
>
> > [!NOTE]
> >
> > **Response Information**: The API returns:
> >
> > * `serverUrl`: The URL for connecting your MCP client to Microsoft Teams
> > * `instanceId`: Unique identifier for your server instance
> > * `oauthUrl`: OAuth authorization URL for Microsoft Teams authentication
>
> **3. Authenticate**
>
> ```python Python theme={null}
> import webbrowser
>
> # Open OAuth authorization page
> webbrowser.open(teams_server.oauth_url)
> ```
>
> ```typescript TypeScript theme={null}
> // Redirect user to OAuth authorization
> window.location.href = teamsServer.oauthUrl;
> ```
>
> ```bash cURL theme={null}
> # Copy and paste the OAuth URL into your browser
> echo "Visit this URL to authorize: https://api.klavis.ai/oauth/microsoft_teams/authorize?instance_id=YOUR_INSTANCE_ID"
> ```
>
> > [!TIP]
> >
> > 🎉 **Your Microsoft Teams MCP Server is ready!** Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.

> [tab] UI
>
> **1. Open Dashboard**
>
> Go to your [Dashboard](https://www.klavis.ai/home/mcp-servers).
>
> **2. Choose Microsoft Teams**
>
> Select Microsoft Teams from the list of available integrations.
>
> **3. Authenticate**
>
> Complete the OAuth flow to connect your Microsoft account.
>
> **4. Use in your app**
>
> Copy the MCP endpoint URL and add it to your MCP-supported client (Claude Desktop, Cursor, VS Code, etc.).

> [tab] Open Source
>
> **1. Clone repository (for developers to build from source)**
>
> ```bash theme={null}
> git clone https://github.com/klavis-ai/klavis
> cd klavis/mcp_servers/microsoft_teams
> ```
>
> **2. Run with Docker**
>
> ```bash theme={null}
> # Pull the Docker image
> docker pull ghcr.io/klavis-ai/microsoft-teams-mcp-server:latest
>
> # Run with OAuth support (requires Klavis API key)
> docker run -p 5000:5000 \
>   -e KLAVIS_API_KEY=$KLAVIS_API_KEY \
>   ghcr.io/klavis-ai/microsoft-teams-mcp-server:latest
> ```
>
> **3. Configure MCP client**
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "microsoft_teams": {
>       "url": "http://localhost:5000/mcp/"
>     }
>   }
> }
> ```

## Available Tools

> [!TIP]
>
> With our progressive discovery approach, Klavis System is capable of enabling all tools for Microsoft Teams. Please use the [get\_tools](https://www.klavis.ai/docs/api-reference/mcp-server/get-tools.md) API for more details. If you find any tool that is missing, please reach out to [contact@klavis.ai](mailto:contact@klavis.ai).

## Next Steps

> [card] [White-label Authentication](https://www.klavis.ai/docs/auth/white-label.md)
>
> Customize OAuth flows with your own branding

> [card] [AI Platform Integrations](https://www.klavis.ai/docs/ai-platform-integration/overview.md)
>
> Integrate Klavis MCP Servers with leading AI platforms

> [card] [Integrations](https://www.klavis.ai/docs/mcp-server/overview.md)
>
> Explore available MCP servers

> [card] [API Reference](https://www.klavis.ai/docs/api-reference/introduction)
>
> REST endpoints and schemas


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.