Microsoft Teams

Registre officiel Recherche et web

Connect Claude to Microsoft Teams — read/send messages, list channels, search chats.

Que pouvez-vous faire avec Microsoft Teams ?

  • One-click connect — visit /connect, sign in with Microsoft, done
  • Multi-tenant — any Microsoft 365 organization, any user
  • 11 tools — teams, channels, messages, chats, search, profile
  • Dual transport — STDIO for Claude Code, HTTP/SSE for Cowork & remote
  • Multi-user — each session gets isolated OAuth tokens
  • Auto-detect — picks the right transport based on launch method
  • Token caching — silent refresh, no re-login every session
  • Retry logic — automatic retries on throttled Graph API calls

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package microsoft-teams-mcp-server
Claude Code
claude mcp add microsoft-teams -- npx -y microsoft-teams-mcp-server@1.0.2
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "microsoft-teams": {
            "command": "npx",
            "args": [
                "-y",
                "microsoft-teams-mcp-server@1.0.2"
            ]
        }
    }
}

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. Teams MCP Server
  2. How It Works
  3. Features
  4. For Users: Connect in 1 Click
  5. For Developers: Self-Host
  6. For Claude Code Users: Local STDIO Mode
  7. Available Tools
  8. Architecture
  9. Environment Variables
  10. License
  11. Contributing

Teams MCP Server

The first open-source Microsoft Teams connector for Claude. Any Microsoft 365 user can connect — just sign in with your work account. No setup, no credentials, no self-hosting required.

Read messages, list channels, search across Teams, send messages — all from Claude Code, Claude Desktop, or Claude Cowork.

Built by SurgeEnterpriseAI.

How It Works

┌─────────────┐     Click "Connect"     ┌──────────────────────┐
│ Claude User  │ ──────────────────────► │ Teams MCP Server     │
│ (Cowork/     │                         │ (hosted by Surge)    │
│  Desktop/    │     SSE/MCP Protocol    │                      │
│  Code)       │ ◄─────────────────────► │  ┌────────────────┐  │
└─────────────┘                          │  │ OAuth (common)  │  │
                                         │  │ Any M365 user   │  │
       User signs in with their          │  │ can sign in     │  │
       own Microsoft account             │  └───────┬────────┘  │
       ─────────────────────►            │          │           │
                                         │  ┌───────▼────────┐  │
                                         │  │ Microsoft       │  │
                                         │  │ Graph API       │  │
                                         │  └────────────────┘  │
                                         └──────────────────────┘

The user connects their own Microsoft 365 account. They see their own teams, their own channels, their own messages. Each user's tokens are isolated. The server is the bridge — it never stores messages, just passes them through.

Features

  • One-click connect — visit /connect, sign in with Microsoft, done
  • Multi-tenant — any Microsoft 365 organization, any user
  • 11 tools — teams, channels, messages, chats, search, profile
  • Dual transport — STDIO for Claude Code, HTTP/SSE for Cowork & remote
  • Multi-user — each session gets isolated OAuth tokens
  • Auto-detect — picks the right transport based on launch method
  • Token caching — silent refresh, no re-login every session
  • Retry logic — automatic retries on throttled Graph API calls
  • TypeScript — fully typed, clean architecture, MIT licensed

For Users: Connect in 1 Click

