Skip to main content

Microsoft 365 Teams MCP Server

Create a powerful Model Context Protocol (MCP) server for Microsoft Teams in minutes with our AI Gateway. This guide walks you through setting up seamless Teams integration with enterprise-grade security and instant OAuth authentication.

About Microsoft Teams API

Microsoft Teams is the hub for teamwork in Microsoft 365, serving over 280 million users globally. The Teams API (part of Microsoft Graph) provides comprehensive access to Teams functionality:

  • Team Management: Create, configure, and manage teams and their settings
  • Channel Operations: Create channels, post messages, manage tabs and apps
  • Chat Management: Send messages, create chats, manage participants
  • Meeting Orchestration: Schedule, update, and manage online meetings
  • App Integration: Install and configure Teams apps and tabs
  • File Collaboration: Share and manage files within teams and channels
  • Calling & Media: Make calls, manage call records and transcripts
  • Notifications: Send activity feed notifications to users

Key Features

  • Microsoft Graph API: Unified endpoint for all Microsoft 365 services
  • Real-time Webhooks: Change notifications for teams, channels, and messages
  • Rich Messaging: Adaptive cards, mentions, and formatting
  • Compliance: eDiscovery, retention policies, and data governance
  • Throttling: 10,000 requests per 10 minutes per app per tenant
  • File Size: Up to 4MB for messages, larger for file attachments
  • Global Scale: Works across Microsoft's worldwide infrastructure
  • Security: Enterprise-grade security with conditional access

What You Can Do with Teams MCP Server

The MCP server transforms Microsoft Teams' API into a natural language interface, enabling AI agents to:

Team & Channel Management

  • Smart Team Creation

    • "Create a team for Project Apollo with channels for design, development, and testing"
    • "Set up a private team for the executive leadership group"
    • "Clone the Marketing team structure for the new product launch"
  • Channel Organization

    • "Create a private channel for budget discussions in Finance team"
    • "Archive the completed-projects channel"
    • "Set up standard channels for all new project teams"
  • Member Management

    • "Add all engineers to the DevOps team"
    • "Make Sarah an owner of the Product team"
    • "Remove inactive members from all teams"

Communication & Collaboration

  • Intelligent Messaging

    • "Post the sprint summary to the development channel"
    • "Send a urgent message to all team owners about the security update"
    • "Reply to John's question in the architecture discussion thread"
  • Meeting Management

    • "Schedule a weekly standup for the engineering team"
    • "Create a meeting with all stakeholders for project kickoff"
    • "Generate meeting notes from today's product review"
  • Announcement Broadcasting

    • "Post company update to all department teams"
    • "Send onboarding information to new hire channels"
    • "Announce maintenance window in IT channels"

Analytics & Insights

  • Team Activity Monitoring

    • "Show me the most active teams this month"
    • "Analyze message patterns in customer support channels"
    • "Identify teams that haven't been active in 30 days"
  • Communication Intelligence

    • "Summarize key decisions from leadership channels"
    • "Extract action items from all project meetings this week"
    • "Find unanswered questions in support channels"

Workflow Automation

  • Smart Routing

    • "Route IT requests to appropriate support channels"
    • "Escalate high-priority messages to management"
    • "Distribute daily reports to relevant teams"
  • Scheduled Operations

    • "Post daily standup prompts to all development teams"
    • "Send weekly project status reminders"
    • "Share month-end reports automatically"

Enterprise Integration

  • Cross-Platform Sync

    • "Mirror important Teams messages to email"
    • "Create Planner tasks from channel conversations"
    • "Sync Teams files to SharePoint document libraries"
  • AI-Enhanced Features

    • "Generate meeting summaries with action items"
    • "Translate messages for international teams"
    • "Create FAQ from frequently discussed topics"

Prerequisites

  • Access to Cequence AI Gateway
  • Microsoft 365 tenant with Teams enabled
  • Azure Active Directory access
  • Global administrator or Teams administrator role
  • Azure app registration permissions

Step 1: Register Azure AD Application

Before setting up the MCP server, you need to register an application in Azure AD.

1.1 Access Azure Portal

  1. Navigate to portal.azure.com
  2. Go to Azure Active Directory App registrations
  3. Click New registration

1.2 Configure Application

  1. Set application details:

    • Name: "AI Gateway Teams MCP"
    • Supported account types: Choose based on your needs:
      • Single tenant (your organization only)
      • Multi-tenant (any Azure AD directory)
    • Redirect URI: Web platform
      https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
  2. Click Register

1.3 Configure API Permissions

  1. Go to API permissions
  2. Click Add a permission Microsoft Graph
  3. Choose Delegated permissions
  4. Add required permissions (see Available Scopes section)
  5. Click Grant admin consent (if you have admin rights)

