Microsoft Teams MCP Server - Graph API based Teams management with Device Flow authentication for Claude Desktop and Claude Code
npm install teams-mcp-device-flowMicrosoft Teams MCP Server using Device Flow authentication for Claude Desktop and Claude Code.
- Teams Management: List and access your Teams
- Channel Operations: Read/send messages in channels, reply to threads
- Chat Operations: 1:1 and group chats, create new conversations
- Meetings: Create and manage Teams meetings
- Presence: Get/set online status
- Search: Search messages across Teams
1. Go to Azure Portal
2. Navigate to Azure Active Directory → App registrations
3. Click New registration
4. Name: Teams MCP
5. Supported account types: Select based on your needs
- Personal Microsoft accounts only
- Work/School accounts only
- Both (Multitenant + personal)
6. Redirect URI: Leave empty (not needed for device flow)
7. Click Register
In your app registration, go to API permissions → Add a permission → Microsoft Graph → Delegated permissions:
Add these permissions:
- User.Read
- Team.ReadBasic.All
- Channel.ReadBasic.All
- ChannelMessage.Read.All
- ChannelMessage.Send
- Chat.ReadWrite
- ChatMessage.Read
- ChatMessage.Send
- OnlineMeetings.ReadWrite
- Presence.Read
- Presence.Read.All
Click Grant admin consent (if you're an admin) or ask your admin.
1. Go to Authentication
2. Under Advanced settings, set Allow public client flows to Yes
3. Save
Copy the Application (client) ID from the Overview page.
Create a .env file:
``bash`
TEAMS_CLIENT_ID=your-client-id-here
TEAMS_TENANT_ID=common
`bash`
npm install
npm run build
npm start
On first run, a browser window will open for Microsoft authentication.
Add to your Claude Code or Claude Desktop MCP config:
`json`
{
"mcpServers": {
"teams": {
"type": "stdio",
"command": "node",
"args": ["/path/to/teams-mcp/build/index.js"],
"env": {
"TEAMS_CLIENT_ID": "your-client-id",
"TEAMS_TENANT_ID": "common"
}
}
}
}
- List all Teams you're a member of
- get_team - Get details of a specific Team$3
- get_team_channels - List channels in a Team
- get_channel - Get channel details
- get_channel_messages - Read channel messages
- get_channel_message_replies - Get replies to a message
- send_channel_message - Post to a channel
- reply_to_channel_message - Reply to a channel message$3
- get_my_chats - List all 1:1 and group chats
- get_chat - Get chat details with members
- get_chat_messages - Read chat messages
- send_chat_message - Send a chat message
- create_chat - Start a new chat$3
- create_meeting - Create a Teams meeting
- get_my_meetings - List your meetings$3
- get_my_presence - Get your status
- get_users_presence - Get multiple users' status
- set_my_presence - Set your status$3
- search_messages - Search across Teams$3
- get_current_user - Get your user infoToken Storage
Tokens are stored at:
~/.claude/connectors/teams/msal-cache.json`To logout/re-authenticate, delete this file.
MIT