
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
msteams-mcp-server
Advanced tools
Microsoft Teams MCP Server - Complete Teams integration for Claude Desktop and MCP clients with secure OAuth2 authentication and comprehensive team management
A comprehensive Model Context Protocol (MCP) server that enables complete Microsoft Teams integration through natural language interactions. Built for Claude Desktop, SIYA Desktop, and any MCP-compatible application with production-ready security.
authenticate
- Complete authentication management (login, logout, status)manage_teams
- UNIFIED: List, search, create teams, and manage team membersmanage_channels
- UNIFIED: List, search, and create channels within teamsmanage_members
- UNIFIED: Add and remove team members with rolessend_message
- Send messages to team channels with rich formatting and mentionsmanage_messages
- UNIFIED: Get and search messages in channelssend_direct_message
- Send direct/private messages to usersget_direct_messages
- Retrieve direct message conversationsmanage_reactions
- NEW: Add/remove emoji reactions to messages (👍❤️😂😮😢😠)manage_replies
- NEW: Reply to messages and get threaded conversationsmanage_files
- NEW: Upload, download, and list files in teams and channelsmanage_group_chats
- NEW: Create group chats, manage members, and chat settingsmanage_meetings
- NEW: Create online meetings, manage calendar eventsmanage_presence
- NEW: Get and set user presence/status informationsearch_users
- Find users in your organization# 1. Authenticate with Microsoft Teams (one-time setup)
npx msteams-mcp-server --login
# 2. Verify authentication
npx msteams-mcp-server --verify-login
# 3. Add to Claude Desktop (see configuration below)
# 4. Start chatting with Claude about your Teams!
# Install globally
npm install -g msteams-mcp-server
# Authenticate
msteams-mcp-server --login
# Verify setup
msteams-mcp-server --verify-login
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
For NPX (Recommended):
{
"mcpServers": {
"teams": {
"command": "npx",
"args": ["msteams-mcp-server"]
}
}
}
For Global Installation:
{
"mcpServers": {
"teams": {
"command": "msteams-mcp-server"
}
}
}
After adding the configuration, restart Claude Desktop to load the MCP server.
When you first use the authenticate tool or any Teams command:
Call authenticate tool:
Use the authenticate tool with action "login"
Get OAuth redirect URL: Claude will show you:
🔐 Microsoft Teams Authentication Required
🌐 Please complete authentication:
1. Visit: [OAuth Authentication URL]
2. Sign in with your Microsoft account
3. Complete the authorization process
💡 Direct link: [Click here to authenticate]
Complete in browser: Follow the link and sign in with your Microsoft account
Automatic completion: The system automatically detects when authentication is complete
Once authenticated, you can:
Action | Purpose | When to Use |
---|---|---|
login | Start OAuth redirect flow | First time or when tokens expire |
status | Check current auth state | Verify you're logged in |
logout | Clear all stored tokens | When switching accounts |
🔵 Team Management:
"What teams am I a member of?"
"Create a new private team called 'Secret Project' with john@company.com as owner"
"Add sarah@company.com to the marketing team as an owner"
"List all channels in the development team"
🔵 Messaging & Communication:
"Send a message to the general channel saying 'Hello team! 👋'"
"Reply to the latest message in the project channel with 'Great work!'"
"Add a heart reaction to the latest message in the team chat"
"Send a direct message to Alice saying 'Can we schedule a call?'"
🔵 File Management:
"Upload the project plan document to the team files"
"List all files in the marketing channel"
"Download the latest budget spreadsheet from the finance team"
🔵 Group Chats:
"Create a group chat with Bob, Carol, and Dave for project discussion"
"List all my group chats"
"Add Emma to the project planning group chat"
🔵 Meeting Management:
"Create a meeting tomorrow at 2 PM for project review with the team"
"Show me my calendar events for this week"
"List all my online meetings"
🔵 Presence & Status:
"Set my status to 'Do Not Disturb' for the next hour"
"Check Alice's availability status"
"Show me the status of all development team members"
🔵 Advanced Operations:
"Search for messages containing 'project update' in the last 7 days"
"Find all files shared in the marketing channel this month"
"Get all replies to the latest announcement in the general channel"
// Start authentication
{
"tool": "teams_authenticate",
"arguments": {
"action": "login"
}
}
// Check current status
{
"tool": "teams_authenticate",
"arguments": {
"action": "status"
}
}
// Add reaction to message
{
"tool": "manage_reactions",
"arguments": {
"action": "add",
"messageType": "channel",
"teamId": "team-id",
"channelId": "channel-id",
"messageId": "message-id",
"reactionType": "heart"
}
}
// Reply to message
{
"tool": "manage_replies",
"arguments": {
"action": "reply",
"messageType": "channel",
"teamId": "team-id",
"channelId": "channel-id",
"messageId": "message-id",
"content": "Thanks for the update!"
}
}
// Send direct message
{
"tool": "send_direct_message",
"arguments": {
"displayName": "Alice Johnson",
"content": "Can we schedule a quick call?"
}
}
// Upload file to team
{
"tool": "manage_files",
"arguments": {
"action": "upload",
"location": "team",
"teamId": "team-id",
"fileName": "project-plan.pdf",
"fileContent": "base64-encoded-content",
"mimeType": "application/pdf"
}
}
// List files in channel
{
"tool": "manage_files",
"arguments": {
"action": "list",
"location": "channel",
"teamId": "team-id",
"channelId": "channel-id"
}
}
// Download file
{
"tool": "manage_files",
"arguments": {
"action": "download",
"driveId": "drive-id",
"itemId": "file-id"
}
}
// Create group chat
{
"tool": "manage_group_chats",
"arguments": {
"action": "create",
"topic": "Project Planning",
"members": ["user1-id", "user2-id", "user3-id"]
}
}
// List group chats
{
"tool": "manage_group_chats",
"arguments": {
"action": "list"
}
}
// Add members to group chat
{
"tool": "manage_group_chats",
"arguments": {
"action": "add_members",
"chatId": "chat-id",
"members": ["new-user-id"]
}
}
// Create online meeting
{
"tool": "manage_meetings",
"arguments": {
"action": "create_meeting",
"subject": "Project Review",
"startDateTime": "2024-01-15T14:00:00Z",
"endDateTime": "2024-01-15T15:00:00Z",
"attendees": ["alice@company.com", "bob@company.com"],
"isRecordingEnabled": true
}
}
// Get calendar events
{
"tool": "manage_meetings",
"arguments": {
"action": "get_calendar",
"startTime": "2024-01-15T00:00:00Z",
"endTime": "2024-01-22T23:59:59Z"
}
}
// Set user presence
{
"tool": "manage_presence",
"arguments": {
"action": "set_presence",
"availability": "DoNotDisturb",
"activity": "InAMeeting",
"expirationDuration": "PT2H"
}
}
// Get user presence
{
"tool": "manage_presence",
"arguments": {
"action": "get_presence",
"userId": "user-id"
}
}
// Get bulk presence
{
"tool": "manage_presence",
"arguments": {
"action": "get_bulk_presence",
"userIds": ["user1-id", "user2-id", "user3-id"]
}
}
For enterprise scenarios with custom Azure applications:
export TEAMS_CLIENT_ID="your-azure-app-client-id"
export TEAMS_TENANT_ID="your-tenant-id-or-common"
export TEAMS_CLIENT_SECRET="your-client-secret"
export TEAMS_REDIRECT_URI="http://localhost:44005/oauth2callback"
export TEAMS_AUTH_TYPE="redirect" # OAuth redirect flow
export USER_ID="your-user-identifier" # Used for OAuth state parameter
For advanced scenarios or enterprise requirements:
Go to Azure Portal: https://portal.azure.com
Navigate to: Azure Active Directory > App registrations
Create new registration:
http://localhost:44005/oauth2callback
Configure API Permissions:
Microsoft Graph > Delegated permissions:
✅ Team.ReadBasic.All - List teams
✅ Team.Create - Create teams
✅ TeamMember.ReadWrite.All - Manage members
✅ Channel.ReadBasic.All - List channels
✅ ChannelMessage.Send - Send messages
✅ ChannelMessage.ReadWrite - Read/reply to messages
✅ Chat.ReadWrite - Access chats and group chats
✅ ChatMessage.Send - Send chat messages
✅ ChatMessage.Read - Read chat messages
✅ OnlineMeetings.ReadWrite - Manage meetings
✅ Calendars.ReadWrite - Calendar access
✅ Presence.ReadWrite - Read/write presence
✅ Files.ReadWrite.All - File management
✅ User.Read - User profile
✅ Directory.Read.All - Search users
Grant admin consent for the permissions
Get credentials and set environment variables
# Check if server is working
npx msteams-mcp-server --help
# Verify authentication
npx msteams-mcp-server --verify-login
# Test with MCP Inspector
npx @modelcontextprotocol/inspector npx msteams-mcp-server
# Check configuration directory
ls -la ~/.msteams-mcp/
Problem: Authentication fails or expires
# Solution: Reset and re-authenticate
npx msteams-mcp-server --reset-auth
npx msteams-mcp-server --login
Problem: "Invalid client" error
http://localhost:44005/oauth2callback
Problem: "Insufficient privileges"
Problem: NPX command not found
# Ensure Node.js >= 18 is installed
node --version
npm --version
# If not installed, get Node.js from: https://nodejs.org/
Problem: MCP server won't start in Claude
npx msteams-mcp-server --help
Problem: "Permission denied" errors for new features
Problem: Slow responses
maxResults
parameter to limit dataProblem: File upload/download timeouts
Problem: Bulk operations slow
✅ Fixed: Timeout issues with core operations (v1.0.25)
manage_teams
list operations now use optimized direct HTTP requestsmanage_channels
list operations bypass Graph SDK hanging issuesmanage_messages
get operations use direct HTTP for better reliabilitymanage_meetings
list operations handle unsupported query parameters correctly# Enable detailed logging
npx msteams-mcp-server --debug
# Check log files
cat /tmp/msteams-mcp-server.log
# Configuration directory
ls ~/.msteams-mcp/
# Files stored:
# - credentials.json (if using custom Azure app)
# - msal-cache.json (token cache)
# - token.json (authentication tokens)
~/.msteams-mcp/
for stored credentials and tokens--reset-auth
removes all stored authentication dataTool | Actions | Description |
---|---|---|
authenticate | login, logout, status | Authentication management |
manage_teams | list, search, create, get, get_members | Team operations |
manage_channels | list, search, create | Channel operations |
send_message | - | Send channel messages |
manage_messages | get, search | Retrieve and search messages |
send_direct_message | - | Send direct/private messages |
get_direct_messages | - | Get direct message conversations |
manage_reactions | add, remove | Add/remove emoji reactions |
manage_replies | reply, get_replies | Reply to messages and get threads |
manage_files | upload, download, list | File management |
manage_group_chats | create, list, get_members, add_members, remove_member | Group chat management |
manage_meetings | create_meeting, list_meetings, get_calendar | Meeting and calendar management |
manage_presence | get_presence, set_presence, get_bulk_presence | User presence/status |
manage_members | add, remove | Team member management |
search_users | - | Find users in organization |
like
- Thumbs upheart
- Heart/lovelaugh
- Laughingsurprised
- Surprisedsad
- Sadangry
- AngryAvailability: Available, Busy, DoNotDisturb, BeRightBack, Away Activity: Available, Busy, DoNotDisturb, BeRightBack, Away, InAMeeting, InACall
# Clone repository
git clone https://github.com/your-org/msteams-mcp-server.git
cd msteams-mcp-server
# Install dependencies
npm install
# Build project
npm run build
# Test locally
npm run dev
# Test with MCP Inspector
npx @modelcontextprotocol/inspector ./dist/index.js
msteams-mcp-server/
├── src/
│ ├── index.ts # Main MCP server with 12 tools
│ └── utils/
│ ├── api.ts # Logging utilities
│ ├── credential-store.ts # Secure credential storage
│ ├── teams-auth.ts # OAuth2 authentication
│ └── teams-operations.ts # Complete Teams API integration
├── bin/
│ └── cli.js # NPX entry point
├── dist/ # Compiled JavaScript
└── package.json # NPM configuration
MIT License - see LICENSE file for details.
# One command to get started:
npx msteams-mcp-server --login
# With custom user identifier for OAuth state:
npx msteams-mcp-server --login --user-id "user123"
# With custom redirect URI for OAuth:
npx msteams-mcp-server --login --redirect-uri "http://localhost:8080/callback"
# Then add to Claude Desktop and start chatting:
"Show me my Teams and create a group chat with my project team!"
Ready to supercharge your Teams workflow with AI? 🚀
Questions? Check the troubleshooting section or open an issue.
FAQs
Microsoft Teams MCP Server - Complete Teams integration for Claude Desktop and MCP clients with secure OAuth2 authentication and comprehensive team management
The npm package msteams-mcp-server receives a total of 493 weekly downloads. As such, msteams-mcp-server popularity was classified as not popular.
We found that msteams-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.