1.4 Create Client Secret

  1. Go to Certificates & secrets
  2. Click New client secret
  3. Add description: "AI Gateway MCP"
  4. Choose expiration period
  5. Click Add
  6. Important: Copy the secret value immediately (shown only once)

1.5 Note Application Details

From the Overview page, note:

  • Application (client) ID
  • Directory (tenant) ID
  • Client secret (from previous step)

Step 2: Access AI Gateway Apps

  1. Log in to your Cequence AI Gateway dashboard
  2. Navigate to Apps in the left sidebar
  3. You'll see the list of available third-party applications

Step 3: Find and Select Microsoft Teams API

  1. In the Apps section, browse through the Third-party category
  2. Look for Microsoft 365 Teams or use the search function
  3. Click on the Teams API card to view details

The Teams API card shows:

  • Number of available endpoints
  • Integration capabilities
  • Quick description of functionality

Step 4: Create MCP Server

  1. Click the Create MCP Server button on the Teams API card
  2. You'll be redirected to the MCP Server creation wizard

Step 5: Configure API Endpoints

In the App Configuration step:

  1. Base URL is pre-filled: https://graph.microsoft.com
  2. Select API endpoints to expose to your MCP server based on your needs
  3. Click Next to proceed

Step 6: MCP Server Basic Setup

Configure your MCP server details:

  1. MCP Server Name: Enter a descriptive name

    • Example: "Teams Collaboration Automation"
    • This name will identify your server in the dashboard
  2. Description (Optional): Add details about the server's purpose

    • Example: "Automated Teams operations for enterprise collaboration"
  3. Production Mode: Toggle based on your needs

    • ON for production environments
    • OFF for development/testing
  4. Click Next to continue

Step 7: Configure Authentication

This is where you'll use your Azure AD application details:

  1. Authentication Type: Select OAuth 2.0

  2. Fill in the OAuth configuration:

    • Authorization URL:
      https://login.microsoftonline.com/common/oauth2/v2.0/authorize
    • Token URL:
      https://login.microsoftonline.com/common/oauth2/v2.0/token
    • Client ID: Paste from Azure AD app registration
    • Client Secret: Paste from Azure AD app registration
    • Redirect URI:
      https://auth.aigateway.cequence.ai/v1/outbound/oauth/callback
  3. Scopes: Select from the available Teams scopes (see next section)

Available Microsoft Teams OAuth Scopes

Configure the appropriate scopes based on your application needs:

Team and Channel Management

  • https://graph.microsoft.com/Team.ReadBasic.All

    • Read basic properties of all teams
    • List teams in organization
    • View team display names and descriptions
  • https://graph.microsoft.com/TeamSettings.Read.All

    • Read all teams' settings
    • View team configurations
    • Access team templates and properties
  • https://graph.microsoft.com/TeamSettings.ReadWrite.All

    • Read and update team settings
    • Configure team properties
    • Manage team templates

Channel Operations

  • https://graph.microsoft.com/Channel.ReadBasic.All

    • Read basic channel properties
    • List channels in teams
    • View channel names and descriptions
  • https://graph.microsoft.com/ChannelSettings.Read.All

    • Read all channel settings
    • View channel configurations
    • Access channel properties
  • https://graph.microsoft.com/ChannelSettings.ReadWrite.All

    • Read and update channel settings
    • Configure channel properties
    • Manage channel tabs and apps

Messaging

  • https://graph.microsoft.com/ChannelMessage.Read.All

    • Read messages in all channels
    • Access message content and metadata
    • View message history
  • https://graph.microsoft.com/ChannelMessage.Send

    • Send messages to channels
    • Post on behalf of the user
    • Create new conversations

Chat Operations

  • https://graph.microsoft.com/Chat.Read

    • Read user's chat messages
    • Access one-on-one and group chats
    • View chat metadata
  • https://graph.microsoft.com/Chat.ReadWrite

    • Read and send chat messages
    • Create new chats
    • Manage chat participants

For Team Collaboration:

Team.ReadBasic.All
Channel.ReadBasic.All
ChannelMessage.Read.All
ChannelMessage.Send

For Full Team Management:

Team.ReadBasic.All
TeamSettings.ReadWrite.All
Channel.ReadBasic.All
ChannelSettings.ReadWrite.All
ChannelMessage.Read.All
ChannelMessage.Send

For Chat Integration:

Chat.Read
Chat.ReadWrite
ChannelMessage.Read.All
ChannelMessage.Send

Step 8: Configure Security

Set up API protection features:

  1. API Protection: Toggle ON to enable

    • Protects against bot attacks, DDoS, and threats
    • Monitors for suspicious activity
    • Rate limiting and anomaly detection
  2. Protection Features (when enabled):

    • Auto-scaling protection
    • Managed infrastructure
    • Built-in monitoring
    • Zero maintenance required
  3. Click Next to continue