If someone is already hosting this server (e.g., on https://teams-mcp.surgeai.com):

  1. Claude asks you to connect Microsoft Teams
  2. You click the auth link
  3. Sign in with your Microsoft work account
  4. Done — Claude can now read your Teams

No API keys, no Azure portal, no setup.

For Developers: Self-Host

1. Clone & Install
git clone https://github.com/SurgeEnterpriseAI/teams-mcp-server.git
cd teams-mcp-server
npm install
npm run build
2. Azure AD App Registration
  1. Go to Azure Portal → App registrations → New registration
  2. Name: Teams MCP Server
  3. Supported account types: "Accounts in any organizational directory (Any Azure AD directory - Multitenant)"
  4. Redirect URI: Web → https://your-server.com/auth/callback
  5. Click Register

Configure:

  • Certificates & secrets → New client secret → copy the Value
  • API Permissions → Add Delegated (Microsoft Graph):
    • ChannelMessage.Read.All, ChannelMessage.Send
    • Chat.Read, Chat.ReadWrite, ChatMessage.Send
    • Team.ReadBasic.All, Channel.ReadBasic.All
    • User.Read
  • Click Grant admin consent (for your own tenant; other tenants consent on first login)
3. Configure & Deploy
cp .env.example .env
# Set TEAMS_CLIENT_ID, TEAMS_CLIENT_SECRET
# Set BASE_URL and REDIRECT_URI to your production URL
# TEAMS_AUTHORITY=common (multi-tenant, default)

Deploy to Railway, Render, Azure App Service, or any Node.js host:

# Railway
railway login && railway init && railway up

# Or Azure
az webapp up --name teams-mcp-server --runtime "NODE:20-lts"

# Or just run directly
TRANSPORT_MODE=http node dist/index.js
4. Submit to MCP Registry

Once deployed and tested, submit your server URL to Anthropic's MCP connector registry. Users will then see "Microsoft Teams" as a connect option in Claude Cowork — just like Slack and Gmail.

For Claude Code Users: Local STDIO Mode

Add to your .mcp.json:

{
  "mcpServers": {
    "teams": {
      "command": "node",
      "args": ["/path/to/teams-mcp-server/dist/index.js"],
      "cwd": "/path/to/teams-mcp-server"
    }
  }
}

First run will open your browser for Microsoft login. After that, tokens are cached.

Available Tools

ToolWhat it does
teams_list_teamsList all your Teams
teams_list_channelsList channels in a team
teams_read_channel_messagesRead recent channel messages
teams_send_channel_messageSend a message to a channel
teams_reply_to_messageReply in a channel thread
teams_read_message_repliesRead thread replies
teams_list_chatsList your DMs and group chats
teams_read_chat_messagesRead messages from a chat
teams_send_chat_messageSend a direct/group chat message
teams_search_messagesSearch messages across all Teams
teams_get_profileGet your Microsoft 365 profile

Architecture

src/
├── index.ts               Main entry (auto-detects transport)
├── config.ts              Central configuration
├── logger.ts              Structured logging
├── types.ts               TypeScript interfaces
├── sessions.ts            Multi-user session manager
├── auth/
│   ├── oauth.ts           MSAL OAuth (multi-tenant, per-user)
│   └── token-store.ts     Persistent token cache
├── graph/
│   ├── client.ts          Graph HTTP client with retries
│   ├── teams.ts           Teams & channels API
│   ├── messages.ts        Channel messages API
│   ├── chats.ts           DM & group chat API
│   └── search.ts          Search & profile API
├── mcp/
│   ├── server.ts          MCP server factory
│   └── tools/             11 tool definitions
├── transport/
│   ├── stdio.ts           STDIO (Claude Code)
│   └── http.ts            Express + SSE (Cowork / remote)

Environment Variables

VariableRequiredDefaultDescription
TEAMS_CLIENT_IDYes—Azure AD app client ID
TEAMS_CLIENT_SECRETYes—Azure AD client secret
TEAMS_AUTHORITYNocommoncommon for multi-tenant, or a specific tenant ID
TRANSPORT_MODENoautoauto, stdio, or http
PORTNo3000HTTP server port
BASE_URLNohttp://localhost:3000Public URL
REDIRECT_URINo{BASE_URL}/auth/callbackOAuth callback URL
TOKEN_STORE_PATHNo./.data/tokensToken cache directory
LOG_LEVELNoinfoLogging level

License

MIT — LICENSE

Contributing

Issues and PRs welcome. Built by SurgeEnterpriseAI.

Questions fréquentes

Qu'est-ce que Microsoft Teams ?

Connect Claude to Microsoft Teams — read/send messages, list channels, search chats.

Comment installer Microsoft Teams ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add microsoft-teams -- npx -y microsoft-teams-mcp-server@1.0.2. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour Microsoft Teams ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

Microsoft Teams est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient Microsoft Teams ?

Il est publié par SurgeEnterpriseAI. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.