teams-mcp-device-flow
v1.0.0
Published
Microsoft Teams MCP Server - Graph API based Teams management with Device Flow authentication for Claude Desktop and Claude Code
Maintainers
Readme
Teams MCP Server
Microsoft Teams MCP Server using Device Flow authentication for Claude Desktop and Claude Code.
Features
- 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
Setup
1. Create Azure AD App Registration
- Go to Azure Portal
- Navigate to Azure Active Directory → App registrations
- Click New registration
- Name:
Teams MCP - Supported account types: Select based on your needs
- Personal Microsoft accounts only
- Work/School accounts only
- Both (Multitenant + personal)
- Redirect URI: Leave empty (not needed for device flow)
- Click Register
2. Configure API Permissions
In your app registration, go to API permissions → Add a permission → Microsoft Graph → Delegated permissions:
Add these permissions:
User.ReadTeam.ReadBasic.AllChannel.ReadBasic.AllChannelMessage.Read.AllChannelMessage.SendChat.ReadWriteChatMessage.ReadChatMessage.SendOnlineMeetings.ReadWritePresence.ReadPresence.Read.All
Click Grant admin consent (if you're an admin) or ask your admin.
3. Enable Public Client Flow
- Go to Authentication
- Under Advanced settings, set Allow public client flows to Yes
- Save
4. Get Your Client ID
Copy the Application (client) ID from the Overview page.
5. Configure Environment
Create a .env file:
TEAMS_CLIENT_ID=your-client-id-here
TEAMS_TENANT_ID=common6. Build and Run
npm install
npm run build
npm startOn first run, a browser window will open for Microsoft authentication.
MCP Configuration
Add to your Claude Code or Claude Desktop MCP config:
{
"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"
}
}
}
}Available Tools
Teams
get_my_teams- List all Teams you're a member ofget_team- Get details of a specific Team
Channels
get_team_channels- List channels in a Teamget_channel- Get channel detailsget_channel_messages- Read channel messagesget_channel_message_replies- Get replies to a messagesend_channel_message- Post to a channelreply_to_channel_message- Reply to a channel message
Chats
get_my_chats- List all 1:1 and group chatsget_chat- Get chat details with membersget_chat_messages- Read chat messagessend_chat_message- Send a chat messagecreate_chat- Start a new chat
Meetings
create_meeting- Create a Teams meetingget_my_meetings- List your meetings
Presence
get_my_presence- Get your statusget_users_presence- Get multiple users' statusset_my_presence- Set your status
Search
search_messages- Search across Teams
Utility
get_current_user- Get your user info
Token Storage
Tokens are stored at: ~/.claude/connectors/teams/msal-cache.json
To logout/re-authenticate, delete this file.
License
MIT