Step 9: Choose Deployment Method

Select your deployment preference:

  • Fully managed deployment
  • Automatic scaling and monitoring
  • Built-in high availability
  • Features included:
    • Auto-scaling
    • Managed infrastructure
    • Built-in monitoring
    • Zero maintenance

Option B: Deploy with Helm Chart

  • Self-managed Kubernetes deployment
  • Full control over infrastructure
  • Requires:
    • Kubernetes cluster
    • Helm 3.x installed
    • Container registry access

Click Next after selecting your deployment method.

Step 10: Review and Deploy

Review your MCP server configuration:

  • MCP Server Name: Your chosen name
  • Base URL: https://graph.microsoft.com
  • Selected Endpoints: Number of endpoints selected
  • Authentication: OAuth 2.0 (Configured)
  • API Protection: Enabled/Disabled
  • Deployment: Cequence Cloud or Helm

Click Create & Deploy to finalize the setup.

Step 11: Post-Deployment Setup

After successful deployment:

  1. Note the MCP Server URL provided

  2. Test the OAuth flow:

    • Click "Test Connection"
    • You'll be redirected to Microsoft login
    • Sign in with your Microsoft 365 account
    • Authorize the requested permissions
    • Confirm successful connection
  3. Configure AI Agents:

    • The MCP server is now available for AI agent connections
    • Use the provided server URL in your AI agent configuration

Using Your Teams MCP Server

With Claude Desktop

  1. Open Claude Desktop settings

  2. Add your MCP server:

    {
    "servers": {
    "teams": {
    "url": "your-mcp-server-url",
    "auth": {
    "type": "oauth2",
    "client_id": "your-client-id"
    }
    }
    }
    }
  3. Start using natural language commands:

    • "Create a team called 'Q1 Planning' with channels for each department"
    • "Post the meeting notes to the leadership channel"
    • "Find all messages about budget in the finance team"
    • "Schedule a weekly sync meeting for the product team"
    • "List all teams I'm a member of"

API Integration Example

// Initialize MCP client
const mcpClient = new MCPClient({
serverUrl: 'your-mcp-server-url',
auth: {
type: 'oauth2',
token: 'user-access-token'
}
});

// Create a team
const team = await mcpClient.teams.create({
displayName: 'Project Apollo',
description: 'Team for Apollo project',
members: [
{
userId: 'user1@company.com',
roles: ['owner']
}
]
});

// Create a channel
await mcpClient.teams.channels.create({
teamId: team.id,
displayName: 'Development',
description: 'Development discussions'
});

// Post a message
await mcpClient.teams.messages.send({
teamId: team.id,
channelId: 'channel-id',
body: {
contentType: 'html',
content: '<b>Welcome to Project Apollo!</b>'
}
});

// Schedule a meeting
await mcpClient.teams.meetings.create({
subject: 'Project Kickoff',
startDateTime: '2025-02-01T10:00:00',
endDateTime: '2025-02-01T11:00:00',
attendees: ['user1@company.com', 'user2@company.com']
});

Common Use Cases

Project Management

  • Automated team provisioning
  • Channel structure templates
  • Progress update automation
  • Resource allocation tracking

IT Operations

  • Service desk integration
  • Incident response coordination
  • Change management workflows
  • System status updates

HR & Onboarding

  • New employee team setup
  • Onboarding task automation
  • Company announcement distribution
  • Employee engagement surveys

Sales & Customer Success

  • Deal room creation
  • Customer collaboration spaces
  • Sales team coordination
  • Success metric reporting

Security Best Practices

  1. Permission Management:

    • Follow principle of least privilege
    • Use application permissions sparingly
    • Regular permission audits
  2. Authentication Security:

    • Use certificate credentials for production
    • Implement credential rotation
    • Enable conditional access policies
  3. Data Protection:

    • Respect data retention policies
    • Implement encryption at rest
    • Follow compliance requirements
  4. Access Control:

    • Limit app access to specific teams
    • Implement IP restrictions
    • Monitor API usage patterns

Troubleshooting

Common Issues

  1. Authentication Failed

    • Verify Azure AD app configuration
    • Check redirect URIs match exactly
    • Ensure admin consent is granted
    • Validate tenant restrictions
  2. Insufficient Privileges

    • Add required Graph API permissions
    • Grant admin consent for permissions
    • Check user has Teams license
  3. Rate Limiting (429 errors)

    • Microsoft Graph throttling: 10,000 requests/10 minutes
    • Implement retry logic with backoff
    • Use batch requests when possible
  4. Team/Channel Not Found

    • Ensure user has access to team
    • Check team isn't archived
    • Verify correct tenant context

Getting Help