Skip to main content
Prerequisites Before you begin, create an account and get your API Key.

Getting started

Connect to Microsoft Teams to manage teams, channels, messages, and automate collaboration workflows through AI agents.
  • API
  • UI
  • Open Source
1

Install the SDKs (optional)

pip install klavis
2

Create a server instance

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"
)
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

import webbrowser

# Open OAuth authorization page
webbrowser.open(teams_server.oauth_url)
🎉 Your Microsoft Teams MCP Server is ready! Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.

Available Tools

Tool NameDescription
create_teamCreate a new Microsoft Teams team
list_teamsList all teams joined by the user
get_team_by_nameGet team details by name
Tool NameDescription
add_member_to_teamAdd a member to a team by email
get_team_membersGet all members of a team
remove_members_from_teamRemove members from a team
Tool NameDescription
get_all_channelsGet all channels in a team
get_channel_by_nameGet channel details by name
add_channel_to_teamAdd a new channel to a team
remove_channel_from_teamRemove a channel from a team
Tool NameDescription
send_message_in_channelSend a message in a channel
get_messages_in_channelGet messages from a channel
Tool NameDescription
get_chat_id_withGet or create a chat with a user
send_chat_messageSend a message in a chat
get_chat_messagesGet messages from a chat
For more details about tool input schema, use the get_tools API.

Next Steps

I